neoforge-docs
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@neoforge-docshow do I register a custom item in NeoForge?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-neoforge-docs
本地离线的 NeoForge 文档 MCP 服务器。把仓库里的 neoforge-docs/
建成一个 SQLite FTS5 索引,通过 stdio 暴露 6 个检索工具给任意 MCP 客户端。
依赖:
Python 3.12
mcp
pyyaml
Related MCP server: MCP Server Builder
快速开始
# 1) 安装(可编辑模式)
uv pip install --python .venv\Scripts\python.exe -e .
# 2) 建索引(首次或文档更新后)
.\.venv\Scripts\neoforge-docs-index.exe
# 3) 命令行试查
.\.venv\Scripts\neoforge-docs-search.exe "custom armor" --limit 3
# 4) 启动 MCP(stdio,客户端会自动拉起)
.\.venv\Scripts\neoforge-docs-mcp.exe服务器启动时会自动检查语料指纹(文件数、大小、mtime),过期就重建,无需手动干预。
接入客户端
解释器路径和仓库路径都跟本机绑定,用生成器按当前解释器 sys.executable 和仓库位置实时产出:
# 打印配置(mcpServers 格式,多数 stdio 客户端通用)
.\.venv\Scripts\python.exe -m neoforge_docs_mcp.setup_config
# 写入客户端要求的配置文件
.\.venv\Scripts\python.exe -m neoforge_docs_mcp.setup_config --output <config.json> --force
# VS Code 风格(servers + type: stdio)
.\.venv\Scripts\python.exe -m neoforge_docs_mcp.setup_config --client vscode生成结果(<repo> 为当前仓库绝对路径):
{
"mcpServers": {
"neoforge-docs": {
"command": "<repo>\\.venv\\Scripts\\python.exe",
"args": ["-m", "neoforge_docs_mcp"],
"env": { "NEOFORGE_DOCS_ROOT": "<repo>\\neoforge-docs" }
}
}
}把这段 JSON 放进客户端自己的 MCP 配置(Cursor 的 ~/.cursor/mcp.json、
VS Code 的 .vscode/mcp.json),或按客户端字段填 command / args / env。
NEOFORGE_DOCS_ROOT / NEOFORGE_DOCS_DB 可覆盖文档目录与索引位置。
DSH
integrations/dsh/ 是一个 DSH profile bundle,通过 @deepseek-ai/dsh-mcp-client
以 stdio 拉起本服务器,工具名形如 mcp__neoforge-docs__search_docs。
cordis.patch.yml 里写的是本机解释器与仓库的绝对路径,仓库搬家后要同步修改,
再重新安装:
# 在 DSH 里重新安装该 bundle(target 为绝对目录;已装过会原地覆盖)
# plugin_manager install_bundle "C:\Users\dynas\Documents\Code\mcp-neoforge-docs\integrations\dsh"安装后 DSH 的插件/连接列表里会多出「NeoForge 文档 MCP」一项。
工具
工具 | 作用 |
| 主入口:BM25 检索,返回 chunk 级片段、版本、URL; |
| 取单节全文(anchor / 标题 / 标题片段均可定位),省 token 主力 |
| 取整页 markdown + 标题大纲(15k 字符级别的页慎用) |
| API 名精确/子串查找,如 |
| 列出版本内全部页面(标题、分组、URL) |
| 同一页面跨版本 diff,做迁移/版本差异问题 |
中文提问可直接传入(内置常用术语映射,如 注册→register、数据组件→data component), 但英文关键词检索质量更高,server instructions 里也这样提示模型。
结构
src/neoforge_docs_mcp/
config.py 路径、版本标签、各文档分区(docs/toolchain/user/modpack)的路由前缀
parse.py 去 frontmatter、展开引用式链接、剥离 JSX、抽 H1 标题
chunk.py 按 H2/H3 切块,代码块与表格不切分,单块上限 ~1100 token
index.py 建 SQLite:docs / chunks / chunks_fts / symbols / links / meta
search.py BM25 + 标题加权 + 版本去重 + 符号查询 + 跨版本 diff
server.py MCPServer(6 个 tool)
data/ 索引产物(已 gitignore)索引失败回退:mode=api 与普通检索都走 FTS5;如果目标机器的 sqlite3 没编进 FTS5,
建索引时会直接报 no such module: fts5,此时改用官方 CPython 或安装带 FTS5 的 sqlite。
更新文档
git submodule update --remote neoforge-docs # 拉取最新文档
.\.venv\Scripts\neoforge-docs-index.exe # 重建索引测试
.\.venv\Scripts\python.exe tests\check_search.py # 检索质量回归
.\.venv\Scripts\python.exe tests\test_server_inprocess.py # 工具注册 + 参数 schema + 调用
.\.venv\Scripts\python.exe tests\probe_stdio.py # 真实 stdio 管道 JSON-RPCtests/test_mcp_e2e.py 用 MCP 官方 client 跑完整握手。
Available Tools
6 toolscompare_versionsA
Diff one documentation page between two versions (migration helper).
Args: doc: page path or doc_id, e.g. "items/index.md". from_version: older version key, e.g. "1.21.1". to_version: newer version key, e.g. "current".
| Name | Required | Description | Default |
|---|---|---|---|
| doc | Yes | ||
| to_version | No | current | |
| from_version | No | 1.21.1 |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden, and it never states that this is a read-only, side-effect-free operation, nor what happens when the page is absent in one of the versions. It does disclose a meaningful behavioral trait beyond the schema: from_version is the older key and to_version the newer one, which prevents reversed-diff mistakes. That partial disclosure earns a 3 rather than a 2.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence states purpose before the arg list, and the Args block is tight with no redundant prose. The pseudo-Python formatting is slightly verbose for three parameters but every line adds information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With only three parameters, one required, and an output schema already covering the return shape, the description supplies exactly what is missing: purpose, parameter meanings, and examples. It omits edge-case behavior (unknown doc path, version not containing the page), which is a minor but real gap for a diff tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, and it does: 'doc' is explained as a page path OR doc_id with a concrete example ('items/index.md'), and both version params are defined semantically as older/newer with example keys. It stops short of explaining what the 'current' default means or how version keys are discovered, so not quite a 5.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The first line gives a specific verb ('Diff'), a bounded resource ('one documentation page'), and the scope constraint ('between two versions'), plus a usage tag ('migration helper'). No sibling is named, but the version-comparison scope is inherently distinct from list_docs/get_doc/search_docs, so an agent can identify it without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'(migration helper)' implies the context of use, and the from/to framing tells the agent this is for comparing an older against a newer version. However, there is no explicit when-to-use statement, no when-not-to-use, and no pointer to a sibling for the case where the agent instead wants a single version's content (get_doc) or a full-text search.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
find_symbolA
Find where a Java/NeoForge API name is used or explained.
Exact match first, then substring. Good for "Item.Properties#of", "DeferredRegister", "DataComponents", "BlockEntity#saveAdditional".
Args: symbol: the API identifier to look up. limit: max hits (1-20, default 10).
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| symbol | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations present, the description carries the burden and does disclose real behavior: matching order (exact match first, then substring) and the limit constraint (1-20, default 10). It omits any auth/permission notes, but for a read-only lookup that is a minor gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded purpose, then a behavioral rule, then example inputs, then a compact Args block. Every line carries information and nothing is repeated from the schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Both parameters are documented, the matching strategy is explained, and an output schema exists so return values need no elaboration. The only minor omission is behavior on zero matches or result ranking beyond substring, which is not critical for invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, and it does: `symbol` is defined as the API identifier to look up, and `limit` gains meaning plus bounds (1-20, default 10) that the schema's bare integer does not provide. The symbol definition is slightly thin, so not a full 5.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource: finding usages/explanations of a Java/NeoForge API name, with concrete examples like "DeferredRegister" and "BlockEntity#saveAdditional". It does not explicitly distinguish itself from the sibling search_docs, leaving the agent to infer the difference, so a 4 rather than a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The "Good for ..." examples imply the appropriate query style, and "Exact match first, then substring" hints at when this tool is a fit. However, it never states when to prefer find_symbol over search_docs or when not to use it, so guidance is implied rather than explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_docA
Return a whole documentation page as markdown, plus its heading outline.
Prefer get_section unless the whole page is genuinely needed: pages reach 15k+ chars.
Args: doc_id: doc_id from search_docs, or a path such as "items/index.md" / "items". version: version key ("current", "1.21.1", ...) when doc_id is a path.
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ||
| version | No | current |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the behavioral burden, and it does disclose the return shape (markdown plus heading outline) and a size characteristic (15k+ chars). It does not state whether output is truncated at that size or that the operation is purely read-only, leaving a modest gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loads the return contract and the routing rule before the Args block; every sentence carries information. No redundant restatement of the tool name or boilerplate.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be re-explained, and the two parameters are well covered. The only gap is behavior at the stated 15k+ char scale — truncation, pagination, or splitting is not addressed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate for both parameters and largely does: doc_id is described as either a search_docs id or a path form ('items/index.md' / 'items'), and version is scoped to the path case with example keys including the default 'current'.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Specific verb (Return) + resource (a whole documentation page) + output form (markdown plus heading outline). The word 'whole' implicitly contrasts with get_section, so an agent can distinguish this tool from its sibling without opening either schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly routes the agent: 'Prefer get_section unless the whole page is genuinely needed', and gives a concrete reason (pages reach 15k+ chars). This is a clear when-not-to-use statement naming the alternative.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_sectionA
Return one section (heading + body) of a documentation page.
Cheaper and more focused than get_doc. The heading argument accepts an anchor ("creating-an-item"), a heading title ("Creating an Item"), or any distinctive part of the heading path.
Args: doc_id: doc_id from search_docs, or a path such as "items/index.md" / "items". heading: anchor, heading text, or heading-path fragment. version: version key; only used when doc_id is a path rather than a full doc_id.
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ||
| heading | Yes | ||
| version | No | current |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It usefully discloses the return shape (heading + body) and a cost relationship to get_doc, but says nothing about failure modes such as an unmatched or ambiguous heading, or whether doc_id must come from a prior search. Adequate but with real gaps for a no-annotation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Purpose is front-loaded in the first sentence, the sibling comparison follows, and the Args block is tight and non-redundant. Slightly padded by the multi-line argument enumeration, but every line carries non-obvious information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need no explanation, and the description covers input semantics and relative cost thoroughly. The remaining hole is edge-case behavior (heading not found or ambiguous), which is a minor omission given the otherwise complete coverage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, and the Args block does so well: doc_id accepts either a search_docs id or a path form ('items/index.md' / 'items'), heading accepts an anchor, a heading title, or a distinctive path fragment, and version is conditional ('only used when doc_id is a path'). This is meaning the bare schema cannot convey.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource (return one section, heading + body, of a documentation page) and explicitly names the sibling it is a narrower alternative to: 'Cheaper and more focused than get_doc.' An agent can distinguish it from get_doc, list_docs, and find_symbol without opening any schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives a clear selection signal versus get_doc ('cheaper and more focused'), implying this is the right tool when a single section suffices rather than a full page. It stops short of stating when not to use it (e.g., when you need multiple sections or the whole document), so no explicit exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_docsA
List every page of a documentation version with title, group and URL.
Useful for browsing or checking whether a page exists before searching.
Args: version: version key ("current", "1.21.1", ...). section: optional filter: "docs", "toolchain", "user", "modpack".
| Name | Required | Description | Default |
|---|---|---|---|
| section | No | ||
| version | No | current |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. "List every page" implies a complete, read-only enumeration with no pagination, but permissions, rate limits, and whether the result is truncated are never stated. Return-field coverage is also largely duplicative of the output schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Purpose and usage are front-loaded in two short sentences, followed by a compact Args block with no filler. The only minor waste is restating return fields (title, group, URL) that the output schema already conveys.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, the description needn't explain return values, and it covers scope, usage trigger, and both parameters. For a simple two-parameter list tool the only real gap is behavioral context (limits, auth) that no annotation supplies.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, yet the Args block documents both parameters: it gives concrete version-key values ("current", "1.21.1", ...) and enumerates the four valid section filters, which the schema does not constrain at all. It only omits what omitting section does, which is adequately implied by "optional filter".
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The first sentence gives a specific verb, resource and scope: listing every page of a documentation version, including returned fields (title, group, URL). It is clearly distinguishable from get_doc/get_section, though it never names a sibling explicitly, so it stops short of a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
"Useful for browsing or checking whether a page exists before searching" gives a concrete when-to-use condition that implicitly routes keyword lookups to search_docs. There are no explicit exclusions or prerequisites (e.g. auth), so it is clear context rather than full when/when-not guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_docsA
Search NeoForge docs and return ranked section snippets with URLs.
Args: query: English keywords, e.g. "register item", "data components", "screen rendering". version: "current" (26.1), an exact version such as "1.21.1" / "1.20.4", or "all". section: optional filter: "docs", "toolchain", "user", "modpack". limit: number of hits, 1-12 (default 6). mode: "text" for normal search, "api" to restrict matching to code identifiers.
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | text | |
| limit | No | ||
| query | Yes | ||
| section | No | ||
| version | No | current |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden, and it does disclose useful behavior: ranked snippet+URL results, a 1-12 limit with default 6, and the meaning of each version value including the concrete 'current' (26.1). It says nothing about permissions, result size, pagination, or whether queries are fuzzy, so a meaningful gap remains for a read tool whose output schema is present.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The purpose sentence is front-loaded and every Args line carries information not present elsewhere. The Args block itself is a slightly clunky format, but nothing pads or repeats unnecessarily.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With 5 parameters, one required, no annotations, and an output schema already covering return values, the definition supplies enough to invoke the tool correctly: full parameter semantics and version/section vocabularies. It stops short of saying when to prefer it over the get_*/find_symbol siblings.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must carry all parameter meaning — and it does. It defines query with concrete examples, enumerates the section filter values ('docs', 'toolchain', 'user', 'modpack') that the schema does not constrain, gives the limit range 1-12, and explains mode='text' vs 'api'.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (search) and resource (NeoForge docs) plus the return shape (ranked section snippets with URLs), which is more than a restatement of the name. It does not explicitly distinguish itself from siblings such as get_doc, get_section, or find_symbol, so an agent must infer the split itself.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is only implied: the parameter documentation (section filters, mode='api', version options) hints at when each option applies, and mode='api' gestures toward identifier lookup. There is no explicit statement of when to choose this over get_doc/get_section/find_symbol, nor any exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v0.1.0- First observed
compare_versions - First observed
find_symbol - First observed
get_doc - First observed
get_section - First observed
list_docs - First observed
search_docs
TDQS
Scored across 6 tools
Most tools are clearly distinct: get_section vs get_doc is explicitly delineated (partial vs whole page) and list_docs/compare_versions have unique roles. The main overlap is search_docs with mode='api' restricting matches to code identifiers, which duplicating find_symbol's purpose; find_symbol adds exact-then-substring behavior, but the boundary is soft.
All six tools follow a clean snake_case verb_noun pattern (search_docs, get_section, get_doc, find_symbol, list_docs, compare_versions). Verbs are distinct and predictable, with no mixed conventions.
Six tools is well-scoped for a documentation server: search, browse, section/page retrieval, symbol lookup, and version diffing. Each tool earns its place with no redundant bulk.
The read-only docs surface is thorough: full-text and symbol search, page listing, granular section retrieval, whole-page retrieval, and cross-version diffing cover the realistic lifecycle of doc lookup. No obvious dead ends for the stated purpose.
Maintenance
Related MCP Connectors
MCP server for developer documentation, generated by doc2mcp.
MCP server for dev documentation, generated by doc2mcp.
Search, inspect and inject full source modules (code + AI rules + MCP) pinned to a Git commit.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides comprehensive access to MCP documentation through structured guides, full-text search, and interactive development workflows for building servers and clients.37 npmMIT
- AlicenseAqualityCmaintenanceProvides searchable access to official MCP protocol specification and FastMCP framework documentation, helping developers build correct MCP servers by querying live documentation with BM25 full-text search.23MIT
- FlicenseNot gradedqualityDmaintenanceIndexes documentation sites by base URL and serves keyword search, optional semantic search, and Markdown page retrieval as MCP tools, all from a single SQLite file.-
- AlicenseNot gradedqualityAmaintenanceSelf-hosted documentation and code indexing with MCP integration.24MIT