opencode
opencode copied to clipboard
GitHub MCP OAuth authentication fails with HTTP 422 (Dynamic client registration)
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
- Configure OpenCode with the GitHub MCP server as shown above
- Run MCP authentication (via CLI or UI)
- Select
githubwhen prompted to authenticate
Screenshot and/or share link
Operating System
macos 26.1
Terminal
ghostty
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.