-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
AIAI AgentsService AttentionWorkflow: This issue is responsible by Azure service team.Workflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Description
- Package Name: azure-ai-agents
- Package Version: 1.1.0b4
- Operating System: windows
- Python Version: 3.13.5
Describe the bug
The sample code works perfect for anonymous mcp server.
Then when I try to create and chat an agent with github mcp server, which requires authorization, the agent returns server error with the error message 'Sorry, something went wrong.'.
To Reproduce
Steps to reproduce the behavior:
- Get the sample code.
- Create a github token and verify it works for github mcp server in VS Code Copilot with following mcp.json
{ "servers": { "github": { "type": "http", "url": "https://api.githubcopilot.com/mcp/", "headers": { "Authorization": "Bearer ${input:github_mcp_pat}" } } }, "inputs": [ { "type": "promptString", "id": "github_mcp_pat", "description": "GitHub Personal Access Token", "password": true } ] }
- Update the sample code to use GH mcp server
and add mcp header for authorization.MCP_SERVER_URL=https://api.githubcopilot.com/mcp/ MCP_HEADER_KEY=Authorization MCP_HEADER_VALUE=Bearer <gh token>
mcp_header_key = os.environ.get("MCP_HEADER_KEY") mcp_header_value = os.environ.get("MCP_HEADER_VALUE") message = agents_client.messages.create( thread_id=thread.id, role="user", content="Please summarize the Readme of this repo: https://github.com/Azure/azure-sdk-for-python" )
- Run it and get the error.
Current run status: RunStatus.IN_PROGRESS Approving tool call: {'id': 'call_SmqkJA0Buwv035S0sKxSqChr', 'type': 'mcp', 'arguments': '{"owner":"Azure","repo":"azure-sdk-for-python","path":"README.md","ref":"main","sha":""}', 'name': 'get_file_contents', 'server_label': 'github'} tool_approvals: [{'tool_call_id': 'call_SmqkJA0Buwv035S0sKxSqChr', 'approve': True, 'headers': {'Authorization': 'Bearer <my-token>'}}] Current run status: RunStatus.REQUIRES_ACTION Current run status: RunStatus.FAILED Run completed with status: RunStatus.FAILED Run failed: {'code': 'server_error', 'message': 'Sorry, something went wrong.'} Conversation: -------------------------------------------------- USER: Please summarize the Readme of this repo: https://github.com/Azure/azure-sdk-for-python --------------------------------------------------
Expected behavior
The agent should works with GH mcp server with correct auth.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Since it failed at approving action step, I tried set the approval mode to never to work around it. But the agent still failed to invoke the gh mcp server with the following response.
mcp_tool.set_approval_mode("never")
Created message, ID: msg_PWxOf0L8KmQ1rDvi23JZc8PQ
Created run, ID: run_uiWrkq9IWWC5cP2JKQOUjLhn
Current run status: RunStatus.IN_PROGRESS
Current run status: RunStatus.IN_PROGRESS
Current run status: RunStatus.IN_PROGRESS
Current run status: RunStatus.IN_PROGRESS
Current run status: RunStatus.COMPLETED
Run completed with status: RunStatus.COMPLETED
Step step_d7qJGVFFEarsHttfoZai9boR status: completed
Step step_wSZ0yaGHSZJXznR1FlV92M8d status: completed
MCP Tool calls:
Tool Call ID: call_Q3QMz0VknflIWOmTgeDsFQur
Type: mcp
Conversation:
--------------------------------------------------
ASSISTANT: It seems I encountered an error retrieving the README file for the repository. Would you like to provide a copy of the README content, or should I attempt another approach? Let me know how you'd like to proceed!
--------------------------------------------------
USER: Please summarize the Readme of this repo: https://github.com/Azure/azure-sdk-for-python
--------------------------------------------------
Metadata
Metadata
Assignees
Labels
AIAI AgentsService AttentionWorkflow: This issue is responsible by Azure service team.Workflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that