Skip to content
MCP server
Registry

Section Anything MCP Server

A PDF's real sections for agents: heading tree, pages and section text. Free mode is local.

Section Anything scores 67 (Good), licensed Apache-2.0 and written in Python. It installs as a local process. It does not declare tools yet. Filed under Knowledge. GitHub shows 3 stars. Package registries report about 43 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.

by omniwotApache-2.0Python3 stars
Trust score
67Good
Trust score 67 of 100, Good

Good trust

67 of 100 from six public signals. Nobody can buy a point.

  • Listed in the official MCP registry.
  • OSI-style license: apache-2.0.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 67 comes from

22 + 20 + 4 + 10 + 4 + 7 = 67. Each factor is capped, so no single signal can carry a listing.

Registry22 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 22 of 30 points.
Maintenance20 / 20

How recently the repository saw a commit or release.

Maintenance: 20 of 20 points.
Popularity4 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 4 of 20 points.
License10 / 10

A clear, OSI-style open-source license.

License: 10 of 10 points.
Security4 / 10

Not archived, a secure install path, a pinned version.

Security: 4 of 10 points.
Docs7 / 10

A real summary, a README with depth, listed tools.

Docs: 7 of 10 points.

Install

Pick your client, copy the config, paste it in.

Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "mcpServers": {    "omniwot-section-anything": {      "command": "uvx",      "args": [        "section-anything-mcp"      ],      "env": {        "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY",        "ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY"      }    }  }}

Environment variables

NameRequiredNotes
OPENAI_API_KEYSecretOptionalOnly for the paid quick and standard modes with OpenAI models
ANTHROPIC_API_KEYSecretOptionalOnly for the paid modes with a Claude model

Tools show up when the registry metadata or the repository README lists them. Public READMEs are read directly. A GitHub token is used only when one is already configured.

About

Section Anything

PyPI CI License: Apache-2.0 Open in Colab Open in Spaces

Find the real sections of a PDF: every heading, its level, the pages it spans and the exact text under it. Built for RAG pipelines and document tools that need structure, with a dial from free rules to an LLM that reads the whole document, and a hard cost cap on every paid run.

Python session: section_anything.section("paper.pdf", mode="quick") prints the paper's heading tree and the run's summary; then one section, 4.1 Architecture, as a chunk: its number, title, level, pages and character span, and its text, sliced from tree.text by that span

Real output of section-anything 0.1.11, Quick mode (gpt-6-luna), on Visual Instruction Tuning, Liu et al., arXiv:2304.08485, CC BY 4.0; the wait for the run is shortened (capture, script). Quick mode's output can vary slightly between runs. Try it on that paper in the Colab notebook (Free mode, no key needed), or in the browser on the Hugging Face Space (Free mode on any PDF, plus saved Quick check and Standard runs on three example papers; don't upload confidential documents).

Pre-release (0.1). The API may change before 1.0.

Website: https://omniwot.github.io/section-anything/ (how it works, benchmarks, examples)

import section_anything

tree = section_anything.section("paper.pdf")  # free mode, the default: rules only, no API key
print(tree.to_markdown())
# # A Study of Sectioning
# ## 1 Introduction
# ### 1.1 Scope
# ## 2 Methods
print(tree.summary())  # mode, model, pages, sections, calls, tokens, cost_usd, seconds

# quick mode: a small model checks the headings; needs an API key (OPENAI_API_KEY or SECTIONANY_API_KEY)
tree = section_anything.section("paper.pdf", mode="quick")

Use from an agent

An agent can take a PDF's outline first and then read only the sections it needs (0.1.6 or newer).

MCP server for Claude Code, Claude Desktop, Cursor and other MCP hosts, with four read-only tools: outline_pdf (the outline as text: one line per section with its index, heading and pages; free mode by default, no model, $0), section_pdf (the same heading tree as JSON, about five times the tokens), read_sections (the text of chosen sections) and estimate_cost (what quick and standard would cost). An agent reads the outline first and then fetches the sections it needs by index.

claude mcp add --transport stdio section-anything -- uvx --from "section-anything[mcp]" section-anything-mcp

Other hosts take the same command in their mcpServers JSON:

{"mcpServers": {"section-anything": {"command": "uvx",
  "args": ["--from", "section-anything[mcp]", "section-anything-mcp", "--max-usd", "0"]}}}

