- Notifications
You must be signed in to change notification settings - Fork1.4k
Closed
Description
Describe the bug
I am able to use the remote MCP server with my classic PAT with (repo/user) permissions. When some of my co-workers create a classic PAT with the exact permission/expiration/etc. they get 403 forbidden. Code/Token is identical so I am perplexed.
Code
fromopenai.types.responses.tool_paramimportMcpimportutils.credentialsascredsfromopenaiimportAsyncOpenAIllm=AsyncOpenAI(base_url=creds.AZURE_OPENAI_BASE+"openai/v1/",api_key=creds.AZURE_OPENAI_KEY,default_query={"api-version":"preview"},)pat_token='ghp_xxx'mcp_github=Mcp(server_label="github",server_url="https://api.githubcopilot.com/mcp/",type="mcp",headers={"Authorization":f"Bearer{pat_token}"},require_approval="never")response=awaitllm.responses.create(model="gpt-4.1",tools=[mcp_github],input="What is my GitHub username?",)print(response.output_text)
InternalServerError: Error code: 500 - {'error': {'message':"Error retrieving tool list from MCP server: 'github'. Http status code: 403 (Forbidden)",'type':'external_connector_error','param':'tools','code':'http_error'}}