pageindex-mcp
Uses OpenAI API to generate document trees during indexing of PDF documents, enabling vectorless RAG.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pageindex-mcp Index the PDF ./report.pdf with id annual-report"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
pageindex-mcp
Self-hosted MCP server для Claude Code, реализующий PageIndex vectorless RAG полностью локально.
Архитектура
Claude Code (Max plan — handles all reasoning)
│ stdio
▼
pageindex-mcp (TypeScript)
├── index_document ──→ run_pageindex.py (Python, local)
│ └── OpenAI API (tree generation, one-time)
├── get_document_tree ──→ local JSON
├── get_page_content ──→ pdftotext (local)
├── list_documents ──→ local filesystem
└── delete_document ──→ local filesystemНикаких LLM-вызовов внутри сервера — Claude Code сам навигирует дерево и анализирует контент. Не нужен ANTHROPIC_API_KEY.
Related MCP server: pageindex-local-mcp
Предварительные требования
# 1. Node.js ≥ 18
node --version
# 2. Python PageIndex repo
git clone https://github.com/VectifyAI/PageIndex /opt/pageindex
cd /opt/pageindex && pip install -r requirements.txt
# 3. poppler-utils для извлечения текста из PDF
# Ubuntu/Debian:
sudo apt install poppler-utils
# macOS:
brew install popplerУстановка и сборка
npm install
npm run buildПеременные окружения
Переменная | Обязательна | Описание |
| да (для индексации) | PageIndex генерирует дерево через OpenAI |
| да | Путь к клонированному репозиторию PageIndex |
| нет | Где хранить JSON индексы (default: |
| нет | OpenAI модель (default: |
Для OpenRouter вместо прямого OpenAI:
OPENAI_BASE_URL=https://openrouter.ai/api/v1
OPENAI_API_KEY=sk-or-v1-...
PAGEINDEX_MODEL=openai/gpt-4oПодключение к Claude Code
Вариант A: локальный stdio (рекомендуется)
Добавить в ~/.claude.json или .mcp.json в проекте:
{
"mcpServers": {
"pageindex-local": {
"command": "node",
"args": ["/absolute/path/to/pageindex-mcp/build/index.js"],
"env": {
"OPENAI_API_KEY": "sk-...",
"PAGEINDEX_REPO_PATH": "/opt/pageindex"
}
}
}
}Вариант B: dev-режим (tsx, без сборки)
{
"mcpServers": {
"pageindex-local": {
"command": "npx",
"args": ["tsx", "/absolute/path/to/pageindex-mcp/src/index.ts"],
"env": {
"OPENAI_API_KEY": "sk-...",
"PAGEINDEX_REPO_PATH": "/opt/pageindex"
}
}
}
}Использование в Claude Code
# 1. Индексировать документ (один раз)
"Проиндексируй PDF /path/to/spec.pdf с id pam-spec"
# 2. Посмотреть структуру документа
"Покажи структуру документа pam-spec"
# 3. Извлечь контент конкретной секции
"Покажи содержимое ноды 0005 в документе pam-spec"
# 4. Список всех документов
"Какие документы проиндексированы?"
# 5. Удалить индекс
"Удали индекс pam-spec"Claude Code сам навигирует дерево, выбирает нужные секции и отвечает — не нужны отдельные API-вызовы.
Инструменты MCP
Инструмент | Описание |
| Генерирует PageIndex tree из PDF (один раз, затем переиспользуется) |
| Иерархическая структура документа для навигации |
| Извлечение текста по node_id или диапазону страниц |
| Список проиндексированных документов с метаданными |
| Удалить документ из индекса |
Стоимость
Индексация (разово): ~$0.10–0.50 за документ (OpenAI gpt-4o)
Поиск: бесплатно на Claude Code Max plan
Хранение: локальные JSON файлы
Ограничения
Генерация дерева требует OpenAI API (hardcoded в Python PageIndex)
Для больших PDF (500+ стр.) индексация может занять несколько минут
Без
poppler-utilsтекст страниц не извлекается (только метаданные дерева)
Available Tools
5 toolsdelete_documentDelete Indexed DocumentA
Removes a document from the local index store.
Inputs: doc_id (required).
get_document_treeGet Document TreeA
Returns the full hierarchical tree structure of an indexed document. Useful to understand document organization before searching.
Inputs: doc_id (required), max_depth.
get_page_contentGet Page ContentA
Extracts text content from specific pages or a tree node of an indexed document. Use get_document_tree first to find relevant node_ids, then call this to read the content. Claude Code handles all reasoning — this tool just returns raw text.
Inputs: doc_id (required), node_id, end_page, start_page.
index_documentIndex PDF DocumentA
Converts a local PDF into a PageIndex hierarchical tree structure. This is a one-time operation per document. Requires: PAGEINDEX_REPO_PATH env var pointing to cloned VectifyAI/PageIndex repo, and OPENAI_API_KEY for tree generation.
Inputs: doc_id (required), pdf_path (required), toc_check_pages, max_pages_per_node.
list_documentsList Indexed DocumentsA
Lists all documents in the local PageIndex store with metadata.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct action: indexing, reading content, listing documents, retrieving structure, and deleting. No overlap or confusion between tools.
All tool names follow a consistent verb_noun snake_case pattern: index_document, get_page_content, list_documents, get_document_tree, delete_document.
With 5 tools, the set is well-scoped for the domain of document indexing and retrieval. Every tool serves a clear, necessary function without redundancy.
The tools cover the full lifecycle of a document in the index: create (index), read (list, tree, content), and delete. No critical operations are missing given the stated purpose.
Maintenance
Related MCP Connectors
Hosted Web Crawler MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Hosted MCP server: convert PDFs to clean, LLM-ready Markdown with tables, formulas and OCR.
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA local-first MCP server that enables semantic search over PDF and DOCX documents using structure-aware parsing and vector storage. It allows users to query their local knowledge base through Claude Code without cloud dependencies or GPU requirements.1-
- FlicenseBqualityDmaintenanceA local-first MCP server for PageIndex — the vectorless, reasoning-based RAG framework. It lets local AI agents index and query local PDF and Markdown documents through a self-hosted PageIndex installation, without requiring any PageIndex cloud API key.83-
- AlicenseNot gradedqualityDmaintenanceLocal MCP server that indexes folders of documents into a hybrid vector + keyword search index for Claude Desktop, with support for PDFs, Office files, and images via OCR.MIT
- FlicenseNot gradedqualityBmaintenanceA self-hosted MCP server for PageIndex's vectorless, reasoning-based document retrieval. It ingests PDFs into a hierarchical table of contents using an LLM and serves documents, structure, and page content via MCP tools.-