From b82f08f6bba497a9d573f5ead6e8889e34cf0eaf Mon Sep 17 00:00:00 2001 From: Giles Odigwe Date: Tue, 17 Feb 2026 08:56:15 -0800 Subject: [PATCH 1/2] MCP sample bugbash fixes --- python/samples/02-agents/mcp/mcp_api_key_auth.py | 6 ++++++ python/samples/02-agents/mcp/mcp_github_pat.py | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/python/samples/02-agents/mcp/mcp_api_key_auth.py b/python/samples/02-agents/mcp/mcp_api_key_auth.py index 5790580116..efbe844500 100644 --- a/python/samples/02-agents/mcp/mcp_api_key_auth.py +++ b/python/samples/02-agents/mcp/mcp_api_key_auth.py @@ -54,3 +54,9 @@ async def api_key_auth_example() -> None: print(f"User: {query}") result = await agent.run(query) print(f"Agent: {result.text}") + + +if __name__ == "__main__": + import asyncio + + asyncio.run(api_key_auth_example()) diff --git a/python/samples/02-agents/mcp/mcp_github_pat.py b/python/samples/02-agents/mcp/mcp_github_pat.py index 85f514867e..cea266f789 100644 --- a/python/samples/02-agents/mcp/mcp_github_pat.py +++ b/python/samples/02-agents/mcp/mcp_github_pat.py @@ -47,10 +47,10 @@ async def github_mcp_example() -> None: # Set approval_mode="never_require" to allow the MCP tool to execute without approval client = OpenAIResponsesClient() github_mcp_tool = client.get_mcp_tool( - server_label="GitHub", - server_url="https://api.githubcopilot.com/mcp/", + name="GitHub", + url="https://api.githubcopilot.com/mcp/", headers=auth_headers, - require_approval="never", + approval_mode="never_require", ) # 5. Create agent with the GitHub MCP tool From c9feb60268b8ae119b25eb236ae26c0412e0441c Mon Sep 17 00:00:00 2001 From: Giles Odigwe Date: Tue, 17 Feb 2026 09:36:38 -0800 Subject: [PATCH 2/2] import fix --- python/samples/02-agents/mcp/mcp_api_key_auth.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/samples/02-agents/mcp/mcp_api_key_auth.py b/python/samples/02-agents/mcp/mcp_api_key_auth.py index efbe844500..1836c73b57 100644 --- a/python/samples/02-agents/mcp/mcp_api_key_auth.py +++ b/python/samples/02-agents/mcp/mcp_api_key_auth.py @@ -1,5 +1,6 @@ # Copyright (c) Microsoft. All rights reserved. +import asyncio import os from agent_framework import Agent, MCPStreamableHTTPTool @@ -57,6 +58,4 @@ async def api_key_auth_example() -> None: if __name__ == "__main__": - import asyncio - asyncio.run(api_key_auth_example())