Home / MCP / MkDocs MCP Search Server
Provides local search over MkDocs sites using Lunr.js for LLM-enabled exploration and retrieval.
Configuration
View docs{
"mcpServers": {
"mkdocs_mcp": {
"command": "npx",
"args": [
"-y",
"@serverless-dna/mkdocs-mcp",
"https://your-doc-site",
"Describe what you are enabling search for to help your AI Agent"
]
}
}
}You can run a dedicated MCP server that lets large language models search through your MkDocs-powered site using a Lunr.js index. This server returns structured, searchable results and can fetch and convert documentation pages into Markdown for easy presentation to users.
You use an MCP client to start and interact with the MkDocs MCP server. Start the server with your MkDocs site URL, then issue search requests to retrieve relevant pages, with optional versioning for multi-version docs. The server returns results with titles, URLs, previews, and context to help you present documentation summaries to end users.
To begin, install the project dependencies, build, and run the MCP server. The server runs as an MCP server over standard I/O, so you can connect it directly to your LLM workflow.
Prerequisites: you need Node and a package manager. You will also need an internet connection to install dependencies and fetch your MkDocs site.
pnpm install
```
```bash
pnpm buildThe server supports runtime configuration via environment variables. Key options include the maximum number of results and the minimum confidence score required for a result. You can also customize where the server caches data.
You can start the server for a given MkDocs site using an explicit command, which runs the MCP server as a local process that communicates over standard input/output.
The following configuration example shows how you enable search for a MkDocs site from a client.
{
"mcpServers": {
"my-docs": {
"command": "npx",
"args": [
"-y",
"@serverless-dna/mkdocs-mcp",
"https://your-doc-site",
"Describe what you are enabling search for to help your AI Agent"
]
}
}
}The server uses lunr.js to index content locally, supports versioned documentation searches, converts MkDocs Material HTML to Markdown, and preserves diagrams and code examples. It also resolves relative URLs to absolute ones and caches results for faster subsequent requests.
Search tool that queries the MkDocs site index and returns results with titles, URLs, previews, and optional parent article context. Supports optional versioning to target specific site versions.
Fetch documentation pages by URL and convert MkDocs Material HTML into structured JSON with Markdown content and extracted code examples.