Skip to content

Commit ca1cf0b

Browse files
committed
task: Changes required for FastMCP v3.x
1 parent a1d8cf1 commit ca1cf0b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/aignostics/utils/_mcp.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def mcp_create_server(server_name: str = MCP_SERVER_NAME) -> FastMCP:
5454
5555
Creates a new FastMCP server instance and mounts all discovered MCP servers
5656
from the SDK and plugins. Each mounted server's tools are namespaced
57-
automatically using FastMCP's built-in prefix feature.
57+
automatically using FastMCP's built-in namespace feature.
5858
5959
Args:
6060
server_name: Human-readable name for the MCP server.
@@ -76,7 +76,7 @@ def mcp_create_server(server_name: str = MCP_SERVER_NAME) -> FastMCP:
7676
continue
7777
seen_names.add(server.name)
7878
logger.info(f"Mounting MCP server: {server.name}")
79-
mcp.mount(server, prefix=server.name)
79+
mcp.mount(server, namespace=server.name)
8080
count += 1
8181

8282
logger.info(f"Mounted {count} MCP servers")
@@ -115,7 +115,7 @@ def mcp_list_tools(server_name: str = MCP_SERVER_NAME) -> list[dict[str, Any]]:
115115
'name' and 'description' keys.
116116
"""
117117
server = mcp_create_server(server_name)
118-
# FastMCP's get_tools() is async because mounted servers may need to
118+
# FastMCP's list_tools() is async because mounted servers may need to
119119
# lazily initialize resources. We use asyncio.run() to bridge sync/async.
120-
tools = asyncio.run(server.get_tools())
121-
return [{"name": name, "description": tool.description or ""} for name, tool in tools.items()]
120+
tools = asyncio.run(server.list_tools())
121+
return [{"name": tool.name, "description": tool.description or ""} for tool in tools]

0 commit comments

Comments
 (0)