File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
python/samples/02-agents/mcp Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 11# Copyright (c) Microsoft. All rights reserved.
22
3+ import asyncio
34import os
45
56from agent_framework import Agent , MCPStreamableHTTPTool
@@ -54,3 +55,7 @@ async def api_key_auth_example() -> None:
5455 print (f"User: { query } " )
5556 result = await agent .run (query )
5657 print (f"Agent: { result .text } " )
58+
59+
60+ if __name__ == "__main__" :
61+ asyncio .run (api_key_auth_example ())
Original file line number Diff line number Diff line change @@ -47,10 +47,10 @@ async def github_mcp_example() -> None:
4747 # Set approval_mode="never_require" to allow the MCP tool to execute without approval
4848 client = OpenAIResponsesClient ()
4949 github_mcp_tool = client .get_mcp_tool (
50- server_label = "GitHub" ,
51- server_url = "https://api.githubcopilot.com/mcp/" ,
50+ name = "GitHub" ,
51+ url = "https://api.githubcopilot.com/mcp/" ,
5252 headers = auth_headers ,
53- require_approval = "never " ,
53+ approval_mode = "never_require " ,
5454 )
5555
5656 # 5. Create agent with the GitHub MCP tool
You can’t perform that action at this time.
0 commit comments