Docs / For agents / MCP setup
MCP setup
Register once and agents like Claude Code can read documents straight off your machine. No more pasting a whole PDF into the conversation: the agent asks for the outline, pulls the section it wants, or searches across everything. The documents never leave the machine.
Register#
$ claude mcp add aimorsel -- morsel mcp
Or put it in the project's .mcp.json:
{
"mcpServers": {
"aimorsel": { "command": "morsel", "args": ["mcp"] }
}
}
Restart the session once and it's live.
Eight tools#
The first three exist to keep the context window small — that's the difference from a plain document-conversion server.
| Tool | What it does |
|---|---|
| get_outline | Returns just the heading tree, with each section's page range and token estimate. The first move on a long document — a few hundred tokens buys you the whole structure |
| get_section | Pulls one section (including its subsections) by heading, matched loosely. Too many matches and it lists candidates so the agent can narrow down |
| search_documents | Full-text search across converted documents; hits carry page number and heading path, ranked by relevance. Space-separated terms are ANDed |
| read_pdf_markdown | Returns the Markdown body directly — fine for short documents. Long results are truncated with the full file path attached |
| extract_tables | Returns every table in the document as CSV text, with page numbers |
| get_chunks | RAG chunks as JSONL, each with page range, heading path and a token estimate |
| qa_check | Per-page element and character counts, flagging blank, scanned-looking and thin pages |
| convert_pdf | Converts and returns the list of output files; anything already converted and unchanged is skipped |
The context-saving pattern#
For a long document the agent should work like this — after three steps, only the section that actually matters has entered the context:
# 1. structure first, a few hundred tokens get_outline("annual-report.pdf") # 2. pull one section get_section("annual-report.pdf", "Financial summary") # 3. or search everything already converted; hits carry page numbers search_documents("gross margin")
The token count get_outline reports for a section includes its
subsections, matching what get_section will actually return — so the
agent's budgeting is accurate.
A few notes#
- The cache is shared. Output goes to
output/and uses the same resume record as the command line and the desktop app, so reading the same file again is near-instant. - Search doesn't convert by default.
search_documentslooks only at documents already inoutput/; pass it a path and it will convert. - Long results are truncated and come with the full file path, so the agent can read the file itself if it needs the rest.
- Scans need OCR installed first, or MCP gets an empty document too. See the download page.