llmstxt-mcp — MCP LLMS-TXT Documentation Server
Installed from PyPI as llmstxt-mcp-server; the CLI command is mcpdoc.
A maintained fork of langchain-ai/mcpdoc, ported to MCP Python SDK v2.
Upstream
mcpdoctargets SDK v1 and declares an unboundedmcp[cli]>=1.4.1. Now that MCP Python SDK v2.0.0 (the 2026-07-28 spec release) is on PyPI, a freshuvx --from mcpdoc mcpdoc ...resolvesmcp2.x and fails immediately — SDK v2 removedmcp.server.fastmcpand renamedFastMCPtoMCPServer.This fork ports the server to
MCPServer, pinsmcp>=2.0.0,<3, and adds thestreamable-httptransport. Original work © LangChain, Inc., MIT licensed; this fork keeps the same license. See Differences from upstream.The PyPI distribution is
llmstxt-mcp-server(PyPI rejectsllmstxt-mcpas too similar to the unrelatedllms-txt-mcpproject). The import package and CLI command remainmcpdoc.Still on SDK v1? Keep using upstream
mcpdocand pinmcp<2yourself.
Overview
llms.txt is a website index for LLMs, providing background information, guidance, and links to detailed markdown files. IDEs like Cursor and Windsurf or apps like Claude Code/Desktop can use llms.txt to retrieve context for tasks. However, these apps use different built-in tools to read and process files like llms.txt. The retrieval process can be opaque, and there is not always a way to audit the tool calls or the context returned.
MCP offers a way for developers to have full control over tools used by these applications. Here, we create an open source MCP server to provide MCP host applications (e.g., Cursor, Windsurf, Claude Code/Desktop) with (1) a user-defined list of llms.txt files and (2) a simple fetch_docs tool read URLs within any of the provided llms.txt files. This allows the user to audit each tool call as well as the context returned.
llms-txt
You can find llms.txt files for langgraph and langchain here:
| Library | llms.txt |
|---|---|
| LangGraph Python | https://langchain-ai.github.io/langgraph/llms.txt |
| LangGraph JS | https://langchain-ai.github.io/langgraphjs/llms.txt |
| LangChain Python | https://python.langchain.com/llms.txt |
| LangChain JS | https://js.langchain.com/llms.txt |
Quickstart
Install uv
- Please see official uv docs for other ways to install
uv.
curl -LsSf https://astral.sh/uv/install.sh | sh
Choose an llms.txt file to use.
- For example, here's the LangGraph
llms.txtfile.
Note: Security and Domain Access Control
For security reasons, mcpdoc implements strict domain access controls:
Remote llms.txt files: When you specify a remote llms.txt URL (e.g.,
https://langchain-ai.github.io/langgraph/llms.txt), mcpdoc automatically adds only that specific domain (langchain-ai.github.io) to the allowed domains list. This means the tool can only fetch documentation from URLs on that domain.Local llms.txt files: When using a local file, NO domains are automatically added to the allowed list. You MUST explicitly specify which domains to allow using the
--allowed-domainsparameter.Adding additional domains: To allow fetching from domains beyond those automatically included:
- Use
--allowed-domains domain1.com domain2.comto add specific domains- Use
--allowed-domains '*'to allow all domains (use with caution)This security measure prevents unauthorized access to domains not explicitly approved by the user, ensuring that documentation can only be retrieved from trusted sources.
(Optional) Test the MCP server locally with your llms.txt file(s) of choice:
uvx --from llmstxt-mcp-server mcpdoc \
--urls "LangGraph:https://langchain-ai.github.io/langgraph/llms.txt" "LangChain:https://python.langchain.com/llms.txt" \
--transport sse \
--port 8082 \
--host localhost
- This should run at: http://localhost:8082
- Run MCP inspector and connect to the running server:
npx @modelcontextprotocol/inspector
- Here, you can test the
toolcalls.
Connect to Cursor
- Open
Cursor SettingsandMCPtab. - This will open the
~/.cursor/mcp.jsonfile.
- Paste the following into the file (we use the
langgraph-docs-mcpname and link to the LangGraphllms.txt).
{
"mcpServers": {
"langgraph-docs-mcp": {
"command": "uvx",
"args": [
"--from",
"llmstxt-mcp-server",
"mcpdoc",
"--urls",
"LangGraph:https://langchain-ai.github.io/langgraph/llms.txt LangChain:https://python.langchain.com/llms.txt",
"--transport",
"stdio"
]
}
}
}
- Confirm that the server is running in your
Cursor Settings/MCPtab. - Best practice is to then update Cursor Global (User) rules.
- Open Cursor
Settings/Rulesand updateUser Ruleswith the following (or similar):
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(on Mac) to open chat.- Ensure
agentis selected.
Then, try an example prompt, such as:
what are types of memory in LangGraph?
Connect to Windsurf
- Open Cascade with
CMD+L(on Mac). - Click
Configure MCPto open the config file,~/.codeium/windsurf/mcp_config.json. - Update with
langgraph-docs-mcpas noted above.
- Update
Windsurf Rules/Global ruleswith the following (or similar):
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
Then, try the example prompt:
- It will perform your tool calls.
Connect to Claude Desktop
- Open
Settings/Developerto update~/Library/Application\ Support/Claude/claude_desktop_config.json. - Update with
langgraph-docs-mcpas noted above. - Restart Claude Desktop app.
[!Note] If you run into issues with Python version incompatibility when trying to add MCPDoc tools to Claude Desktop, you can explicitly specify the filepath to
pythonexecutable in theuvxcommand.Example configuration
{ "mcpServers": { "langgraph-docs-mcp": { "command": "uvx", "args": [ "--python", "/path/to/python", "--from", "llmstxt-mcp-server", "mcpdoc", "--urls", "LangGraph:https://langchain-ai.github.io/langgraph/llms.txt", "--transport", "stdio" ] } } }
[!Note] Currently (3/21/25) it appears that Claude Desktop does not support
rulesfor global rules, so appending the following to your prompt.
<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
</rules>
- You will see your tools visible in the bottom right of your chat input.
Then, try the example prompt:
- It will ask to approve tool calls as it processes your request.
Connect to Claude Code
- In a terminal after installing Claude Code, run this command to add the MCP server to your project:
claude mcp add-json langgraph-docs '{"type":"stdio","command":"uvx" ,"args":["--from", "llmstxt-mcp-server", "mcpdoc", "--urls", "langgraph:https://langchain-ai.github.io/langgraph/llms.txt", "LangChain:https://python.langchain.com/llms.txt"]}' -s local
- You will see
~/.claude.jsonupdated. - Test by launching Claude Code and running to view your tools:
$ Claude
$ /mcp
[!Note] Currently (3/21/25) it appears that Claude Code does not support
rulesfor global rules, so appending the following to your prompt.
<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
</rules>
Then, try the example prompt:
- It will ask to approve tool calls.
Command-line Interface
The mcpdoc command provides a simple CLI for launching the documentation server.
You can specify documentation sources in three ways, and these can be combined:
- Using a YAML config file:
- This will load the LangGraph Python documentation from the
sample_config.yamlfile in this repo.
mcpdoc --yaml sample_config.yaml
- Using a JSON config file:
- This will load the LangGraph Python documentation from the
sample_config.jsonfile in this repo.
mcpdoc --json sample_config.json
- Directly specifying llms.txt URLs with optional names:
- URLs can be specified either as plain URLs or with optional names using the format
name:url. - You can specify multiple URLs by using the
--urlsparameter multiple times. - This is how we loaded
llms.txtfor the MCP server above.
mcpdoc --urls LangGraph:https://langchain-ai.github.io/langgraph/llms.txt --urls LangChain:https://python.langchain.com/llms.txt
You can also combine these methods to merge documentation sources:
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
Additional Options
--follow-redirects: Follow HTTP redirects (defaults to False)--timeout SECONDS: HTTP request timeout in seconds (defaults to 10.0)--log-level LEVEL: Server log level —DEBUG,INFO,WARNING,ERROR,CRITICAL(defaults toINFO)
Example with additional options:
mcpdoc --yaml sample_config.yaml --follow-redirects --timeout 15
This will load the LangGraph Python documentation with a 15-second timeout and follow any HTTP redirects if necessary.
Transports
--transport accepts three values:
| Transport | When to use |
|---|---|
stdio (default) |
Local MCP clients — Cursor, Windsurf, Claude Desktop, Claude Code |
streamable-http |
Recommended for remote hosting. Runs stateless per the 2026-07-28 spec, so replicas sit behind a plain round-robin load balancer |
sse |
Legacy HTTP transport; kept for compatibility with older clients |
--host and --port apply to sse and streamable-http (they are ignored for stdio).
mcpdoc --yaml sample_config.yaml --transport streamable-http --host 0.0.0.0 --port 8000
Differences from upstream
upstream mcpdoc |
llmstxt-mcp-server |
|
|---|---|---|
| MCP Python SDK | v1 (FastMCP), unbounded mcp[cli]>=1.4.1 |
v2 only (MCPServer), mcp>=2.0.0,<3 |
| Transports | stdio, sse |
stdio, sse, streamable-http (stateless) |
--log-level |
parsed but ignored (hardcoded to INFO) |
actually applied to the server |
| Tests | pure helper functions only | plus in-process client tests that build and call the real server |
| CI | tests the locked SDK version only | plus a job that resolves the newest allowed mcp and warns on a new SDK major |
The import package and CLI command are still named mcpdoc, so migrating from
upstream only means changing --from mcpdoc to --from llmstxt-mcp-server in your
MCP client config.
Configuration Format
Both YAML and JSON configuration files should contain a list of documentation sources.
Each source must include an llms_txt URL and can optionally include a name:
YAML Configuration Example (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 Configuration Example (sample_config.json)
[
{
"name": "LangGraph Python",
"llms_txt": "https://langchain-ai.github.io/langgraph/llms.txt"
}
]
Programmatic Usage
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. Under SDK v2, host/port belong to run(), not to create_server().
server.run(transport="stdio")
# or, for remote hosting:
# server.run(transport="streamable-http", host="0.0.0.0", port=8000, stateless_http=True)
create_server returns an mcp.server.mcpserver.MCPServer, so you can also drive
it in-process with the SDK's test client — no subprocess needed:
from mcp.client import Client
async with Client(server) as client:
result = await client.call_tool("list_doc_sources", {})
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llmstxt_mcp_server-0.1.0.tar.gz.
File metadata
- Download URL: llmstxt_mcp_server-0.1.0.tar.gz
- Upload date:
- Size: 104.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d503660f7d334b06a664aeb78c7d18539512ff031ad82e73e619faf5f12f0b8
|
|
| MD5 |
756edcfea13f5905c176b43dc215d016
|
|
| BLAKE2b-256 |
ba763e8b0eca07675e519dc7800704df3cc696c194756672158ac81010e56a05
|
File details
Details for the file llmstxt_mcp_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llmstxt_mcp_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85dddcc00fdbe6bb59d6695cb4d36f7515b55a94bfc4bbf1de0496eef1f309e4
|
|
| MD5 |
5150f05134adb4aa61fa7621a91b4bb6
|
|
| BLAKE2b-256 |
cb8056fc3ec6d6aa970d6e216ba2351c8080c98254955d7588ecb7361b6a8cdb
|