From 26dc32c097f992c383b6825f66903f13bf6b469b Mon Sep 17 00:00:00 2001 From: aifanatic Date: Tue, 3 Nov 2026 23:18:55 -0600 Subject: [PATCH] Python: Show mcp 2.x Server handler registration in the hosting-mcp README Co-Authored-By: Claude Opus 5.5 --- python/packages/hosting-mcp/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/packages/hosting-mcp/README.md b/python/packages/hosting-mcp/README.md index 8b077efb99e..0dd9bf6cb6b 100644 --- a/python/packages/hosting-mcp/README.md +++ b/python/packages/hosting-mcp/README.md @@ -72,13 +72,13 @@ agent_tool = AgentMCPTool( }, ) -@server.list_tools() -async def list_tools(): +async def list_tools(ctx, params): return await agent_tool.list_tools() -@server.call_tool() -async def call_tool(name, arguments): - return await agent_tool.call_tool(name, arguments) +async def call_tool(ctx, params): + return await agent_tool.call_tool(params.name, params.arguments) + +server = Server("my-agent-server", on_list_tools=list_tools, on_call_tool=call_tool) ``` `AgentMCPTool` uses the agent's name and description unless overridden.