Marten Docs MCP服务器
本地MCP服务器,用于集中检索Marten文档。
它缓存 https://martendb.io/llms-full.txt,构建一个局部索引,并公开一个狭窄的检索表面,以便代理首先搜索,然后逐渐缩小到特定的部分。
快速安装
macOS/Linux
# Install latest release
curl -fsSL https://raw.githubusercontent.com/stijnVanHorenbeek/marten_mcp/master/scripts/quickinstall.sh | sh
# Print a Copilot-compatible config snippet
curl -fsSL https://raw.githubusercontent.com/stijnVanHorenbeek/marten_mcp/master/scripts/quickinstall.sh | sh -s -- --client copilotWindows PowerShell
# Install latest release
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/stijnVanHorenbeek/marten_mcp/master/scripts/quickinstall.ps1)))
# Print a Copilot-compatible config snippet
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/stijnVanHorenbeek/marten_mcp/master/scripts/quickinstall.ps1))) -Client copilotSKILL.md示例
示例 技能.md 包括
MCP配置示例
开源代码
{
"mcp": {
"marten-docs": {
"type": "local",
"command": ["marten-docs-mcp"],
"environment": {
"MARTEN_MCP_CACHE_DIR": "~/.cache/marten-docs-mcp",
"MARTEN_MCP_STORAGE_MODE": "auto",
"MARTEN_MCP_SQLITE_PATH": "~/.cache/marten-docs-mcp/cache.db"
}
}
}
}GitHub Copilot 聊天助手
{
"mcpServers": {
"marten-docs": {
"type": "local",
"command": "marten-docs-mcp",
"args": [],
"env": {
"MARTEN_MCP_CACHE_DIR": "~/.cache/marten-docs-mcp",
"MARTEN_MCP_STORAGE_MODE": "auto",
"MARTEN_MCP_SQLITE_PATH": "~/.cache/marten-docs-mcp/cache.db"
},
"tools": ["*"]
}
}
}MCP工具
search_docs(query, limit?, offset?)search_within_page(path, query, limit?, offset?)list_headings(path)read_section(id, segmentIndex?, offset?, maxChars?)(返回一个本地段加上压缩neighbors.before/after参考文献)read_context(id, before?, after?)(仅限附近参考文献)list_pages(prefix?, limit?)(仅在搜索不足时发现)get_status()refresh_docs(force?)
推荐检索流程
search_docs(...)- 窄与
list_headings(...)和search_within_page(...) - 阅读一个区块
read_section(...) - 使用
read_context(...)仅供附近参考
宽页面转储故意不受支持。
1. search_docs(query="aggregate projections", limit=3)
2. search_within_page(path="/events/projections/aggregate-projections.md", query="lifecycle", limit=3)
3. read_section(id="", offset=0, maxChars=1200)
4. read_context(id="", before=1, after=1)
5. repeat read_section(..., offset=) while hasMore=true