docs: generate hierarchical per-module API reference pages#2103
Merged
maxisbey merged 1 commit intomodelcontextprotocol:mainfrom Mar 18, 2026
Merged
Conversation
Kludex
previously requested changes
Feb 19, 2026
86ce175 to
3248107
Compare
The API docs previously consisted of a single page (`docs/api.md`) containing only `::: mcp`, which rendered just the top-level `mcp/__init__.py` exports. Most of the public API surface (`MCPServer`, `Context`, `Settings`, `Tool`, `Resource`, `Prompt`, etc.) was missing because those classes live in subpackages not re-exported at the top level. This replaces the single-page approach with auto-generated per-module pages using the standard mkdocstrings recipe: - `mkdocs-gen-files` runs `docs/hooks/gen_ref_pages.py` at build time to create a virtual `.md` stub for every module under `src/mcp/` - `mkdocs-literate-nav` reads the generated `api/SUMMARY.md` to build a hierarchical sidebar navigation tree - Material theme's `navigation.indexes` handles section index pages (the `mkdocs-section-index` plugin is not needed and conflicts with it) Also updates `mkdocstrings` `paths` from `[src/mcp]` to `[src]` so that fully-qualified module identifiers like `mcp.server.mcpserver.server` resolve correctly.
3248107 to
fc69603
Compare
maxisbey
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The API docs previously consisted of a single page (
docs/api.md) containing only::: mcp, which rendered just the top-levelmcp/__init__.pyexports. Most of the public API surface (MCPServer,Context,Settings,Tool,Resource,Prompt, etc.) was missing because those classes live in subpackages not re-exported at the top level.This replaces the single-page approach with auto-generated per-module pages using the standard mkdocstrings recipe:
mkdocs-gen-filesrunsscripts/gen_ref_pages.pyat build time to create a virtual.mdstub for every module undersrc/mcp/mkdocs-literate-navreads the generatedapi/SUMMARY.mdto build a hierarchical sidebar navigation treenavigation.indexeshandles section index pages (themkdocs-section-indexplugin is not needed and conflicts with it)Also updates
mkdocstringspathsfrom[src/mcp]to[src]so that fully-qualified module identifiers likemcp.server.mcpserver.serverresolve correctly.