Paid modes use the API keys in the server's environment (claude mcp add --env OPENAI_API_KEY=...) and are capped per document by --max-usd (default 0.50; 0 keeps every run free). --root DIR limits the folders the server may read.

Agent skill: copy skills/section-anything into your agent's skills folder (Claude Code: ~/.claude/skills/) and the agent uses the command line the same way: outline, then the sections it needs.

Shell: section-anything paper.pdf --format json --body prints every section with its heading_path, parent, pages and text.

Notebooks

All run in Free mode, with no API key.

  • notebooks/quickstart.ipynb: install, section one paper, read one section (optional Quick mode with your own key).
  • notebooks/heading-levels.ipynb: heading trees from Section Anything, Docling (default and with its heading hierarchy on) and pymupdf4llm on three papers, side by side.
  • notebooks/markdown-chunks.ipynb: tree.to_markdown(body=True) and pymupdf4llm Markdown through the same LangChain MarkdownHeaderTextSplitter and LlamaIndex MarkdownNodeParser; chunks with a heading path, chunks starting mid-sentence.

Why

PDF converters mostly infer headings from how a line looks, so paper titles, author names, captions and theorem statements can come out as sections, and real subsections can get the wrong level. Anything that chunks or navigates by headings inherits those mistakes. Section Anything combines the PDF's own outline (bookmarks) and printed table of contents, typography and numbering rules, and optionally a model that reviews or reads the text.

Results

Heading-tree similarity (TEDS, 0–100, higher is better) on READoc with READoc's own scoring code. Docling and MinerU convert whole documents (layout, tables, figures, formulas, OCR); these numbers compare only the heading tree. Papers not used while developing the method, run end to end from the PDFs with release 0.1.11 on 13 November 2026 (one run; quick and standard vary slightly between runs):

READoc arXiv papers (held out)DocsTEDS
Section Anything quick (gpt-6-luna)90569.9
Section Anything standard (gpt-6-luna)90568.0
Section Anything free (no model)90561.7
Docling 2.140 (heading hierarchy on; measured October 2026)90549.4

On these papers quick is 1.9 points ahead of standard (95% CI +1.2 to +2.6), and standard is 1.9 lower than its October run (95% CI −2.5 to −1.3). The cause is how 0.1.11 reads section titles from the printed line (paragraph text left in run-in titles, wrapped titles cut, ligatures, number dots). 0.1.12 fixes the first three: re-scored at no cost on the saved outputs, standard gains 0.83 on these papers (95% CI +0.64 to +1.03). The scores above are 0.1.11's.

Before 0.1.11 this table read standard 70.0 (October), quick 68.0 (release 0.1.2) and free 60.0 (release 0.1.5), on text extracted by earlier releases. 0.1.1 found the abstract's heading (journals often set it small, bold or run into the first line): +2.4 to free and +3.7 to quick in a pre-registered held-out test (0.1.0: 54.8 and 63.9). 0.1.2 keeps a section number that the PDF extractor split off its title ("1" | "Introduction"): +0.7 to free (95% CI +0.5 to +1.0) and +0.5 to quick (95% CI +0.4 to +0.8; +1.7 on the 291 papers it changes) in a second pre-registered test (0.1.1: 57.2 and 67.4). 0.1.5 gives back matter (References, Acknowledgements, Appendix) and appendix sections the level of the numbered sections: +2.1 to free (95% CI +1.7 to +2.4; 136 papers better, 4 worse) in a fourth pre-registered test on these papers (0.1.4: 57.9); READMEs unchanged. standard uses none of these. See the changelog.

On the same 905 papers with MinerU's cloud (3.4.4, VLM; measured October 2026): our quick 69.9, our standard 68.0, MinerU + its own LLM title levels (gpt-6.1-sol) 64.8 (paired difference: quick +5.1, 95% CI +4.1 to +6.1, or +3.0, 95% CI +1.9 to +4.0, without the 154 papers where that step, run by us on gpt-6.1-sol, returned no parsable levels and kept MinerU's raw levels; standard +3.2, 95% CI +2.2 to +4.2, but about level without those papers: +1.0, 95% CI +0.0 to +1.9), MinerU alone 53.9, Docling 49.4.

