This is a proof of concept that makes MkDocs documentation sites available as MCP resources. It builds your MkDocs project and exposes each page as a resource that Claude can read. You can configure how resources are named (by source file, destination URL, or page title), choose between serving raw markdown or HTML converted back to markdown, and optionally combine pages by folder or into a single resource. The plugin hooks into MkDocs via a custom script since MkDocs doesn't allow overriding the native serve command. Reach for this when you want Claude to answer questions about documentation you maintain in MkDocs without copying files around manually.
MkDocs Plugin to Serve MCP
A proof-of-concept — feedback welcome!
mkdocs-mcp is an experimental plugin designed to integrate an MCP server into the MkDocs workflow. Due to limitations in MkDocs, the native mkdocs serve command cannot be overridden.
Instead, this project provides the mkdocs_mcp script to handle the build process and launch the MCP server.
This project uses uv for dependency management and virtual environments.
To start the MCP server:
uv run mkdocs-mcp -mt stdio
Use the --mkdocs-project-path option to specify the path to your MkDocs project if it's not in the current directory. The environment variable MKDOCS_PROJECT_PATH can also be set for this purpose.
Make sure to include mcp in your mkdocs.yml plugin list:
plugins:
- mcp:
naming_style: src_file # "src_file"(default), "dst_url" or "title"
prefer_markdown: True # By default the source markdown is used, set to False to convert the output HTML to markdown
combine_all_pages: False # Aggregate all pages into one file
combine_by_folder: False # Aggregate each folder
If you're working with Claude Desktop and WSL, configure your claude_desktop_config.json as follows (adjust paths as needed):
{
"mcpServers": {
"mkdocs": {
"command": "wsl.exe",
"args": [
"bash",
"-c",
"/home/urs/.cargo/bin/uv run --directory /home/urs/projects/mkdocs-mcp mkdocs-mcp -mt stdio"
]
}
}
}
For development and debugging, you can directly inspect the MCP server:
uv run mcp dev src/mkdocs_mcp/__main__.py
Thanks for checking out mkdocs-mcp!
GitHub MCP Registry mcp-name: io.github.ubaumann/mkdocs-mcp
MKDOCS_PROJECT_PATH*Path to the MkDocs project