claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Cannot connect Remote GitHub MCP Server

Open yamachu opened this issue 6 months ago • 0 comments

Environment

  • Platform (select one):
    • [x] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: <!-- output of claude --version --> 1.0.27 (Claude Code)
  • Operating System: macOS 15.5
  • Terminal: iTerm2

Bug Description

The OAuth authentication fails for the GitHub MCP Server (https://github.com/github/github-mcp-server) added with the following command:

claude mcp add -t http github-server https://api.githubcopilot.com/mcp/

and https://docs.anthropic.com/en/docs/claude-code/mcp#authenticate-with-remote-mcp-servers

Based on the observed behavior, it seems that Claude immediately tries to connect to /.well-known/oauth-authorization-server and ignores the resource_metadata in the www-authenticate header, preventing it from properly following the GitHub MCP Server flow.

I believe GitHub MCP Server could be supported by implementing the following flow:

  1. Retrieve resource_metadata from the www-authenticate header returned by GET https://api.githubcopilot.com/mcp/
  2. Send a request to the URL obtained in step 1, and use authorization_servers to perform OAuth
  3. Continue with the normal flow

Steps to Reproduce

  1. do claude mcp add -t http github-server https://api.githubcopilot.com/mcp/
  2. run claude and try /mcp command

Expected Behavior

Complete OAuth 2.0 authentication flow

Actual Behavior

Failed OAuth 2.0 authentication flow

Additional Context

yamachu avatar Jun 18 '25 17:06 yamachu