Skip to main content

mkdocs-ask-ai

PyPI version Python versions Downloads License: MIT MkDocs Material MCP llms.txt

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.

mkdocs-ask-ai — "Use with AI" dropdown on a documentation page


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 .md source 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 sources
  • llms-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 SSE or 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.txt and llms-full.txt
  • Markdown files at locale-prefixed URLs
  • MCP server tools with locale parameter
  • docs-index.json with all locales merged

Comparison

Feature mkdocs-ask-ai mkdocs-llmstxt mkdocs-mcp
"Use with AI" menu :white_check_mark: :x: :x:
llms.txt / llms-full.txt :white_check_mark: :white_check_mark: :x:
MCP server :white_check_mark: :x: :white_check_mark:
Raw .md URLs :white_check_mark: :x: :x:
i18n support :white_check_mark: :x: :x:
Open in ChatGPT / Claude :white_check_mark: :x: :x:
One plugin for everything :white_check_mark: :x: :x:

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.txt and llms-full.txt at the site root
  • .md URLs 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                  # Enable MCP server + docs-index.json
      mcp_path: "/mcp"                  # URL path for streamable HTTP
      mcp_port: 8808                    # Port for MCP HTTP server

When enable_mcp is set and you run mkdocs serve, the MCP server starts automatically alongside the dev server at http://127.0.0.1:8808/mcp.

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 mkdocs serve (recommended for development)

When enable_mcp: true is set, running mkdocs serve automatically starts the MCP server on port 8808. Add this to your .mcp.json or Claude Desktop config:

{
  "mcpServers": {
    "my-docs": {
      "type": "sse",
      "url": "http://127.0.0.1:8808/sse"
    }
  }
}

With Claude Desktop / Cursor (stdio)

For stdio transport, build your site first and point to the output directory. Requires mkdocs-ask-ai to be installed in the environment (pip install mkdocs-ask-ai[mcp]):

{
  "mcpServers": {
    "my-docs": {
      "command": "mkdocs-ask-ai",
      "args": ["mcp", "--site-dir", "./public"]
    }
  }
}

If mkdocs-ask-ai is installed in a virtualenv, use the full path to the binary (e.g. /path/to/.venv/bin/mkdocs-ask-ai).

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,sse} Transport type (default: stdio)
  --port PORT                  HTTP/SSE port (default: 8808)
  --host HOST                  HTTP/SSE host (default: 127.0.0.1)

Hosting Considerations

Deployment MCP support
mkdocs serve Automatic — MCP starts alongside dev server
Self-hosted (Docker/VM) Run mkdocs-ask-ai mcp as a sidecar service
Static hosting (GitHub Pages, GitLab Pages, Netlify) Not supported — MCP requires a running process

For static hosting, the llms.txt, markdown URLs, and "Use with AI" dropdown work out of the box. Only the MCP server requires a running process.

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.

Originally inspired by mkdocs-llmstxt-md by Nok Lam Chan.

Metadata

Release files for mkdocs-ask-ai 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkdocs-ask-ai 1.1.3
File Size Uploaded
mkdocs_ask_ai-1.1.3.tar.gz 22.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mkdocs-ask-ai 1.1.3
File Interpreter ABI Platform
mkdocs_ask_ai-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 42.5 kB

Release files / mkdocs_ask_ai-1.1.3.tar.gz

Download URL mkdocs_ask_ai-1.1.3.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
939a66a90730f51361e1a6bbb61d090a2da113b07cf0b80fbe1de5b8558978ad
BLAKE2b-256 checksum
How to use checksums
39e673c1df105e2d1433041819c602283838d699268bbd85012023ccc96e7fdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

Release files / mkdocs_ask_ai-1.1.3-py3-none-any.whl

Download URL mkdocs_ask_ai-1.1.3-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fca86faa7f6ae579b2ee9381487078f52cf297902e9c48380b8d722f25600039
BLAKE2b-256 checksum
How to use checksums
85ededf84b818ac067007a5975b6a6a41dd1e7313b84c6f290e73f02d842ec40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page