Token导航 LogoToken导航TokenDH.com
MCP LLMS-TXT Documentation Server logo
开发工具stdio官方级别未说明来源级核验

MCP LLMS-TXT Documentation Server

MCP Server

MCP LLMS-TXT文档服务器是一个开源工具,允许开发者通过llms.txt文件检索和管理文档,提供对工具调用的完全控制和审计功能。

工具数

2

提示词数

0

GitHub Stars

985

资源数

0
文档检索开发工具PythonClaude开源工具Claude DesktopClaudeCursorWindsurf

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

langchain-ai

提供方

langchain-ai

最后核验

2026/5/17 20:22

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uvx --from mcpdoc mcpdoc \

详细介绍

MCP LLMS-TXT文档服务器

概述

llms.txt 是LLM的网站索引,提供背景信息、指导和详细标记文件的链接。可以使用Cursor和Windsurf等IDE或Claude Code/Desk等应用程序 llms.txt 检索任务的上下文。然而,这些应用程序使用不同的内置工具来读取和处理文件,如 llms.txt检索过程可能是不透明的,并且并不总是有办法审计工具调用或返回的上下文。

llms txt

您可以在此处找到langgraph和langchain的llms.txt文件:

llms.txt
Python语言图
LangGraph JS
语言链Pythonhttps://python.langchain.com/llms.txt
朗链JShttps://js.langchain.com/llms.txt

快速启动

安装uv

curl -LsSf https://astral.sh/uv/install.sh | sh

选择一个 llms.txt 要使用的文件。

  • 例如, 这是 LangGraph llms.txt 文件。
