Read FastMCP 1.x server metadata directly (SDK v2 drops _mcp_server wrapper)

This commit is contained in:
Jeremiah Lowin 2026-07-05 23:11:55 -04:00
commit 3a0944e288
No known key found for this signature in database

View file

@ -358,10 +358,12 @@ async def inspect_fastmcp_v1(mcp: FastMCP1x) -> FastMCPInfo:
server_info.website_url if hasattr(server_info, "websiteUrl") else None
)
# SDK v2's MCPServer (FastMCP 1.x) exposes name/instructions/version
# directly; the v1 `_mcp_server` low-level wrapper attribute is gone.
return FastMCPInfo(
name=mcp._mcp_server.name,
instructions=mcp._mcp_server.instructions,
version=mcp._mcp_server.version,
name=mcp.name,
instructions=mcp.instructions,
version=mcp.version,
website_url=server_website_url,
icons=server_icons,
fastmcp_version=fastmcp.__version__, # Version generating this manifest