diff --git a/python/packages/core/agent_framework/_mcp.py b/python/packages/core/agent_framework/_mcp.py index f771b1f9df..5d72e59dc8 100644 --- a/python/packages/core/agent_framework/_mcp.py +++ b/python/packages/core/agent_framework/_mcp.py @@ -1439,7 +1439,8 @@ class MCPTool: continue except Exception as reconn_ex: raise ToolExecutionException( - "Failed to reconnect to MCP server.", inner_exception=reconn_ex + "Failed to reconnect to MCP server.", + inner_exception=reconn_ex, ) from reconn_ex # Second attempt also failed, give up. diff --git a/python/samples/02-agents/mcp/mcp_github_pat.py b/python/samples/02-agents/mcp/mcp_github_pat.py index 8c83d7c8e2..9698922862 100644 --- a/python/samples/02-agents/mcp/mcp_github_pat.py +++ b/python/samples/02-agents/mcp/mcp_github_pat.py @@ -46,6 +46,8 @@ async def github_mcp_example() -> None: # The MCP tool manages the connection to the MCP server and makes its tools available # Set approval_mode="never_require" to allow the MCP tool to execute without approval client = OpenAIChatClient() + # Note that the tool created here will be executed remotely by OpenAI, not locally by + # your application. github_mcp_tool = client.get_mcp_tool( name="GitHub", url="https://api.githubcopilot.com/mcp/",