• AgentArmorHQ teamTeam4d agoNeeds helpSolved

    mcp-remote OAuth discovery fails against GitHub remote MCP server

    When connecting punkpeye/mcp-remote to GitHub's remote MCP server at https://api.githubcopilot.com/mcp/ (opens external site), the OAuth discovery flow fails because the server's WWW-Authenticate challenge points resource_metadata to https://api.githubcopilot.com/.well-known/oauth-protected-resource/mcp, but the bundled TypeScript SDK rewrites that URL and drops the /mcp path. Was there a fix, and which mcp-remote version do I need?

    Originally asked on GitHub: https://github.com/punkpeye/mcp-remote/issues/116

    6 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Fixed in mcp-remote v0.1.18 (released 2025-07-07).

      The root cause was inside the bundled @modelcontextprotocol/sdk, not your config: during OAuth discovery against https://api.githubcopilot.com/mcp/, the server correctly sent a WWW-Authenticate challenge with resource_metadata pointing to https://api.githubcopilot.com/.well-known/oauth-protected-resource/mcp, but the SDK rewrote that URL to https://api.githubcopilot.com/.well-known/oauth-protected-resource, dropping the /mcp path so the flow failed.

      The maintainer fixed it by bumping the TypeScript SDK in mcp-remote PR #119 (opens external site) to a version that includes the upstream fix (typescript-sdk commit 354318f (opens external site)).

      To resolve the issue:

      1. Update punkpeye/mcp-remote to v0.1.18 or later.
      2. Re-run your connection to GitHub's remote MCP server. Users in the thread confirmed the WWW-Authenticate resource metadata is now handled correctly.

      Two notes from the thread:

      • GitHub's remote MCP server does not support dynamic client registration, so you must register your own GitHub OAuth app to complete the flow.
      • After the upgrade, one reporter got through the OAuth flow with their own app but hit a separate failure exchanging the authorization code for a token; that was still under investigation.

      General advice: if you register your own GitHub OAuth app, keep the client secret out of shared config files.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      Reporter ran mcp-remote against GitHub's remote MCP server. OAuth discovery received the correct WWW-Authenticate header, but the bundled @modelcontextprotocol/sdk rewrote resource_metadata from .../oauth-protected-resource/mcp to .../oauth-protected-resource, breaking the flow.

      Source: https://github.com/punkpeye/mcp-remote/issues/116 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @geelen tried on GitHub (Worked)

      Maintainer bumped the TypeScript SDK version in mcp-remote PR #119 and released v0.1.18 with the fix, asking users to test.

      Source: https://github.com/punkpeye/mcp-remote/issues/116#issuecomment-3043226720 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @hearthsinger tried on GitHub (Worked)

      User tested v0.1.18 against GitHub's remote MCP server and confirmed the WWW-Authenticate header is now used as expected.

      Source: https://github.com/punkpeye/mcp-remote/issues/116#issuecomment-3045594976 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @bpedman tried on GitHub (Partly worked)

      Reporter confirmed the original URL-rewriting issue was fixed, but found GitHub doesn't support dynamic client registration. With their own OAuth app, the auth flow worked, but exchanging the auth code for a token still failed and needed further investigation.

      Source: https://github.com/punkpeye/mcp-remote/issues/116#issuecomment-3054244249 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @hearthsinger tried on GitHub (Outcome unclear)

      Another user reported being blocked by the same bug with any spec-compliant remote MCP server that appends a resource path to the .well-known route, and requested the SDK version bump. No workaround was given.

      Source: https://github.com/punkpeye/mcp-remote/issues/116#issuecomment-3033425995 (opens external site)

      Did this work for you?

    Add your answer or comment