
MCP LLMS-TXT Documentation Server
一个开源的 MCP 服务器,为 Cursor、Windsurf 和 Claude 等应用程序提供访问 llms.txt 文档文件的能力,允许用户控制和审计上下文检索。
README
MCP LLMS-TXT 文档服务器
概述
llms.txt 是 LLM 的网站索引,提供背景信息、指导和指向详细 markdown 文件的链接。像 Cursor 和 Windsurf 这样的 IDE 或像 Claude Code/Desktop 这样的应用程序可以使用 llms.txt
来检索任务的上下文。然而,这些应用程序使用不同的内置工具来读取和处理像 llms.txt
这样的文件。检索过程可能不透明,并且不总是有办法审计工具调用或返回的上下文。
MCP 为开发者提供了一种完全控制这些应用程序使用的工具的方法。在这里,我们创建一个开源 MCP 服务器,为 MCP 主机应用程序(例如,Cursor、Windsurf、Claude Code/Desktop)提供 (1) 用户定义的 llms.txt
文件列表和 (2) 一个简单的 fetch_docs
工具,用于读取任何提供的 llms.txt
文件中的 URL。这允许用户审计每个工具调用以及返回的上下文。
快速开始
安装 uv
- 请参阅 官方 uv 文档 了解其他安装
uv
的方法。
curl -LsSf https://astral.sh/uv/install.sh | sh
选择要使用的 llms.txt
文件。
- 例如,这里 是 LangGraph 的
llms.txt
文件。
(可选) 使用您选择的 llms.txt
文件在本地测试 MCP 服务器:
uvx --from mcpdoc mcpdoc \
--urls LangGraph:https://langchain-ai.github.io/langgraph/llms.txt \
--transport sse \
--port 8082 \
--host localhost
- 这应该在 http://localhost:8082 运行
- 运行 MCP inspector 并连接到正在运行的服务器:
npx @modelcontextprotocol/inspector
- 在这里,您可以测试
tool
调用。
连接到 Cursor
- 打开
Cursor Settings
和MCP
选项卡。 - 这将打开
~/.cursor/mcp.json
文件。
- 将以下内容粘贴到文件中(我们使用
langgraph-docs-mcp
名称并链接到 LangGraphllms.txt
)。
{
"mcpServers": {
"langgraph-docs-mcp": {
"command": "uvx",
"args": [
"--from",
"mcpdoc",
"mcpdoc",
"--urls",
"LangGraph:https://langchain-ai.github.io/langgraph/llms.txt",
"--transport",
"stdio",
"--port",
"8081",
"--host",
"localhost"
]
}
}
}
- 确认服务器在您的
Cursor Settings/MCP
选项卡中运行。 CMD+L
(在 Mac 上) 打开聊天。- 确保选择了
agent
。
然后,尝试一个示例提示,例如:
use the langgraph-docs-mcp server to answer any LangGraph questions --
+ call list_doc_sources tool to get the available llms.txt file
+ call fetch_docs tool to read it
+ reflect on the urls in llms.txt
+ reflect on the input question
+ call fetch_docs on any urls relevant to the question
+ use this to answer the question
what are types of memory in LangGraph?
连接到 Windsurf
- 使用
CMD+L
(在 Mac 上) 打开 Cascade。 - 单击
Configure MCP
以打开配置文件~/.codeium/windsurf/mcp_config.json
。 - 如上所述,使用
langgraph-docs-mcp
更新。
CMD+L
(在 Mac 上) 打开 Cascade 并刷新 MCP 服务器。- 将列出可用的 MCP 服务器,显示
langgraph-docs-mcp
已连接。
然后,尝试示例提示:
- 它将执行您的工具调用。
连接到 Claude Desktop
- 打开
Settings/Developer
以更新~/Library/Application\ Support/Claude/claude_desktop_config.json
。 - 如上所述,使用
langgraph-docs-mcp
更新。 - 重新启动 Claude Desktop 应用程序。
- 您将在聊天输入的右下方看到您的工具。
然后,尝试示例提示:
- 它将要求批准工具调用,因为它会处理您的请求。
连接到 Claude Code
- 在安装 Claude Code 后的终端中,运行此命令以将 MCP 服务器添加到您的项目:
claude mcp add-json langgraph-docs '{"type":"stdio","command":"uvx" ,"args":["--from", "mcpdoc", "mcpdoc", "--urls", "langgraph:https://langchain-ai.github.io/langgraph/llms.txt"]}' -s local
- 您将看到
~/.claude.json
已更新。 - 通过启动 Claude Code 并运行以查看您的工具进行测试:
$ Claude
$ /mcp
然后,尝试示例提示:
- 它将要求批准工具调用。
命令行界面
mcpdoc
命令提供了一个简单的 CLI 用于启动文档服务器。
您可以通过三种方式指定文档源,并且可以将它们组合起来:
- 使用 YAML 配置文件:
- 这将从该存储库中的
sample_config.yaml
文件加载 LangGraph Python 文档。
mcpdoc --yaml sample_config.yaml
- 使用 JSON 配置文件:
- 这将从该存储库中的
sample_config.json
文件加载 LangGraph Python 文档。
mcpdoc --json sample_config.json
- 直接指定 llms.txt URL,并带有可选名称:
- 可以将 URL 指定为纯 URL,也可以使用
name:url
格式指定带有可选名称的 URL。 - 这就是我们上面为 MCP 服务器加载
llms.txt
的方式。
mcpdoc --urls LangGraph:https://langchain-ai.github.io/langgraph/llms.txt
您还可以组合这些方法来合并文档源:
mcpdoc --yaml sample_config.yaml --json sample_config.json --urls https://langchain-ai.github.io/langgraph/llms.txt
附加选项
--follow-redirects
: 遵循 HTTP 重定向(默认为 False)--timeout SECONDS
: HTTP 请求超时(以秒为单位)(默认为 10.0)
带有附加选项的示例:
mcpdoc --yaml sample_config.yaml --follow-redirects --timeout 15
这将加载 LangGraph Python 文档,超时时间为 15 秒,并在必要时遵循任何 HTTP 重定向。
配置格式
YAML 和 JSON 配置文件都应包含文档源列表。
每个源必须包含一个 llms_txt
URL,并且可以选择包含一个 name
:
YAML 配置示例 (sample_config.yaml)
# Sample configuration for mcp-mcpdoc server
# Each entry must have a llms_txt URL and optionally a name
- name: LangGraph Python
llms_txt: https://langchain-ai.github.io/langgraph/llms.txt
JSON 配置示例 (sample_config.json)
[
{
"name": "LangGraph Python",
"llms_txt": "https://langchain-ai.github.io/langgraph/llms.txt"
}
]
程序化使用
from mcpdoc.main import create_server
# Create a server with documentation sources
server = create_server(
[
{
"name": "LangGraph Python",
"llms_txt": "https://langchain-ai.github.io/langgraph/llms.txt",
},
# You can add multiple documentation sources
# {
# "name": "Another Documentation",
# "llms_txt": "https://example.com/llms.txt",
# },
],
follow_redirects=True,
timeout=15.0,
)
# Run the server
server.run(transport="stdio")
推荐服务器

Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。