MCP LLMS-TXT Documentation Server

Official

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Integrates with Windsurf (by Codeium) to provide document context retrieval through the llms.txt protocol.

  • Provides access to LangGraph documentation through its llms.txt file, enabling contextual information retrieval for development tasks.

MCP LLMS-TXT Documentation Server

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.

Quickstart

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.txt file.

(Optional) Test the MCP server locally with your llms.txt file of choice:

uvx --from mcpdoc mcpdoc \ --urls LangGraph:https://langchain-ai.github.io/langgraph/llms.txt \ --transport sse \ --port 8082 \ --host localhost

npx @modelcontextprotocol/inspector

  • Here, you can test the tool calls.

Connect to Cursor

  • Open Cursor Settings and MCP tab.
  • This will open the ~/.cursor/mcp.json file.

  • Paste the following into the file (we use the langgraph-docs-mcp name and link to the LangGraph llms.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" ] } } }
  • Confirm that the server is running in your Cursor Settings/MCP tab.
  • Best practice is to then update Cursor Global (User) rules.
  • Open Cursor Settings/Rules and update User Rules with 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 agent is 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 MCP to open the config file, ~/.codeium/windsurf/mcp_config.json.
  • Update with langgraph-docs-mcp as noted above.

  • Update Windsurf Rules/Global rules with 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/Developer to update ~/Library/Application\ Support/Claude/claude_desktop_config.json.
  • Update with langgraph-docs-mcp as noted above.
  • Restart Claude Desktop app.

Note: currently (3/21/25) it appears that Claude Code does not support rules for 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", "mcpdoc", "mcpdoc", "--urls", "langgraph:https://langchain-ai.github.io/langgraph/llms.txt"]}' -s local
  • You will see ~/.claude.json updated.
  • 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 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:

  1. Using a YAML config file:
  • This will load the LangGraph Python documentation from the sample_config.yaml file in this repo.
mcpdoc --yaml sample_config.yaml
  1. Using a JSON config file:
  • This will load the LangGraph Python documentation from the sample_config.json file in this repo.
mcpdoc --json sample_config.json
  1. 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.
  • This is how we loaded llms.txt for the MCP server above.
mcpdoc --urls LangGraph:https://langchain-ai.github.io/langgraph/llms.txt

You can also combine these methods to merge documentation sources:

mcpdoc --yaml sample_config.yaml --json sample_config.json --urls https://langchain-ai.github.io/langgraph/llms.txt

Additional Options

  • --follow-redirects: Follow HTTP redirects (defaults to False)
  • --timeout SECONDS: HTTP request timeout in seconds (defaults to 10.0)

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.

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 server.run(transport="stdio")
-
security - not tested
A
license - permissive license
-
quality - not tested

An 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. Overview
    1. Quickstart
      1. Install uv
      2. Choose an llms.txt file to use.
      3. (Optional) Test the MCP server locally with your llms.txt file of choice:
      4. Connect to Cursor
      5. Connect to Windsurf
      6. Connect to Claude Desktop
      7. Connect to Claude Code
    2. Command-line Interface
      1. Additional Options
        1. Configuration Format
          1. YAML Configuration Example (sample_config.yaml)
          2. JSON Configuration Example (sample_config.json)
        2. Programmatic Usage