@mcpframework/docs Overview
A companion package that lets API providers spin up an MCP documentation server from their existing documentation site
@mcpframework/docs Overview
@mcpframework/docs is a companion package that lets API providers spin up an MCP documentation server from their existing documentation site. Developers connect from Claude Code, Cursor, or any MCP client and get tools to search, browse, and retrieve documentation -- enabling AI agents to write correct integration code on the first try.
How It Works
The package provides:
- Source Adapters -- connect to your documentation backend (Fumadocs, any site with
llms.txt) - MCP Tools --
search_docs,get_page,list_sectionsthat AI agents can call - DocsServer -- a convenience wrapper that wires everything together
- CLI Scaffolder --
npx create-docs-mcp my-api-docsto generate a project in seconds
Your Docs Site MCP Client (Claude Code, Cursor, etc.)
+----------------+ +------------------------------+
| llms.txt |<----fetch------| |
| /api/search | | search_docs("auth") |
| pages.mdx | DocsServer | get_page("getting-started")|
+----------------+ +----------+ | list_sections() |
| Source | | |
| Adapter |<-+ AI Agent writes integration |
| + Cache | | code using your docs |
+----------+ +------------------------------+Quick Start
import { DocsServer, FumadocsRemoteSource } from "@mcpframework/docs";
const source = new FumadocsRemoteSource({
baseUrl: "https://docs.myapi.com",
});
const server = new DocsServer({
source,
name: "my-api-docs",
version: "1.0.0",
});
server.start();Or scaffold a complete project:
npx create-docs-mcp my-api-docs
cd my-api-docs
cp .env.example .env
# Edit .env with your docs site URL
npm run build && npm startRelationship to mcp-framework
@mcpframework/docs is a consumer of mcp-framework, not a fork. It imports MCPTool from mcp-framework and composes pre-built documentation tools on top of it. This keeps the core framework general-purpose while giving docs-server users a turnkey experience.
mcp-framework (peer dependency)
+-- @mcpframework/docs
+-- DocSource interface
+-- Pre-built tools (SearchDocs, GetPage, ListSections)
+-- DocsServer convenience class
+-- CLI templatePrerequisites
Your documentation site must serve at least one of:
/llms.txt-- a structured index of your documentation (required)/llms-full.txt-- full content of all documentation pages (required for search)/api/search-- Fumadocs Orama search endpoint (optional, for higher-quality search)
See Fumadocs Setup for instructions on enabling these endpoints.
Pre-built: mcp-framework Docs Server
We use @mcpframework/docs ourselves! The mcp-framework documentation is available as a ready-to-use MCP server -- no setup required:
claude mcp add mcp-framework-docs -- npx -y @mcpframework/mcp-framework-docsSee mcp-framework Docs Server for full details.
Next Steps
- mcp-framework Docs Server -- Use the pre-built server for mcp-framework docs
- Sources -- Learn about source adapters
- Tools -- Available MCP tools and their parameters
- Server Configuration -- DocsServer options
- Caching -- Cache configuration and custom implementations
- CLI -- Project scaffolding
- Custom Adapters -- Build your own source adapter
- Fumadocs Setup -- Configure your Fumadocs site