mkdocstrings
Automatic documentation from sources, for MkDocs.
What it is and what it does
This plugin for MkDocs extracts docstrings from source code and injects them into your documentation as formatted API reference sections. Instead of manually writing API docs, you add simple directives to your Markdown files, and the plugin parses the source, renders the docstrings, and handles cross-references automatically. It's language-agnostic through a handler system—the base package provides the framework, and separate handlers add support for different languages.
The plugin integrates with MkDocs and its theming system, with support for multiple themes. It supports cross-references both within your documentation and to external project inventories. Configuration is flexible—you can set defaults globally in mkdocs.yml and override them per-directive with YAML blocks.
Use it for:
- Generate API reference docs automatically from docstrings in a project without manual documentation maintenance
- Build multi-language API documentation for a library that exposes bindings in multiple languages
- Create cross-referenced API docs where docstring links resolve automatically across multiple pages
- Maintain up-to-date API documentation that stays in sync with source code changes
- Reference external library APIs in your docs by loading their inventory files
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
An MkDocs plugin that automatically generates API documentation from source code docstrings, supporting multiple programming languages through pluggable handlers.
Yes. The plugin is actively maintained, has no known vulnerabilities, uses a permissive license, and integrates cleanly into MkDocs workflows with low install friction. It's production-ready and widely adopted. Install it if you use MkDocs and want to automate API documentation from source code; you'll also need to install a language handler for your target language.
Install
mkdocstrings on PyPI
pip
pip install mkdocstringsuv
uv add mkdocstringspoetry
poetry add mkdocstringsInstalling mkdocstrings
Before you install
Low friction install with a wheel distribution. Active maintenance with a recent release 34 days ago and 2082 repository stars. Requires Python 3.10 or later and depends on six runtime packages including mkdocs, Markdown, and Jinja2.
License in practice
ISC license is permissive, allowing commercial and private use with minimal restrictions—suitable for most projects without legal concern.
Quickstart
pip install mkdocstrings
# In mkdocs.yml:
plugins:
- mkdocstrings
# In your markdown file:
::: my_module.MyClass
Requires Python 3.10 or later. Language handlers must be installed separately to generate docs for specific languages.
Verify before relying
- Whether language handlers are bundled or must be installed separately for each language
- Performance characteristics when documenting large codebases
- Customization depth available for generated documentation styling beyond Material theme support
Package facts
| License | ISC (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — Jinja2, Markdown, MarkupSafe, mkdocs, mkdocs-autorefs, pymdown-extensions |
| Maintenance | actively maintained — 34 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,397,112/month — #1,627 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mkdocstrings-1.0.6-py3-none-any.whl
Keywords: mkdocs, mkdocs-plugin, docstrings, autodoc, documentation
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
mkdocs-api-autonavAutomatically generates API reference…
permissive · top 15,000 on PyPI
mkdocs-clickGenerates API documentation for Click…
permissive · top 5,000 on PyPI
mkdocstrings-pythonGenerates API documentation for Python projects…
permissive · top 5,000 on PyPI
mkdocstrings-python-legacyA legacy Python documentation handler for…
permissive · top 15,000 on PyPI
mkdocs-static-i18nA MkDocs plugin that adds static multi-language…
permissive · top 15,000 on PyPI
mkdocs-autorefsA MkDocs plugin that automatically creates…
permissive · top 5,000 on PyPI
mkdocs-llmstxtMkDocs plugin that generates an /llms.txt file…
permissive · top 15,000 on PyPI
mkdocs-task-collectorA MkDocs plugin that scans Markdown files for…
permissive · top 15,000 on PyPI
mdformat-mkdocsAn mdformat plugin that formats Markdown for…
permissive · top 15,000 on PyPI
mkdocs-techdocs-coreBundles Spotify's TechDocs defaults—themes,…
permissive · top 15,000 on PyPI