On GitHub READMEs, free scores higher than Docling: on the 1,124 READoc READMEs not used in development, 81.4 against 75.2 (+6.2, 95% CI +5.2 to +7.1; release 0.1.11, Docling 2.140 from October). In October, on the 1,112 of them that had bookmarks, free scored 81.9 against 75.5, and Docling reached 79.7 with the opt-in outline check we proposed upstream (docling#5002), the same idea as free's outline check. On 27 UK government reports never used in development (answer keys from each report's HTML version), the outline check improved free by +5.7 (95% CI +0.4 to +12.2; 43.1 → 48.8; measured on 0.1.0).

Where others win: on the 1,124 held-out READoc READMEs our quick and standard are only about level with Docling (76.3 against 75.2; +1.1, 95% CI −0.0 to +2.2), five points below our own free there. On the 905 held-out papers Docling scored higher than quick on 79 papers and lower on 774 (by more than 0.5 points). On the 161 of those papers whose PDFs have no bookmarks, free is weaker than Docling: 48.7 against 51.1 (heading-tree TEDS; release 0.1.11, Docling 2.140 from October; quick 68.2, standard 64.4). Nougat, an OCR model trained on arXiv, has the highest published READoc arXiv score (88.5 in the READoc paper, older tool versions; we have not run it). Docling and MinerU also read scanned pages with OCR; Section Anything needs a text layer. Better headings improved RAG retrieval in our Qasper test but not answer quality.

Three smaller benchmarks come with their scripts and saved results, with Section Anything in Free mode at no cost (benchmarks/): on 20 public long documents, an outline plus one section is a median 18.4x fewer tokens than the full text (token counts only, no accuracy test); on 40 documents in four families, Free's section tree scores section F1 0.792 against 0.686 for PageIndex Flash's model-free tree (not a held-out test for Section Anything: its rules were developed on these families); and given the sections that RFC errata name (plain section numbers such as "4.1", not written instructions), the section lookup in 0.1.15 returns the named section with its printed number and title for all 440 held-out targets whose section is in the tree, in 400 older RFCs rendered from their text (pre-registered; 95% CI 99.1 to 100), against 434 for Claude Haiku 5.5 choosing from the full section list; the tree holds 96.5% of the 456 checked targets (0.1.14: 72.6%), so 96.5% end to end (0.1.14: 71.9%). On the benchmark's own 1,999 errata targets, which 0.1.15 was developed on, it scores 99.7% in the publisher's PDFs (335 targets) and 97.9% end to end in the rendered RFCs (1,396), against 98.8% and 81.9% for the pre-registered 0.1.14 run.

Settings and cost

ModeWhat runsSent to a modelCost per 1,000 pages
free (default)bookmarks or the printed contents as the outline, then typography and numbering rules; headings a complete-looking outline does not list are droppednothing$0
quickrules propose candidate heading lines; a small model keeps the real ones and sets levelscandidate lines onlyabout $0.07 (gpt-6-luna)
standarda model reads every line, with font hints, and marks where sections start and endthe document textabout $0.12 (gpt-6-luna, the default; measured on 0.1.11); $2.90 with gpt-6.1-sol (measured in October)
local:<model>quick, answered by a local Ollama modelnothing leaves the machine$0
autofree, then quick only for documents where Free is unsure of its headingsnothing, or what quick sends$0 for documents Free is sure of; quick's cost for the rest

Every paid run is estimated first and capped (default $0.50 per document); over the cap it downgrades (standard → quick → free) or fails, as you choose.

Four input limits protect against oversized files, checked in this order:

LimitDefaultCommand linePythonEnvironment
file size, before anything is parsed100 MB--max-mbmax_mb=SECTIONANY_MAX_MB
pages500--max-pagesmax_pages=SECTIONANY_MAX_PAGES
characters of text5,000,000--max-charsmax_chars=SECTIONANY_MAX_CHARS
extraction time120 s--timeoutextract_timeout=SECTIONANY_EXTRACT_TIMEOUT_SECONDS

A refusal says how to raise the limit it hit and names the ones checked after it; a PDF of several thousand pages usually needs all four raised. All settings: Configuration.

For many long documents of one type, standard can take optional collection tuning: a short guidance text on what that type's sections look like, which the library can write from a few sample PDFs (write_guidance, or section-anything guidance samples/*.pdf -o sheet.md) and which is appended to the model's instructions (Settings(heading_guidance=...)). Off by default; quick ignores it, since sheets made it drop real sections in tests. In pre-registered tests, sheets a model wrote from a few sample documents raised Claude Haiku 5.5's section F1 by 0.081 (95% CI +0.037 to +0.127, 39 documents of four types) and gpt-6-luna's by 0.028 (CI +0.006 to +0.053, 40 documents); a sheet written from unrepresentative samples can lower it. See the package README.

The default model for quick and standard is gpt-6-luna, the model behind their READoc scores above. standard can run on gpt-6.1-sol instead (SECTIONANY_STANDARD_MODEL=gpt-6.1-sol or model="gpt-6.1-sol") at about 18 times the cost when both were measured in October. On development documents only (98 READoc papers and 100 READMEs, same code) it scored 5.8 points higher on READMEs (95% CI +2.1 to +9.6) and 0.9 higher on papers (CI -0.3 to +2.1, not significant); this is not confirmed on held-out documents.

Install

Python 3.11 or newer:

pip install section-anything
pip install "section-anything[anthropic]" # optional: Claude models on Anthropic's own API
pip install "section-anything[docling]"   # optional: tree.to_docling_document()
pip install "section-anything[langfuse]"  # optional Langfuse tracing
pip install "section-anything[mcp]"       # optional MCP server: section-anything-mcp
# latest from GitHub:
pip install "git+https://github.com/Omniwot/section-anything#subdirectory=packages/section-anything"

Command line:

section-anything paper.pdf                                # free, Markdown headings
section-anything paper.pdf --mode quick --format json     # JSON with spans and cost
section-anything paper.pdf --mode standard --max-usd 0.5  # cap this document at $0.50

API keys come from the environment only (SECTIONANY_API_KEY, or OPENAI_API_KEY for OpenAI's endpoint); any OpenAI-compatible endpoint works. Claude models run on Anthropic's own API with the anthropic extra and ANTHROPIC_API_KEY; on development documents Claude Haiku 5.5 tied the default at about 3 times the cost (Providers). Full options, output format and the security model for untrusted PDFs: packages/section-anything/README.md.

Integrations

One document per section, with the heading path, pages and character span as metadata. Each package depends only on section-anything and the framework's core package.

pip install langchain-section-anything
pip install llama-index-readers-section-anything
pip install section-anything-haystack
pip install lightrag-section-anything
FrameworkPackageUse
LangChainlangchain-section-anythingSectionAnythingLoader("paper.pdf", mode="free").load()
LlamaIndexllama-index-readers-section-anythingSectionAnythingReader(mode="free").load_data("paper.pdf"), or as the .pdf reader of SimpleDirectoryReader
Haystacksection-anything-haystackSectionAnythingConverter(mode="free").run(sources=["paper.pdf"]), or as the converter of an indexing pipeline
LightRAGlightrag-section-anythingparser engines (sectionany_free, sectionany_quick, ...) for LightRAG's heading-based chunker, without a MinerU or Docling service

Section records for RAG need no loader: every section already carries its title, heading path, level, page span, the heading's position on the page (heading_bbox, PDF points) and, with to_dict(text=True), its text (examples/section_records.py, with its output on RFC 8747):

from section_anything import section

for sec in section("rfc8747.pdf").to_dict(text=True)["sections"]:
    print({k: sec[k] for k in ("title", "heading_path", "level", "page_start", "page_end", "heading_bbox", "text")})
# {'title': 'Abstract', 'heading_path': ['Proof-of-Possession Key Semantics ...', 'Abstract'], 'level': 2,
#  'page_start': 1, 'page_end': 1, 'heading_bbox': {'page': 1, 'x0': 65.91, 'y0': 545.84, 'x1': 128.24, 'y1': 560.24},
#  'text': 'Abstract\nThis specification describes how to declare in a CBOR Web Token ...'}

Chunks with a size cap come from the tree itself: tree.chunks() splits a long section on paragraph breaks (then sentence ends, then cuts) up to max_chars, merges short sibling sections up to min_chars, keeps a heading with no body as a chunk of its own, and gives every chunk its heading path and pages. With lead_in=True (off by default), a chunk that starts inside a list also carries the line that introduces the list (lead_in, for example "Apply the following changes to Method 2:", shown above the text in prefixed_text) (examples/section_chunks.py):

from section_anything import section

for chunk in section("report.pdf").chunks(max_chars=1500, min_chars=200):
    print(chunk.heading_path, chunk.page_start, chunk.page_end, len(chunk.text))
    chunk.prefixed_text  # "3 Safety > 3.2 Storage\n\n..." for embedding
# ['3 Safety', '3.2 Storage'] 12 13 1472

length= takes a token counter (tiktoken's lambda s: len(enc.encode(s))) to cap by tokens, and the LangChain loader, LlamaIndex reader and Haystack converter take chunk=True or chunk={"max_chars": 1500} to return chunks with heading_path and chunk_index in their metadata.

Cross-references in the text ("see Section 4.2", "Sections 3 to 5", "Appendix B") come from tree.references(): each phrase is linked to the section it names, with a status (resolved, ambiguous, unresolved or external for another document) and never a guess; rules only, no model (how). On xref-bench's 130 test documents (116 RFCs, 14 GNU manuals; 8,242 references; link-stripped PDFs; one pre-registered run, release 0.1.12), end-to-end F1 0.905 against 0.709 for a regex baseline (the benchmark and the resolver come from the same project).

To run Docling's HybridChunker or Unstructured's chunk_by_title on these headings, export the tree with tree.to_docling_document() or tree.to_unstructured_elements() (how). If you already run Docling, section("report.pdf", docling=doc) takes its layout labels as hints, and section(doc) sections a scanned PDF from Docling's text (how).

Limitations

  • Reads the PDF's text layer; scanned PDFs need OCR first, or Docling's output of them (Use with Docling, opt-in).
  • Tables, figures and equations are not structured; their text stays in the section text.
  • free is best when the PDF has bookmarks or a printed table of contents. When the bookmarks look complete, it drops headings they do not list; if the bookmarks stop at the top levels, real deeper headings are lost (about 6% of READMEs lose more than 5 points). Turn this off with SECTIONANY_DEMOTE_UNLISTED_HEADINGS='[]'.
  • quick and standard send text to the provider you configure.

Repository

PathWhat it is
packages/section-anything/the library and CLI (Apache-2.0)
packages/langchain-section-anything/LangChain document loader
packages/llama-index-readers-section-anything/LlamaIndex reader
packages/section-anything-haystack/Haystack converter
packages/lightrag-section-anything/LightRAG parser plugin
backend/, frontend/a demo web app: upload a PDF, see the sections highlighted (docs/app.md)
site/project website and benchmark tables (site/data/results.js)
corpus/our test corpus: answer keys, results and the tools that rebuild it (no PDFs stored)
benchmarks/benchmarks you can rerun at no cost, with their scripts and saved results (no PDFs stored, except eight small generated ones)
docs/write-ups: RAG on Qasper, the Docling contribution, plans and a paper draft

Data and credits

  • Benchmarks use READoc (dataset MIT, Hugging Face) with READoc's own scoring code, which is not included here.
  • Unseen-document checks use public long documents of several kinds, from the HiPS dataset (its annotations are CC BY-NC 4.0), UK government reports (Open Government Licence v3) and Canada's Justice Laws website.
  • Every corpus source and its licence: corpus/DATA-LICENSES.md.
  • To cite this project, see CITATION.cff.

Licence

Code: Apache-2.0 (LICENSE, NOTICE). The data under corpus/ keeps its sources' licences: see corpus/DATA-LICENSES.md.

Frequently asked questions

What is Section Anything MCP Server?

A PDF's real sections for agents: heading tree, pages and section text. Free mode is local.

How do I install Section Anything MCP Server in Claude Desktop, Cursor, or VS Code?

Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. Section Anything MCP Server runs locally from the PyPI package section-anything-mcp with the command uvx section-anything-mcp.

Is Section Anything MCP Server free and open source?

Yes. Section Anything MCP Server is released under the Apache-2.0 license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.

Does Section Anything MCP Server support remote (HTTP) connections?

No remote endpoint is listed for Section Anything MCP Server. It runs locally on your machine over stdio, started by your MCP client.

How is Section Anything MCP Server's trust score calculated?

Section Anything MCP Server scores 67 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.

Reviews

No reviews yet

—Be the first to review

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server