Section Anything

io.github.Omniwot由 GitHub 账号 Omniwot 发布v0.1.0更新于 Nov 3, 2026

面向智能体的PDF真实章节:标题树、页面和章节文本。免费模式为本地运行。

AI 翻译由 AI 模型根据下方的原文描述翻译,可能有误。

原文描述

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

发布方自己的服务:Section Store

已验证STDIO仅桌面文件与存储

概览

Section Anything 的本地 MCP 服务;无需登录;STDIO。

暂无 AI 概览:以下信息来自注册中心条目和服务本身。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Section Anything,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

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.3, 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)

python
import section_anything
tree = section_anything.section("paper.pdf", mode="quick")print(tree.to_markdown())# # A Study of Sectioning# ## 1 Introduction# ### 1.1 Scope# ## 2 Methodsprint(tree.summary())  # mode, model, pages, sections, calls, tokens, cost_usd, seconds

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 three read-only tools: section_pdf (the heading tree; free mode by default, no model, $0), read_sections (the text of chosen sections) and estimate_cost (what quick and standard would cost).

sh
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:

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.

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, October 2026. 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:

READoc arXiv papers (held out)DocsTEDS
Section Anything standard (gpt-6-luna)90570.0
Section Anything quick (gpt-6-luna)90568.0
Section Anything free (no model)90560.0
Docling 2.140 (heading hierarchy on)90549.4

quick is release 0.1.2 and free release 0.1.5. 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): our standard 70.0, our quick 68.0, MinerU + its own LLM title levels (gpt-6.1-sol) 64.8 (paired difference: standard +5.1, 95% CI +4.0 to +6.2, or +2.8 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; quick +3.1, 95% CI +2.1 to +4.1, but level without those papers: +1.0, 95% CI −0.03 to +2.0), MinerU alone 53.9, Docling 49.4.

On GitHub READMEs, free scores higher than Docling: on 1,112 bookmarked READoc READMEs not used in development, 81.9 against 75.5, and Docling reaches 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 only tie with Docling (about 75). On the 905 held-out papers Docling scored higher than standard on 103 papers and lower on 773 (by more than 0.5 points). 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.

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.16 (gpt-6-luna, the default); $2.90 with gpt-6.1-sol
local:<model>quick, answered by a local Ollama modelnothing leaves the machine$0

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.

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. 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:

sh
pip install section-anythingpip install "section-anything[anthropic]" # optional: Claude models on Anthropic's own APIpip install "section-anything[docling]"   # optional: tree.to_docling_document()pip install "section-anything[langfuse]"  # optional Langfuse tracingpip 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:

sh
section-anything paper.pdf                                # free, Markdown headingssection-anything paper.pdf --mode quick --format json     # JSON with spans and costsection-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.

sh
pip install langchain-section-anythingpip install llama-index-readers-section-anythingpip 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
LightRAGlightrag-section-anythingparser engines (sectionany_free, sectionany_quick, ...) for LightRAG's heading-based chunker, without a MinerU or Docling service

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).

Limitations

  • Reads the PDF's text layer; scanned PDFs need OCR first.
  • 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/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)
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 HiPS law-book annotations (CC BY-NC 4.0), UK government reports (Open Government Licence v3) and Canadian federal acts (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.

来源:README.md,提交 ffce57b

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Nov 3, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Section 集成