MCP LLMS-TXT Documentation Server
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。这允许用户审计每个工具调用以及返回的上下文。
Related MCP server: Library Docs MCP Server
快速入门
安装 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 检查器并连接到正在运行的服务器:
npx @modelcontextprotocol/inspector在这里,您可以测试
tool调用。
连接到光标
打开
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打开 Cascade(在 Mac 上)。单击
Configure MCP以打开配置文件~/.codeium/windsurf/mcp_config.json。如上所述,使用
langgraph-docs-mcp进行更新。
CMD+L(在 Mac 上)打开 Cascade 并刷新 MCP 服务器。可用的 MCP 服务器将被列出,并显示
langgraph-docs-mcp已连接。
然后,尝试示例提示:
它将执行您的工具调用。
连接到 Claude 桌面
打开
Settings/Developer来更新~/Library/Application\ Support/Claude/claude_desktop_config.json。如上所述,使用
langgraph-docs-mcp进行更新。重新启动 Claude 桌面应用程序。
您将在聊天输入的右下角看到您的工具。
然后,尝试示例提示:
在处理您的请求时,它会要求批准工具调用。
连接到克劳德代码
安装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 配置文件:
这将从此 repo 中的
sample_config.yaml文件加载 LangGraph Python 文档。
mcpdoc --yaml sample_config.yaml使用 JSON 配置文件:
这将从此 repo 中的
sample_config.json文件加载 LangGraph Python 文档。
mcpdoc --json sample_config.json直接指定带有可选名称的 llms.txt URL:
URL 可以指定为纯 URL,也可以使用
name: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这将以 15 秒的超时时间加载 LangGraph Python 文档,并在必要时遵循任何 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.txtJSON 配置示例 (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")This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityBmaintenanceAn MCP server that provides tools to load and fetch documentation from any llms.txt source, giving users full control over context retrieval for LLMs in IDE agents and applications.1,029MIT
- FlicenseBqualityDmaintenanceAn MCP server that fetches real-time documentation for popular libraries like Langchain, Llama-Index, MCP, and OpenAI, allowing LLMs to access updated library information beyond their knowledge cut-off dates.13
- Flicense-qualityDmaintenanceA customized MCP server that enables integration between LLM applications and documentation sources, providing AI-assisted access to LangGraph and Model Context Protocol documentation.
- Alicense-qualityDmaintenanceAn MCP server that enables users to fetch and audit documentation from user-defined llms.txt index files. It provides tools to list documentation sources and retrieve content from specific URLs with built-in domain access controls for secure context retrieval.MIT
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/teddylee777/mcpdoc'
If you have feedback or need assistance with the MCP directory API, please join our Discord server