A lightweight, docs-only MCP server that exposes XMTP documentation as searchable tools for MCP-compatible clients like Claude Code.
This project is intended as an internal beta. It provides structured, queryable access to XMTP docs for LLM-assisted development workflows.
-
Add the MCP server to Claude Code using
npx:claude mcp add --transport stdio xmtp-docs -- npx -y github:xmtp/xmtp-docs-mcp
-
Start Claude Code:
claude
-
Inside Claude Code, run:
/mcp
You should see the xmtp-docs server and its tool endpoints listed.
-
In the root of your project repo where you want to use the XMTP docs MCP (e.g., my-chat-app repo), create a file at:
mkdir -p .cursor touch .cursor/mcp.json
-
Add this configuration to .cursor/mcp.json:
{
"mcpServers": {
"xmtp-docs": {
"command": "npx",
"args": ["-y", "github:xmtp/xmtp-docs-mcp"]
}
}
}Tip
If Cursor doesn’t recognize mcpServers in your version, try mcp_servers as the top-level key instead.
-
Restart Cursor.
-
Select a Claude-based agent (such as Sonnet) for reliable MCP-backed answers. Some agents may not invoke MCP tools.
By default, the server loads the full XMTP LLM docs bundle covering how to build chat apps and agents: https://raw.githubusercontent.com/xmtp/docs-xmtp-org/main/llms/llms-full.txt
You can override this with environment variables:
XMTP_DOC_URL: Load docs from a custom URLXMTP_DOC_PATH: Load docs from a local file
These values are set as environment variables in the MCP configuration (for example, in .mcp.json when using Claude Code).
- For chat app-specific docs, you can use https://raw.githubusercontent.com/xmtp/docs-xmtp-org/main/llms/llms-chat-apps.txt
- For agent-specific docs, you can use https://raw.githubusercontent.com/xmtp/docs-xmtp-org/main/llms/llms-agents.txt
This server is designed as a template for technical documentation teams that want to provide MCP servers for their own documentation. If you maintain technical docs and want to make them queryable by LLM clients, you can fork this repo and point it at your own documentation.
A docs bundle in plain text or markdown format (like llms-full.txt).
- Should be structured with markdown headings (
#,##,###) for best chunking - Can be hosted on GitHub, your docs site, or served locally
- See XMTP's generate_llms_full.py for an example script that generates a docs bundle from a docs site
-
Fork this repository to
your-org/your-docs-mcp -
Update
package.json:{ "name": "your-docs-mcp", "description": "Docs-only MCP server for YourProduct documentation" } -
Update the default URL in
src/index.ts:const DEFAULT_DOC_URL = "https://your-domain.com/path/to/your-docs.txt";
-
Update
src/index.tsto customize the server name:const server = new McpServer({ name: "your-docs-mcp", version: "1.0.0", });
-
Build:
npm install npm run build
-
Publish to your repo
This MCP server is a lightweight, single-file implementation built on the official Model Context Protocol SDK. Here's how the key components work together.
- Built on
@modelcontextprotocol/sdk— the official MCP SDK from Anthropic - Uses
StdioServerTransportfor communication via standard input/output, making it compatible with any MCP client - Registered as a CLI tool via
binin package.json, enablingnpxexecution
- Uses Zod for runtime validation of tool parameters
- Type-safe schemas ensure correct inputs for both
search_xmtp_docsandget_xmtp_doc_chunktools
- Fetches XMTP docs from a remote URL (default:
llms-full.txtfrom docs-xmtp-org) - Supports local file override via
XMTP_DOC_PATHenvironment variable - Loads documentation once at startup and keeps it in memory
- Splits documentation text into searchable chunks based on markdown headings (
#,##,###, etc.) - Each chunk gets a unique numeric ID and retains its section title
- Simple, deterministic algorithm that preserves document structure
- Keyword-based scoring that counts query occurrences in chunk title + text
- Supports both full query phrases and individual tokens
- Returns top N results sorted by relevance score
The server exposes two MCP tools that LLM clients can invoke:
search_xmtp_docs— Returns ranked search results with previewsget_xmtp_doc_chunk— Fetches full content of a specific chunk by ID
Both tools use Zod schemas for parameter validation and return JSON-formatted responses.
This is only needed if you’re working on the MCP server itself. End users should use the Quickstart setup instead.
npm install
npm run build
npm run devThe server will start and wait for stdio input (this is expected).