# pageindex-mcp [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/VectifyAI/pageindex-mcp  
**GitHub Stars:** 412  
**npm Downloads (last month):** 628  
**Views:** 7  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/pageindex-mcp

## Description
Reasoning-based RAG system for chatting with long PDFs. Supports local and online files.

## Tools
Capabilities this server exposes over MCP:

- **process_document** — Upload and process PDF documents from URLs or local files. Supports OCR processing, hierarchical content extraction, and intelligent document analysis. Returns a unique doc_id for subsequent operations. Processing typically takes 0-3 minutes depending on document size (estimate: 2 seconds per page). Supports files up to 100MB.
- **browse_documents** — Primary document retrieval tool. After orienting with get_folder_structure() (when available), use this for all document-related questions. The bare call returns root-level sub-folders and documents; pass folder_id to drill into a sub-folder level by level. Use sort="relevance" + query for semantic ranking. Do NOT jump to search_documents() first — it is an escalation path, only after browse_documents(sort="relevance") has failed.
- **search_documents** — ESCALATION tool — never the first step. Use only after `browse_documents(sort="relevance", query=...)` missed a document you strongly believe exists by precise term, acronym, or file-name fragment. Query must be keywords only — see the `query` schema describe. Each result has a `score` (6-10, higher is more relevant). On result: single best match → read it; several equally good → ask user; none → fall back to `browse_documents(sort="relevance")`.
- **get_folder_structure** — Orientation step: show the folder hierarchy as a tree (like `tree -d`). **Call this before browse_documents()** to plan targeted retrieval — folder names reveal content domains (e.g. "Research", "Finance") and return folder IDs you pass to browse_documents(folder_id=…). Wait for this result before issuing browse_documents() or search_documents(). For folder_id="root" (default), returns the entire folder tree; for a specific folder_id, returns that subtree only.
- **get_document** — Check a document's processing status and metadata. `status` is one of "pending", "queued", "processing", "completed", or "failed" — call this before `get_document_structure()` or `get_page_content()` to confirm the document is ready.
- **get_document_structure** — Extract a document's hierarchical outline (headers, sections, page references). REQUIRED for documents over 20 pages — call this first to locate relevant sections, then pass their page numbers to `get_page_content()`. Use the `part` parameter to iterate large outlines until `pagination.has_more` is false.
- **get_page_content** — Extract page content from a processed document. Use tight, targeted page ranges — never the whole document at once. For documents over 20 pages, call `get_document_structure()` first to pick relevant sections. Embedded image paths in the response feed into `get_document_image()`.
- **get_document_image** — Retrieve an image from a document — pass an `image_path` from a `get_page_content()` response: either an embedded image (from a content block) or a full rendered page (from the `page_images` array, useful when a page is scanned or its meaning depends on visual layout). Returns the image as an MCP image content block (base64 data + MIME type). Do NOT repeat the raw base64 value in your text response.
- **remove_document** — Permanently delete documents and all associated data. Only invoke when the user explicitly names the documents AND confirms deletion. Returns `results` — one entry per requested document: `{ doc_name, status: "deleted" | "not_found" | "failed", error? }`. Inspect each entry for per-document failures. This action is irreversible.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "pageindex-mcp": {
    "command": "npx",
    "args": ["-y","@pageindex/mcp"]
  }
}
```

## Documentation

## What pageindex-mcp does

pageindex-mcp gives MCP clients tools for loading and investigating PDF documents through PageIndex. Documents are represented as hierarchical trees, allowing an agent to navigate folders, sections, and page references before reading relevant content. The approach is designed for reasoning-based retrieval rather than vector similarity, document chunking, or a fixed top-k result set.

It accepts PDF files from URLs and, when run locally, local PDF files. Processing includes OCR, hierarchical content extraction, and document analysis. A processed document receives a unique `doc_id`, which is used by later operations. Files can be up to 100 MB, and processing commonly takes between zero and three minutes, with an estimate of about two seconds per page.

## How it works

A reliable retrieval sequence starts with `get_folder_structure()` to map the available document hierarchy. The agent can then use `browse_documents()` at the root or within a folder, optionally sorting by relevance with a query. `search_documents()` is intended as a fallback when relevance-based browsing misses a document that should match a precise term, acronym, or filename fragment.

For an individual document, `get_document()` reports processing state and metadata. Once the document is ready, `get_document_structure()` exposes its outline, section headers, and page references. Documents longer than 20 pages should be handled through the outline first, with pagination used for large structures. The agent can then request narrow page ranges through `get_page_content()` instead of loading the entire file at once.

Page content may include paths for embedded images or rendered page images. Passing one of those paths to `get_document_image()` returns an MCP image content block, which is useful for scanned pages and layouts whose meaning depends on visual presentation.

## Setup and configuration

For hosted use, create an API key in the PageIndex dashboard and configure an HTTP MCP connection to `https://api.pageindex.ai/mcp` with an `Authorization: Bearer ...` header. The setup uses API-key authentication and does not require an OAuth flow.

PageIndex App users can connect through `https://app.pageindex.ai/mcp`; Claude Desktop also has a one-click option using the `.mcpb` package from the project’s releases. OAuth is handled for that App-based connection.

To upload local PDFs, run the local MCP package through `npx` with Node.js 18 or newer:

```json
{
  "mcpServers": {
    "pageindex": {
      "command": "npx",
      "args": ["-y", "@pageindex/mcp"]
    }
  }
}
```

The hosted endpoint can be used from agent frameworks and SDKs that support MCP, including the Claude Agent SDK, Vercel AI SDK, OpenAI Agents SDK, and LangChain MCP adapters.

## Tools and capabilities

- `process_document`: Upload and analyze a PDF from a URL or local path.
- `get_folder_structure`: Display the document hierarchy as a tree.
- `browse_documents`: Navigate folders or retrieve documents by relevance.
- `search_documents`: Perform keyword-based fallback searches with relevance scores.
- `get_document`: Check processing status and metadata.
- `get_document_structure`: Read section outlines and page references.
- `get_page_content`: Extract selected page ranges.
- `get_document_image`: Return embedded or rendered page images.
- `remove_document`: Permanently delete explicitly confirmed documents and their associated data.

Removal is irreversible, so clients should require explicit confirmation and inspect each returned per-document result.

_Full upstream README: https://allmcps.com/mcp/pageindex-mcp/readme_

