Learn how to use the MkDocs MCP Server with practical examples.
Ask your AI:
Create a new page at docs/api/authentication.md explaining JWT authentication. Add frontmatter with title and tags.
What happens:
create_doc toolResult:
---
title: Authentication
tags: [api, security]
---
# Authentication
This API uses JWT (JSON Web Tokens) for authentication...
Ask your AI:
Search my docs for mentions of “Python 3.7” and update them to “Python 3.8”
What happens:
search_docs with query “Python 3.7”read_doc to read each fileupdate_doc to update contentAsk your AI:
Show me the current navigation, then add a new “Tutorials” section with these pages:
- tutorials/basic.md
- tutorials/advanced.md
What happens:
get_navigation to see current structureupdate_navigation to save changesmkdocs.ymlResult in mkdocs.yml:
nav:
- Home: index.md
- Getting Started: getting-started/index.md
- Tutorials:
- Basic Tutorial: tutorials/basic.md
- Advanced Tutorial: tutorials/advanced.md
- API Reference: api/index.md
Ask your AI:
Create a complete API documentation structure:
- api/index.md (overview)
- api/authentication.md
- api/users.md
- api/posts.md
- api/comments.md
What happens:
create_doc multiple timesAsk your AI:
Search for all links to “/old-api/” in my documentation
What happens:
search_docs with regex patternSample output:
{
"total_files": 3,
"results": [
{
"file": "getting-started/quick-start.md",
"match_count": 1,
"matches": [
{
"line": 45,
"content": "See [Old API](/old-api/) for legacy endpoints"
}
]
}
]
}
Ask your AI:
List all files in the deprecated/ folder, then delete them and remove the Deprecated section from navigation
What happens:
list_docs with pattern “deprecated/*/.md”delete_doc for each fileget_navigation and update_navigation to clean up navAsk your AI:
Add frontmatter to all files in the api/ folder with:
- type: api-reference
- version: 2.0
What happens:
list_docs with pattern “api/*/.md”read_doc to get contentupdate_doc to add/update frontmatterAsk your AI:
Check if all pages in the navigation actually exist as files
What happens:
get_navigation to get nav structurelist_docs to get existing filesAsk your AI:
Help me create a new feature documentation section:
- Create feature/index.md as an overview
- Create feature/setup.md with setup instructions
- Create feature/examples.md with code examples
- Add a “Features” section to navigation after “Getting Started”
- Search for any existing mentions of “features” and let me know where they are
What the AI does:
create_docget_navigationupdate_navigationsearch_docs❌ “Update the docs”
✅ “Update getting-started/installation.md to add Docker as a prerequisite”
❌ “List API files”
✅ “List all files matching api/*/.md”
❌ “Fix navigation”
✅ “In navigation, move the API section before Tutorials”
✅ “After creating the files, show me what you created”
✅ “Search for the term to confirm it was updated everywhere”