DocSlicer Open-Source MCP: Parses Long Docs for Agents, Saving >90% Tokens
Important_Proof5480 · reddit · 2026-08-12
An open-source MCP tool called DocSlicer effectively helps AI agents process massive documents (like hundred-page PDFs), providing accurate citations while saving over 90% on token consumption.
- The Problem: Dumping long documents directly into context causes token explosions, while traditional grep keyword searches often fail due to vocabulary mismatches and cannot provide accurate page citations.
- Core Mechanics: DocSlicer features three primary actions:
- parse: Returns the document's heading outline, annotating the token cost for each section.
- read: Extracts the exact selected sections, keeping tables intact and attaching page numbers for reliable citations.
- search: A fallback for locating specific keywords when headings are non-descriptive.
- Benchmark Example: Against a 372-page, 518k-token HSBC annual report, an agent used just two tool calls (spending 7.2k tokens for the outline, then 259 tokens to read the target section) to accurately extract specific financial data with precise page citations.
More from coding & agent
- Sandbox as a New Serverless Primitive: AI Agents Change the Architecture — s4chinraja · 2026-08-12
- Term.Everything Runs Any GUI App in the Terminal, Hits 8.1k Stars — tom_doerr · 2026-08-12
- Comfy MCP Supports Local ComfyUI: Agents Take Over Video Workflows — Comfy-Org · 2026-08-12
- runner-modal: Self-Hosted GitHub Actions Runners with Native GPU on Modal — charles_irl · 2026-08-12
- AI Coding Tool Paper Launches Tabs for Parallel Multi-File Agents — evilrabbit_ · 2026-08-12
- Datadog CISO on Securing Coding Agents for 4,000 Engineers at Black Hat — a16z · 2026-08-12