注意:安全和域访问控制 出于安全原因,mcpdoc实施了严格的域访问控制: 1. 远程llms.txt文件:当您指定远程llms.txt URL时(例如。, https://langchain-ai.github.io/langgraph/llms.txt),mcpdoc仅自动添加该特定域(langchain-ai.github.io)到允许的域列表。这意味着该工具只能从该域上的URL获取文档。 1. 本地llms.txt文件:使用本地文件时,没有域会自动添加到允许列表中。您必须明确指定允许使用的域 --allowed-domains 参数。 1. 添加其他域:要允许从自动包含的域之外的域中获取数据,请执行以下操作: - 使用 --allowed-domains domain1.com domain2.com 添加特定域 - 使用 --allowed-domains '*' 允许所有域(谨慎使用) 此安全措施可防止对未经用户明确批准的域进行未经授权的访问,确保只能从可信来源检索文档。

(可选)使用您的 llms.txt 所选文件:

uvx --from mcpdoc mcpdoc \
    --urls "LangGraph:https://langchain-ai.github.io/langgraph/llms.txt" "LangChain:https://python.langchain.com/llms.txt" \
    --transport sse \
    --port 8082 \
    --host localhost
  • 这应该在以下时间运行:http://localhost:8082

Screenshot 2025-03-18 at 3 29 30 PM

npx @modelcontextprotocol/inspector

Screenshot 2025-03-18 at 3 30 30 PM

  • 在这里,您可以测试 tool 电话。

连接到光标

  • 打开 Cursor SettingsMCP 选项卡。
  • 这将打开 ~/.cursor/mcp.json 文件。

Screenshot 2025-03-19 at 11 01 31 AM

  • 将以下内容粘贴到文件中(我们使用 langgraph-docs-mcp 名称和指向LangGraph的链接 llms.txt).
{
  "mcpServers": {
    "langgraph-docs-mcp": {
      "command": "uvx",
      "args": [
        "--from",
        "mcpdoc",
        "mcpdoc",
        "--urls",
        "LangGraph:https://langchain-ai.github.io/langgraph/llms.txt LangChain:https://python.langchain.com/llms.txt",
        "--transport",
        "stdio"
      ]
    }
  }
}
  • 确认服务器正在您的 Cursor Settings/MCP 选项卡。
  • 最佳做法是更新游标全局(用户)规则。
  • 打开的游标 Settings/Rules 并更新 User Rules 具有以下内容(或类似内容):
for ANY question about LangGraph, use the langgraph-docs-mcp server to help answer -- 
+ 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
  • CMD+L (在Mac上)打开聊天。
  • 确保 agent 被选中。

Screenshot 2025-03-18 at 1 56 54 PM

然后,尝试一个示例提示,例如:

what are types of memory in LangGraph?

Screenshot 2025-03-18 at 1 58 38 PM

连接到Windsurf

  • 打开Cascade CMD+L (在Mac上)。
  • 点击 Configure MCP 要打开配置文件, ~/.codeium/windsurf/mcp_config.json.
  • 更新为 langgraph-docs-mcp 如上所述。

Screenshot 2025-03-19 at 11 02 52 AM

  • 更新 Windsurf Rules/Global rules 具有以下内容(或类似内容):
for ANY question about LangGraph, use the langgraph-docs-mcp server to help answer -- 
+ 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

Screenshot 2025-03-18 at 2 02 12 PM

然后,尝试示例提示:

  • 它将执行您的工具调用。

Screenshot 2025-03-18 at 2 03 07 PM

连接到克劳德桌面

  • 打开 Settings/Developer 更新 ~/Library/Application\ Support/Claude/claude_desktop_config.json.
  • 更新为 langgraph-docs-mcp 如上所述。
  • 重新启动Claude Desktop应用程序。
\[!注意\] 如果在尝试将MCPDoc工具添加到Claude Desktop时遇到Python版本不兼容的问题,可以显式指定文件路径 python 可执行于 uvx 命令。 Example configuration `` { "mcpServers": { "langgraph-docs-mcp": { "command": "uvx", "args": [ "--python", "/path/to/python", "--from", "mcpdoc", "mcpdoc", "--urls", "LangGraph:https://langchain-ai.github.io/langgraph/llms.txt", "--transport", "stdio" ] } } } ``
\[!注意\] 目前(3/21/25),Claude Desktop似乎不支持 rules 对于全局规则,请在提示后附加以下内容。

for ANY question about LangGraph, use the langgraph-docs-mcp server to help answer -- 
+ 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

Screenshot 2025-03-18 at 2 05 54 PM

  • 您将在聊天输入的右下角看到您的工具。

Screenshot 2025-03-18 at 2 05 39 PM

然后,尝试示例提示:

  • 它将在处理您的请求时请求批准工具调用。

Screenshot 2025-03-18 at 2 06 54 PM

连接到克劳德代码

  • 安装后在终端中 克劳德代码,运行此命令将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", "LangChain:https://python.langchain.com/llms.txt"]}' -s local
  • 你会看到 ~/.claude.json 更新。
  • 通过启动Claude Code并运行以查看您的工具进行测试:
$ Claude
$ /mcp 

Screenshot 2025-03-18 at 2 13 49 PM

\[!注意\] 目前(3/21/25),Claude Code似乎不支持 rules 对于全局规则,请在提示后附加以下内容。

for ANY question about LangGraph, use the langgraph-docs-mcp server to help answer -- 
+ 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

然后,尝试示例提示:

  • 它将请求批准工具调用。

Screenshot 2025-03-18 at 2 14 37 PM

命令行界面

mcpdoc 命令提供了一个用于启动文档服务器的简单CLI。

您可以通过三种方式指定文档源,这些方式可以组合使用:

  1. 使用YAML配置文件:
  • 这将从以下位置加载LangGraph Python文档 sample_config.yaml 此仓库中的文件。
mcpdoc --yaml sample_config.yaml
  1. 使用JSON配置文件:
  • 这将从以下位置加载LangGraph Python文档 sample_config.json 此仓库中的文件。
mcpdoc --json sample_config.json
  1. 直接指定带有可选名称的llms.txt URL:
  • URL可以指定为纯URL,也可以使用以下格式指定可选名称 name:url.
  • 您可以使用以下命令指定多个URL --urls 参数多次。
  • 我们就是这样装载的 llms.txt 对于上面的MCP服务器。
mcpdoc --urls LangGraph:https://langchain-ai.github.io/langgraph/llms.txt --urls LangChain:https://python.langchain.com/llms.txt

您还可以组合这些方法来合并文档源:

mcpdoc --yaml sample_config.yaml --json sample_config.json --urls LangGraph:https://langchain-ai.github.io/langgraph/llms.txt --urls LangChain:https://python.langchain.com/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.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")

目录标签

目录标签

文档检索开发工具PythonClaude开源工具本地部署LLM集成

支持客户端

Claude DesktopClaudeCursorWindsurf

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

2

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP