Back to MCP directory
verified_userVerifieddnsLocal runtime

LLMS.txt Documentation

MCP LLMS-TXT文档服务器是一个开源工具,允许开发者通过MCP协议控制IDE和应用程序访问llms.txt文档资源。

article

README

🚀 mcpdoc 项目

mcpdoc 是一个用于加载和管理文档源的工具,支持通过多种方式配置文档服务器,能方便地查询文档信息。

🚀 快速开始

启动文档服务器

通过以下命令启动文档服务器:

mcpdoc --urls LangGraph:https://langchain-ai.github.io/langgraph/llms.txt

此命令将加载并提供 LangGraph Python 文档

查询文档

启动服务器后,可以通过以下方式查询文档:

/mcp query "请列举所有支持的模型"

📦 安装指南

使用 pip 安装:

pip install mcpdoc

📚 详细文档

配置指南

文档服务器支持多种配置方式,可以灵活地添加和管理文档源。

使用 YAML 配置文件

创建 sample_config.yaml 文件:

# Sample configuration for mcpdoc server
# Each entry must have a llms_txt URL and can optionally include a name
- name: LangGraph Python
  llms_txt: https://langchain-ai.github.io/langgraph/llms.txt

启动服务器时指定 YAML 配置文件:

mcpdoc --yaml sample_config.yaml

使用 JSON 配置文件

创建 sample_config.json 文件:

[
  {
    "name": "LangGraph Python",
    "llms_txt": "https://langchain-ai.github.io/langgraph/llms.txt"
  }
]

启动服务器时指定 JSON 配置文件:

mcpdoc --json sample_config.json

直接指定 URL

可以通过 --urls 参数直接指定文档源的 URL,格式为 name:url。例如:

mcpdoc --urls LangGraph:https://langchain-ai.github.io/langgraph/llms.txt --urls LangChain:https://python.langchain.com/llms.txt

组合使用

可以将 YAML、JSON 配置文件和 --urls 参数组合使用:

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

💻 使用示例

基础用法

from mcpdoc.main import create_server

# 创建服务器实例,指定文档源
server = create_server(
    [
        {
            "name": "LangGraph Python",
            "llms_txt": "https://langchain-ai.github.io/langgraph/llms.txt",
        },
        # 可以添加多个文档源
        # {
        #     "name": "Another Documentation",
        #     "llms_txt": "https://example.com/llms.txt",
        # },
    ],
    follow_redirects=True,
    timeout=15.0,
)

# 启动服务器
server.run(transport="stdio")
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client