MkDocs plugin for LLM-friendly documentation with direct markdown serving and i18n support
Project description
mkdocs-ask-ai
Make your MkDocs documentation AI-ready. One plugin gives your site everything AI tools need to work with your docs — a "Use with AI" menu for visitors, llms.txt for crawlers, an MCP server for agents, and raw markdown URLs for everything else.
Works with Material for MkDocs and mkdocs-static-i18n out of the box.
Features
"Use with AI" Dropdown
A floating button on every page with:
- Copy page as Markdown — one-click clipboard copy for any AI tool
- View as Markdown — opens the clean
.mdsource in a new tab - Open in ChatGPT — sends page content directly to ChatGPT via
?q=parameter - Open in Claude — sends page content directly to Claude via
?q=parameter - llms.txt — link to the full documentation index
Adapts to light and dark themes automatically. Inspired by 1Password's developer docs.
llms.txt + llms-full.txt
Follows the llms.txt standard to make your documentation discoverable by AI systems:
llms.txt— structured index with sections, titles, and links to markdown sourcesllms-full.txt— complete documentation in a single file for full-context queries
Direct Markdown Serving
Every page is accessible as clean markdown at its .md URL. No HTML parsing needed — AI tools get exactly what they need.
https://your-site.com/getting-started/index.md
MCP Server
Expose your documentation as an MCP server so AI agents can query it programmatically.
Tools:
| Tool | Description |
|---|---|
list_pages(locale?) |
Discover available pages grouped by section |
get_page(path, locale?) |
Fetch a specific page as markdown |
search_docs(query, locale?) |
Full-text search with snippets |
get_full_docs(locale?) |
Get the entire documentation as one text |
Transports:
| Use case | Transport | Example |
|---|---|---|
| Local / private | stdio | Add to Claude Desktop, Cursor, Windsurf |
| Public website | Streamable HTTP | https://your-site.com/mcp |
Every page is also registered as an MCP resource (docs://site-name/path/to/page.md).
i18n Support
Full support for multilingual sites via mkdocs-static-i18n. Each locale gets its own:
llms.txtandllms-full.txt- Markdown files at locale-prefixed URLs
- MCP server tools with
localeparameter docs-index.jsonwith all locales merged
Installation
pip install mkdocs-ask-ai
With MCP server support:
pip install mkdocs-ask-ai[mcp]
Quick Start
Add to your mkdocs.yml:
plugins:
- ask-ai:
sections:
"Getting Started":
- index.md: "Introduction"
- quickstart.md: "Quick start guide"
"API Reference":
- api/*.md
That's it. Your site now has:
llms.txtandllms-full.txtat the site root.mdURLs for every page- "Use with AI" dropdown on every page
Configuration
Basic Options
plugins:
- ask-ai:
sections: {} # Section names mapped to file patterns (glob supported)
markdown_description: "" # Description included in llms.txt header
enable_ai_menu: true # Show "Use with AI" dropdown
ai_menu_button_text: "Use with AI"
enable_chatgpt: true # Show "Open in ChatGPT" item
enable_claude: true # Show "Open in Claude" item
enable_markdown_urls: true # Serve .md files alongside HTML
enable_llms_txt: true # Generate llms.txt
enable_llms_full: true # Generate llms-full.txt
MCP Server Options
plugins:
- ask-ai:
enable_mcp: true # Generate docs-index.json for MCP
mcp_transport: "stdio" # "stdio" or "streamable-http"
mcp_path: "/mcp" # URL path for streamable HTTP
mcp_port: 8808 # Port for standalone HTTP server
Section Patterns
Sections support explicit paths, descriptions, and glob patterns:
sections:
"Infrastructure":
- infrastructure/index.md: "Infrastructure overview"
- infrastructure/proxmox.md: "Proxmox hypervisor"
- infrastructure/*.md # glob — include all .md files
"API":
- api/*.md
Using the MCP Server
With Claude Desktop / Cursor
Build your site first, then add to your MCP config:
{
"mcpServers": {
"my-docs": {
"command": "mkdocs-ask-ai",
"args": ["mcp", "--site-dir", "/path/to/public"]
}
}
}
Standalone HTTP Server
mkdocs-ask-ai mcp --transport http --port 8808 --site-dir ./public
CLI Reference
mkdocs-ask-ai mcp [OPTIONS]
Options:
--site-dir PATH Built site directory (default: ./public)
--transport {stdio,http} Transport type (default: stdio)
--port PORT HTTP port (default: 8808)
--host HOST HTTP host (default: 127.0.0.1)
With mkdocs-static-i18n
Place ask-ai before i18n in the plugins list:
plugins:
- ask-ai:
sections:
"Docs":
- "*.md"
- i18n:
docs_structure: suffix
languages:
- locale: en
default: true
name: English
- locale: ru
name: Russian
Output per locale:
public/
llms.txt # English
llms-full.txt
docs-index.json # merged index (all locales)
ru/
llms.txt # Russian
llms-full.txt
License
MIT — see LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs_ask_ai-1.1.1.tar.gz.
File metadata
- Download URL: mkdocs_ask_ai-1.1.1.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43432e077a7a4b40140aa1b543897dd995b9495c599f521ebe90fdc1fd9df80f
|
|
| MD5 |
ba04c7392df99ecfcf5b208ee0517d56
|
|
| BLAKE2b-256 |
6f143dbee3473cae48fb7ec20cd989950568b0f47d9cce1cea33a1ea37f716b5
|
Provenance
The following attestation bundles were made for mkdocs_ask_ai-1.1.1.tar.gz:
Publisher:
release.yml on mrkhachaturov/mkdocs-ask-ai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_ask_ai-1.1.1.tar.gz -
Subject digest:
43432e077a7a4b40140aa1b543897dd995b9495c599f521ebe90fdc1fd9df80f - Sigstore transparency entry: 1102379469
- Sigstore integration time:
-
Permalink:
mrkhachaturov/mkdocs-ask-ai@33b81f15b120bfc8015b561ddecdef7e2aa82f4d -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/mrkhachaturov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@33b81f15b120bfc8015b561ddecdef7e2aa82f4d -
Trigger Event:
push
-
Statement type:
File details
Details for the file mkdocs_ask_ai-1.1.1-py3-none-any.whl.
File metadata
- Download URL: mkdocs_ask_ai-1.1.1-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c605c7b0f7071b44381181d335e432f936d2790fe38f524dd65c10831db9b08
|
|
| MD5 |
8191a6dbdb10039ebca206f8683a8995
|
|
| BLAKE2b-256 |
69c29480d6407009f292a83a0137e6560c396956363b9b00b03964d241d3ffc3
|
Provenance
The following attestation bundles were made for mkdocs_ask_ai-1.1.1-py3-none-any.whl:
Publisher:
release.yml on mrkhachaturov/mkdocs-ask-ai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_ask_ai-1.1.1-py3-none-any.whl -
Subject digest:
5c605c7b0f7071b44381181d335e432f936d2790fe38f524dd65c10831db9b08 - Sigstore transparency entry: 1102379530
- Sigstore integration time:
-
Permalink:
mrkhachaturov/mkdocs-ask-ai@33b81f15b120bfc8015b561ddecdef7e2aa82f4d -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/mrkhachaturov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@33b81f15b120bfc8015b561ddecdef7e2aa82f4d -
Trigger Event:
push
-
Statement type: