opencode icon indicating copy to clipboard operation
opencode copied to clipboard

GitHub MCP OAuth authentication fails with HTTP 422 (Dynamic client registration)

Open mameli opened this issue 2 weeks ago • 2 comments

Description

When using the GitHub MCP server via the remote MCP endpoint, OAuth authentication fails with an HTTP 422 error during dynamic client registration.

The same configuration works correctly with other MCP servers, so this appears to be specific to the GitHub MCP integration.

Environment

  • OpenCode version: 1.0.193
  • MCP server: GitHub
  • MCP type: remote
  • OS: macOS (likely platform-independent)

Configuration

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "github": {
      "type": "remote",
      "url": "https://api.githubcopilot.com/mcp/",
      "enabled": true,
      "oauth": {}
    }
  }
}

Expected Behavior OAuth authentication completes successfully, similar to other MCP servers using the same flow.

Actual Behavior Authentication fails with the following error:

Authentication failed
Dynamic client registration failed: HTTP 422

OpenCode version

1.0.193

Steps to reproduce

  1. Configure OpenCode with the GitHub MCP server as shown above
  2. Run MCP authentication (via CLI or UI)
  3. Select github when prompted to authenticate

Screenshot and/or share link

Image

Operating System

macos 26.1

Terminal

ghostty

mameli avatar Dec 23 '25 22:12 mameli

This issue might be a duplicate of existing issues. Please check:

  • #5716: Is github mcp serve with oauth supposed to be working? (same HTTP 422 error with GitHub MCP OAuth)
  • #5766: bug: OAuth uses wrong authorization URL and missing redirectUri config (related OAuth issues with MCP)
  • #5444: MCP with oauth doesn't work (related MCP OAuth failures)

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Dec 23 '25 22:12 github-actions[bot]