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.

ToolWhat it does
get_outlineReturns 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_sectionPulls one section (including its subsections) by heading, matched loosely. Too many matches and it lists candidates so the agent can narrow down
search_documentsFull-text search across converted documents; hits carry page number and heading path, ranked by relevance. Space-separated terms are ANDed
read_pdf_markdownReturns the Markdown body directly — fine for short documents. Long results are truncated with the full file path attached
extract_tablesReturns every table in the document as CSV text, with page numbers
get_chunksRAG chunks as JSONL, each with page range, heading path and a token estimate
qa_checkPer-page element and character counts, flagging blank, scanned-looking and thin pages
convert_pdfConverts 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#