Skip to content

Commit 740434d

Browse files
mmacyclaude
andauthored
enable API ref left nav autogen (#4)
* Fix griffe warnings in mkdocs documentation generation - Remove **extra parameter documentation that doesn't match function signature in fastmcp/server.py - Fix malformed docstring structure in func_metadata.py by moving content to proper Note section - Correct parameter name mismatch in lowlevel/server.py lifespan function docstring 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * autgenerate API reference nav --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent b444e53 commit 740434d

File tree

8 files changed

+25
-10
lines changed

8 files changed

+25
-10
lines changed

docs/api.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# MCP Server
22

33
This is the MCP Server implementation in Python.
4-
5-
It only contains the [API Reference](api.md) for the time being.

mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ site_url: https://modelcontextprotocol.github.io/python-sdk
1212

1313
nav:
1414
- Home: index.md
15-
- API Reference: api.md
1615

1716
theme:
1817
name: "material"
@@ -118,3 +117,5 @@ plugins:
118117
- url: https://docs.python.org/3/objects.inv
119118
- url: https://docs.pydantic.dev/latest/objects.inv
120119
- url: https://typing-extensions.readthedocs.io/en/latest/objects.inv
120+
- api-autonav:
121+
modules: ['src/mcp']

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ dev = [
6262
]
6363
docs = [
6464
"mkdocs>=1.6.1",
65+
"mkdocs-api-autonav>=0.3.1",
6566
"mkdocs-glightbox>=0.4.0",
6667
"mkdocs-material[imaging]>=9.5.45",
6768
"mkdocstrings-python>=1.12.2",

src/mcp/server/fastmcp/server.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,6 @@ async def log(
12751275
level: Log level (debug, info, warning, error)
12761276
message: Log message
12771277
logger_name: Optional logger name
1278-
**extra: Additional structured data to include
12791278
"""
12801279
await self.request_context.session.send_log_message(
12811280
level=level,

src/mcp/server/fastmcp/utilities/func_metadata.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,12 @@ def func_metadata(
185185
func: The function to convert to a pydantic model
186186
skip_names: A list of parameter names to skip. These will not be included in
187187
the model.
188-
structured_output: Controls whether the tool's output is structured or unstructured
189-
- If None, auto-detects based on the function's return type annotation
190-
- If True, unconditionally creates a structured tool (return type annotation permitting)
191-
- If False, unconditionally creates an unstructured tool
188+
structured_output: Controls whether the tool's output is structured or unstructured.
189+
If None, auto-detects based on the function's return type annotation.
190+
If True, unconditionally creates a structured tool (return type annotation permitting).
191+
If False, unconditionally creates an unstructured tool.
192192
193+
Note:
193194
If structured, creates a Pydantic model for the function's result based on its annotation.
194195
Supports various return types:
195196
- BaseModel subclasses (used directly)

src/mcp/server/lowlevel/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ async def lifespan(_: Server[LifespanResultT, RequestT]) -> AsyncIterator[dict[s
122122
"""Default lifespan context manager that does nothing.
123123
124124
Args:
125-
server: The server instance this lifespan is managing
125+
_: The server instance this lifespan is managing
126126
127127
Returns:
128128
An empty context object

uv.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)