MCP Server
DocSlicer ships a Model Context Protocol server, so LLM clients — Claude Desktop, Claude Code, Cursor, VS Code — can parse and read documents directly.
The point is what it doesn't do: it never drops a whole document into the model's context. A parsed 200-page filing is far larger than any context window, so the server hands back a heading outline first and lets the model pull in only the sections it actually needs. Vectorless RAG — no embeddings, no index, no chunk store.
pip install 'docslicer[mcp]'
docslicer-mcp # stdio — what desktop clients launch
docslicer-mcp --transport http --port 8000 # networked serverThe mcp extra pulls in the mcp SDK (2.0+) and tiktoken. Token counts drive every sizing decision the model makes, so the extra installs exact counting rather than the chars / 4 estimate.
Install
Claude Desktop — one click
Download docslicer-X.Y.Z.mcpb from the latest release and double-click it, or drag it onto the Claude Desktop window.
You pick the folder DocSlicer is allowed to read and write during install. No config file, and no Python of your own — uv provisions the interpreter.
Claude Code
claude mcp add docslicer -- uvx --from 'docslicer[mcp]' docslicer-mcpEverything else
Every client below launches the server over stdio. Using uvx means nothing has to be installed ahead of time:
{
"mcpServers": {
"docslicer": {
"command": "uvx",
"args": ["--from", "docslicer[mcp]", "docslicer-mcp"],
"env": { "DOCSLICER_MCP_ROOT": "/Users/you/Documents" }
}
}
}| Client | Where the config goes |
|---|---|
| Cursor | ~/.cursor/mcp.json, or .cursor/mcp.json per project |
| VS Code | .vscode/mcp.json — use a servers key instead of mcpServers |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
| Zed | settings.json, under context_servers |
To skip the dependency resolve on every launch, install it once with pip install 'docslicer[mcp]' (or uv tool install) and set "command": "docslicer-mcp" with no args.
On GUI-launched clients, prefer the .mcpb. An app started from the dock does not inherit your shell PATH — on macOS that excludes /opt/homebrew/bin — so a bare uvx or docslicer-mcp can work in a terminal and fail when the client spawns it. Use an absolute path (which uvx) if you hit this. The extension sidesteps the problem entirely.
How it works
parse registers a document and returns a doc_id handle plus the heading outline. Every other tool takes that handle and returns a bounded slice.
| Tool | Returns |
|---|---|
parse | doc_id handle, title, page count, heading outline |
get_outline | The outline again, for when it scrolls out of context |
read | The text under one or more headings, named from the outline |
search | Headings to read, ranked, each with a snippet |
to_markdown | Writes the whole document to disk; returns the path |
The outline is a budget
Every outline line carries what reading it would cost:
- Financial statements ~48k
- Note 14 — Segment reporting ~900
- Note 15 — Income taxes ~2.1k
That figure is the same estimate read reports back, so a budget made from the outline holds when it is spent. Sizes are cumulative — a parent never costs less than the children beneath it — which turns "descend or just read it" into a decision the model makes before spending context rather than after.
Short documents skip the round trip
An outline earns its extra round trip by letting most of a document go unread. On a two-page memo there is nothing to leave out, and the outline plus a read call costs more than the memo did. So under a token threshold (default 6000, see DOCSLICER_MCP_FULL_TEXT) parse returns the whole text with is_complete: true — the model answers from it directly, and read or search would only return what it already holds.
Citations land on the right page
Text returned by read is interleaved with [Page X] markers using the document's own page labels (S-23, iv), not a zero-based index. A section running over eight pages gets a marker at each boundary, so a quotation cites the page it actually came from rather than wherever its section began.
Caching
Parsed results are persisted to disk, so re-parsing the same file with the same options is free. The cache key includes the file's size and mtime — edit the document and the next parse re-parses it automatically. Pass refresh: true to force it.
Next steps
- Tools — full parameter and response reference for all five tools
- Configuration — transports, sandboxing, cache limits