Problem
In local mode the agent tools are only reachable in-process, through the framework adapters
(as_openai_tools(), as_claude_mcp(), as_anthropic_tools()). Any MCP-speaking client outside
that Python process — Claude Desktop, Cursor, Cline, etc. — has no endpoint to connect to.
Cloud users can already attach such clients to the hosted MCP server (https://api.pageindex.ai/mcp);
local users cannot use their own library there at all. This is the open half of #137.
The README Today marks "MCP server" as Cloud-only (— in the Local column), which is accurate.
What already exists
pageindex/agent_tools.py carries the cloud-identical tool contract plus full local
implementations: _tool_specs() returns (name, description, schema, invoke) and
tool_names() gives browse_documents, get_document, get_document_structure,
get_page_content (+ remove_document behind include_management).
integrations/openai_agents.py and integrations/claude_agent_sdk.py already wrap those exact
specs in an in-process MCP server (CallToolResult.model_validate({"content": blocks, "isError": is_error})), so the result conversion is proven — only a standalone process is missing.
mcp>=1.19.0,<3 is already a required dependency, so no new dependency would be added.
Proposal (v1)
- New
pageindex/mcp_server.py: a server built over _tool_specs(...) for a
PageIndexLocalClient, with handlers doing await asyncio.to_thread(invoke, arguments) and
returning CallToolResult (server-side isError carried through).
- stdio transport only.
- A
pageindex-mcp console entry point ([tool.poetry.scripts]), e.g.
pageindex-mcp --storage-path <dir> [--management], config otherwise via the same env vars
the SDK uses.
- Tests: an in-process MCP session test (
tools/list + one tool call round-trip) and a stdio
smoke test.
- README: flip the Local column's "MCP server" cell and add a short client-config snippet.
Client config the server would enable:
{
"mcpServers": {
"pageindex-local": {
"command": "pageindex-mcp",
"args": ["--storage-path", "/path/to/index-store"]
}
}
}
Problem
In local mode the agent tools are only reachable in-process, through the framework adapters
(
as_openai_tools(),as_claude_mcp(),as_anthropic_tools()). Any MCP-speaking client outsidethat Python process — Claude Desktop, Cursor, Cline, etc. — has no endpoint to connect to.
Cloud users can already attach such clients to the hosted MCP server (
https://api.pageindex.ai/mcp);local users cannot use their own library there at all. This is the open half of #137.
The README Today marks "MCP server" as Cloud-only (
—in the Local column), which is accurate.What already exists
pageindex/agent_tools.pycarries the cloud-identical tool contract plus full localimplementations:
_tool_specs()returns(name, description, schema, invoke)andtool_names()givesbrowse_documents,get_document,get_document_structure,get_page_content(+remove_documentbehindinclude_management).integrations/openai_agents.pyandintegrations/claude_agent_sdk.pyalready wrap those exactspecs in an in-process MCP server (
CallToolResult.model_validate({"content": blocks, "isError": is_error})), so the result conversion is proven — only a standalone process is missing.mcp>=1.19.0,<3is already a required dependency, so no new dependency would be added.Proposal (v1)
pageindex/mcp_server.py: a server built over_tool_specs(...)for aPageIndexLocalClient, with handlers doingawait asyncio.to_thread(invoke, arguments)andreturning
CallToolResult(server-sideisErrorcarried through).pageindex-mcpconsole entry point ([tool.poetry.scripts]), e.g.pageindex-mcp --storage-path <dir> [--management], config otherwise via the same env varsthe SDK uses.
tools/list+ one tool call round-trip) and a stdiosmoke test.
Client config the server would enable:
{ "mcpServers": { "pageindex-local": { "command": "pageindex-mcp", "args": ["--storage-path", "/path/to/index-store"] } } }