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.
Each documentation source you provide now gets its own dedicated fetch tool!
- Instead of a generic
list_doc_sourcesorfetch_docstool, the MCP server dynamically creates a separate tool for each documentation source (e.g., eachllms.txtfile or local doc path you configure). - These tools are named after the source (e.g.,
fetch_docs_LangGraph,fetch_docs_LangChain, etc.) and are visible up front in your MCP client (Cursor, Windsurf, Claude, etc.). - Benefit: You no longer have to guess or discover which documentation sources are available—every source is directly accessible as its own tool, making it much easier to fetch docs for a particular package or library.
- This also makes it easier to audit and control which documentation is being accessed by your LLM agent.
Example:
If you configure two sources:
- LangGraph:
https://langchain-ai.github.io/langgraph/llms.txt - LangChain:
https://python.langchain.com/llms.txt
you will see two tools:
fetch_docs_LangGraphfetch_docs_LangChain
Each tool fetches and returns the documentation content for its specific source, converting it to markdown and handling errors.
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 |
- Please see official uv docs for other ways to install
uv.
curl -LsSf https://astral.sh/uv/install.sh | sh- 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.
Create a config file (e.g., sample_config.json):
[
{
"name": "LangGraph",
"llms_txt": "https://langchain-ai.github.io/langgraph/llms.txt"
},
{ "name": "LangChain", "llms_txt": "https://python.langchain.com/llms.txt" }
]Then run:
uvx --from mcpdoc mcpdoc \
--json sample_config.json \
--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.
- 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",
"mcpdoc",
"mcpdoc",
"--json",
"sample_config.json",
"--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 the fetch_docs_LangGraph tool to get the available llms.txt file
- reflect on the urls in llms.txt
- reflect on the input question
- call fetch_docs_LangGraph or fetch_docs_LangChain on any urls relevant to 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?
- 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 the fetch_docs_LangGraph tool to get the available llms.txt file
- reflect on the urls in llms.txt
- reflect on the input question
- call fetch_docs_LangGraph or fetch_docs_LangChain on any urls relevant to the question
Then, try the example prompt:
- It will perform your tool calls.
- 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 python executable in the uvx command.
Example configuration
{
"mcpServers": {
"langgraph-docs-mcp": {
"command": "uvx",
"args": [
"--python",
"/path/to/python",
"--from",
"mcpdoc",
"mcpdoc",
"--json",
"sample_config.json"
]
}
}
}
Note
Currently (3/21/25) it appears that Claude Desktop does not support rules for global rules, so append the following to your prompt.
<rules>
for ANY question about LangGraph, use the langgraph-docs-mcp server to help answer --
- call the fetch_docs_LangGraph tool to get the available llms.txt file
- reflect on the urls in llms.txt
- reflect on the input question
- call fetch_docs_LangGraph or fetch_docs_LangChain 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.
- 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", "mcpdoc", "mcpdoc", "--json", "sample_config.json"]}' -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 rules for global rules, so append the following to your prompt.
<rules>
for ANY question about LangGraph, use the langgraph-docs-mcp server to help answer --
- call the fetch_docs_LangGraph tool to get the available llms.txt file
- reflect on the urls in llms.txt
- reflect on the input question
- call fetch_docs_LangGraph or fetch_docs_LangChain on any urls relevant to the question
</rules>
Then, try the example prompt:
- It will ask to approve tool calls.
The mcpdoc












