API Reference

Config reference

Generated from app.add_config_value() registrations in sphinx_autodoc_fastmcp/__init__.py.

fastmcp_tool_modules
config env
config env
fastmcp_tool_modules

Dotted module paths whose register(server) hooks expose FastMCP tools to autodoc. Each module is imported once at builder-inited and its tools are added to the rendered reference.

Type:

list

Default:

[]

Registered by:

sphinx_autodoc_fastmcp.setup()

fastmcp_area_map
config env
config env
fastmcp_area_map

Mapping of tool-module suffix (e.g. "session_tools") to the docs area page that owns its tools (e.g. "sessions"). Drives cross-reference resolution and the area badge in card layouts.

Type:

dict

Default:

{}

Registered by:

sphinx_autodoc_fastmcp.setup()

fastmcp_model_module
config env
config env
fastmcp_model_module

Dotted module containing the Pydantic model classes referenced by tool return types. Used to resolve {fastmcp-model} cross-references.

Type:

str

Default:

''

Registered by:

sphinx_autodoc_fastmcp.setup()

fastmcp_model_classes
config env
config env
fastmcp_model_classes

Iterable of model class names within fastmcp_model_module to autodoc. Empty default skips model rendering entirely.

Type:

tuple

Default:

()

Registered by:

sphinx_autodoc_fastmcp.setup()

fastmcp_section_badge_map
config env
config env
fastmcp_section_badge_map

Mapping of docstring section heading (e.g. "Inspect") to the safety badge it should render with (e.g. "readonly", "mutating", "destructive"). Drives the inline section pills next to grouped tool lists.

Type:

dict

Default:

{}

Registered by:

sphinx_autodoc_fastmcp.setup()

fastmcp_section_badge_pages
config env
config env
fastmcp_section_badge_pages

Iterable of docnames where fastmcp_section_badge_map should be applied. Pages outside this list render plain section headings.

Type:

tuple

Default:

()

Registered by:

sphinx_autodoc_fastmcp.setup()

fastmcp_collector_mode
config env
config env
fastmcp_collector_mode

How tools are gathered from each fastmcp_tool_modules entry. "register" calls the module’s register(server) hook (the FastMCP convention); "introspect" walks module attributes for @server.tool-decorated callables.

Type:

str

Default:

'register'

Registered by:

sphinx_autodoc_fastmcp.setup()

fastmcp_server_module
config env
config env
fastmcp_server_module

"pkg.module:attribute" path to a live FastMCP instance. When set, the prompt / resource collector reads local_provider._components directly so docs enumerate the same surface as the running server.

Type:

str

Default:

''

Registered by:

sphinx_autodoc_fastmcp.setup()

Directive and role reference

Generated from app.add_directive() and app.add_role() registrations in sphinx_autodoc_fastmcp/__init__.py via sphinx-autodoc-docutils.

.. fastmcp-tool::
directive
directive
.. fastmcp-tool::

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

Options:

Python path:

sphinx_autodoc_fastmcp._directives.FastMCPToolDirective

Required arguments:

1

Optional arguments:

0

Final argument whitespace:

False

Has content:

True

:no-index:
option
option
:no-index:

Validator: flag.

.. fastmcp-tool-input::
directive
directive
.. fastmcp-tool-input::

Emit the parameter table for a tool.

Python path:

sphinx_autodoc_fastmcp._directives.FastMCPToolInputDirective

Required arguments:

1

Optional arguments:

0

Final argument whitespace:

False

Has content:

False

.. fastmcp-tool-summary::
directive
directive
.. fastmcp-tool-summary::

Summary tables of tools grouped by safety tier.

Python path:

sphinx_autodoc_fastmcp._directives.FastMCPToolSummaryDirective

Required arguments:

0

Optional arguments:

0

Final argument whitespace:

False

Has content:

False

.. fastmcp-prompt::
directive
directive
.. fastmcp-prompt::

Autodocument one MCP prompt: section + card body.

Python path:

sphinx_autodoc_fastmcp._directives.FastMCPPromptDirective

Required arguments:

1

Optional arguments:

0

Final argument whitespace:

False

Has content:

True

.. fastmcp-prompt-input::
directive
directive
.. fastmcp-prompt-input::

Emit the argument table for a prompt.

Python path:

sphinx_autodoc_fastmcp._directives.FastMCPPromptInputDirective

Required arguments:

1

Optional arguments:

0

Final argument whitespace:

False

Has content:

False

.. fastmcp-resource::
directive
directive
.. fastmcp-resource::

Autodocument one MCP resource (fixed URI).

Python path:

sphinx_autodoc_fastmcp._directives.FastMCPResourceDirective

Required arguments:

1

Optional arguments:

0

Final argument whitespace:

False

Has content:

True

.. fastmcp-resource-template::
directive
directive
.. fastmcp-resource-template::

Autodocument one MCP resource template (parameterised URI).

Python path:

sphinx_autodoc_fastmcp._directives.FastMCPResourceTemplateDirective

Required arguments:

1

Optional arguments:

0

Final argument whitespace:

False

Has content:

True

:tool:
role
role
:tool:

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

Python path:

sphinx_autodoc_fastmcp._roles._tool_role

class:

class_option

:toolref:
role
role
:toolref:

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

Python path:

sphinx_autodoc_fastmcp._roles._toolref_role

class:

class_option

:toolicon:
role
role
:toolicon:

Autodocumented role callable.

Python path:

sphinx_autodoc_fastmcp._roles.role_fn

class:

class_option

:tooliconl:
role
role
:tooliconl:

Autodocumented role callable.

Python path:

sphinx_autodoc_fastmcp._roles.role_fn

class:

class_option

:tooliconr:
role
role
:tooliconr:

Autodocumented role callable.

Python path:

sphinx_autodoc_fastmcp._roles.role_fn

class:

class_option

:tooliconil:
role
role
:tooliconil:

Autodocumented role callable.

Python path:

sphinx_autodoc_fastmcp._roles.role_fn

class:

class_option

:tooliconir:
role
role
:tooliconir:

Autodocumented role callable.

Python path:

sphinx_autodoc_fastmcp._roles.role_fn

class:

class_option

:badge:
role
role
:badge:

Role :badge:`readonly` → safety badge.

Python path:

sphinx_autodoc_fastmcp._transforms.badge_role

class:

class_option