sphinx-autodoc-fastmcp

Alpha GitHub PyPI

Sphinx extension for documenting FastMCP tools: card-style desc layouts (aligned with sphinx-autodoc-api-style), safety badges, parameter tables, and cross-reference roles (:tool:, :toolref:, :badge:, etc.).

$ pip install sphinx-autodoc-fastmcp

Features

  • Tool cards: mcp / tool domain desc nodes with toolbar badges

  • Collectors: register(mcp)-style modules or introspect mode for @mcp.tool

  • Configuration: module list, area map, model classes for type cross-refs

  • MyST directives: fastmcp-tool, fastmcp-tool-input, fastmcp-toolsummary

Package reference

Copyable config snippet

extensions = [
    "sphinx_autodoc_fastmcp",
]

Package metadata

Registered Surface

sphinx_autodoc_fastmcp

Config values

Name

Default

Rebuild

Types

fastmcp_tool_modules

[]

env

list

fastmcp_area_map

{}

env

dict

fastmcp_model_module

''

env

str

fastmcp_model_classes

()

env

tuple

fastmcp_section_badge_map

{}

env

dict

fastmcp_section_badge_pages

()

env

tuple

fastmcp_collector_mode

'register'

env

str

Directives

Name

Kind

Callable

Summary

fastmcp-tool

directive

FastMCPToolDirective

Autodocument one MCP tool: section (ToC/labels) + card body.

fastmcp-tool-input

directive

FastMCPToolInputDirective

Emit the parameter table for a tool.

fastmcp-toolsummary

directive

FastMCPToolSummaryDirective

Summary tables of tools grouped by safety tier.

Roles

Name

Kind

Callable

Summary

tool

role

_tool_role

Role ``:tool:`name``` → link + badge (resolved later).

toolref

role

_toolref_role

Role ``:toolref:`name``` → link without badge.

toolicon

role

role_fn

tooliconl

role

role_fn

tooliconr

role

role_fn

tooliconil

role

role_fn

tooliconir

role

role_fn

badge

role

badge_role

Role ``:badge:`readonly``` → safety badge.