Page Index allow LLM to interact for obtaining indexed documents
46
Local FastMCP server that exposes PageIndex tree indexes over CLI catalog workspaces (./workspace/{catalog}/) to agents in Cursor, Claude Desktop, and other MCP clients.
Forked from VectifyAI/PageIndex. Git Repo: https://github.com/mattbeen/pageindex-mcp
PageIndex builds a hierarchical “table of contents” tree from long documents (PDF via Docling → Markdown, or Markdown directly). This MCP lets agents:
MCP catalogs are the same filesystem layout as run_pageindex.py --catalog …. They are not PageIndexClient UUID / _meta.json workspaces.
| Tool | Purpose |
|---|---|
get_all_workspace | List catalog folders and a short document summary for each |
get_document | Document metadata (name, description, page/line count, status) |
get_document_structure | Full tree structure without body text (for section discovery) |
get_page_content | Text for page/line ranges (e.g. 5-7, 3,8, 12) |
insert_page_index | Index from file_path, url, or file_base64 into a catalog |
download_document | Return stored source as base64 (prefers PDF when both PDF and MD exist) |
delete_document | Remove structure JSON and companion .pdf / .md for a doc_id |
PDF inserts use the same pipeline as CLI --docling: Docling → Markdown → md_to_tree. Docling must be installed for PDF uploads.
Remote (HTTP):
"pageindex": {
"type": "remote",
"url": "http://127.0.0.1:8765/mcp/page-index/v1",
"enabled": true,
"timeout": 300000
}
Replace 127.0.0.1 with your machine IP when the server is bound with PAGEINDEX_MCP_HTTP_HOST=0.0.0.0.
Stdio:
{
"mcpServers": {
"pageindex": {
"command": "python",
"args": ["-m", "pageindex.mcp"],
"cwd": "/path/to/PageIndex",
"env": {
"PAGEINDEX_WORKSPACE_ROOT": "/path/to/PageIndex/workspace",
"OPENAI_API_KEY": "your_key_here"
}
}
}
}
Published image: mattbeen/pageindex-mcp (includes Docling for PDF insert).
docker pull mattbeen/pageindex-mcp:0.1.0
Create host folders and a config file, then start HTTP MCP on port 8765:
mkdir -p workspace uploads
# optional: copy config.example.yaml → pageindex/config.yaml (or any path you mount)
docker run -d --name pageindex-mcp \
-p 8765:8765 \
-e OPENAI_API_KEY=your_key_here \
-e OPENAI_BASE_URL=http://your-litellm-host:8080/v1 \
-e PAGEINDEX_WORKSPACE_ROOT=/data/workspace \
-e PAGEINDEX_CONFIG_PATH=/config/config.yaml \
-e PAGEINDEX_MCP_HTTP_HOST=0.0.0.0 \
-e PAGEINDEX_MCP_HTTP_PORT=8765 \
-e PAGEINDEX_MCP_HTTP_PATH=/mcp/page-index/v1 \
-v "$(pwd)/workspace:/data/workspace" \
-v "$(pwd)/pageindex/config.yaml:/config/config.yaml:ro" \
-v "$(pwd)/uploads:/data/uploads" \
mattbeen/pageindex-mcp:0.1.0
| Variable | Default | Meaning |
|---|---|---|
PAGEINDEX_WORKSPACE_ROOT | ./workspace | Catalog root |
PAGEINDEX_MCP_HTTP_HOST | 127.0.0.1 | Bind address (0.0.0.0 for LAN) |
PAGEINDEX_MCP_HTTP_PORT | 8765 | HTTP port |
PAGEINDEX_MCP_HTTP_PATH | /mcp/page-index/v1 | Streamable HTTP path |
http://localhost:8765/mcp/page-index/v1workspace → catalogs; config.yaml → model/summary settings; uploads → use file_path like /data/uploads/doc.pdf0.0.0.0:8765 inside the containerFrom this repo:
cp .env.example .env
mkdir -p workspace uploads
docker compose up --build -d
To use the Hub image instead of building, set image: mattbeen/pageindex-mcp:0.1.0 in docker-compose.yml (or pull first and retag). Same mounts and MCP URL as above.
./workspace/
{catalog}/
{stem}.md # Docling or uploaded Markdown
{stem}.pdf # optional original PDF
{stem}_structure.json # tree index
/, \, ., ..).doc_id — document stem (filename without _structure / _structure_flash).insert_page_index — always persists the source into the catalog; requires a named catalog (no flat-root indexing in v1).See [CONTEXT.md](CONTEXT.md) for invariants and ownership boundaries.
Same catalog layout without MCP:
python run_pageindex.py --pdf_path /path/to/doc.pdf --docling --catalog finance
python run_pageindex.py --md_path /path/to/doc.md --catalog finance
Flash (heuristic PDF structure, optional extra): python run_pageindex.py --flash --pdf_path …. Details: [CONTEXT.md](CONTEXT.md), [pageindex/flash/README.md](pageindex/flash/README.md).
Based on VectifyAI/PageIndex. Licensed under the MIT License — see LICENSE.
Content type
Image
Digest
sha256:fe7205bb1…
Size
3.4 GB
Last updated
15 days ago
docker pull mattbeen/pageindex-mcp:0.1.0