- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.9k
Closed
Labels
bugSomething isn't workingSomething isn't working
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
from openai.types.responses.tool_param import Mcp
import utils.credentials as creds
from openai import AsyncOpenAI
llm = 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 = await llm.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'}}D1M1TR10S and nikosavola
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working