Description
OpenCode's remote MCP OAuth config (McpOAuthConfig) only supports clientId, clientSecret, and scope. There's no way to set a callbackPort or redirectUri.
OpenCode uses a random port for the OAuth callback (e.g. http://127.0.0.1:19876/mcp/oauth/callback), but services like Slack MCP (https://mcp.slack.com/mcp) require the redirect URI to exactly match a pre-registered URI. Since the port changes every time, auth always fails with:
redirect_uri did not match any configured URIs
This makes it impossible to use Slack MCP (and likely any remote MCP server that validates redirect URIs against a fixed allowlist).
Claude Code solves this by pinning the callback to port 3118 via a callbackPort config option.
Plugins
No response
OpenCode version
1.3.0
Steps to reproduce
- Add Slack MCP to opencode.json:
"slack": {
"type": "remote",
"url": "https://mcp.slack.com/mcp",
"oauth": {
"clientId": "1601185624273.8899143856786"
}
}
- Run opencode mcp auth slack
- Browser opens Slack OAuth page
- Slack rejects with: redirect_uri did not match any configured URIs. Passed URI: http://127.0.0.1:<random_port>/mcp/oauth/callback
Expected: A callbackPort (or redirectUri) option in McpOAuthConfig so the callback port can be pinned, matching the registered redirect URI.
Screenshot and/or share link
Operating System
macOS 26.3.1 (a)
Terminal
Ghostty
Description
OpenCode's remote MCP OAuth config (McpOAuthConfig) only supports clientId, clientSecret, and scope. There's no way to set a callbackPort or redirectUri.
OpenCode uses a random port for the OAuth callback (e.g. http://127.0.0.1:19876/mcp/oauth/callback), but services like Slack MCP (https://mcp.slack.com/mcp) require the redirect URI to exactly match a pre-registered URI. Since the port changes every time, auth always fails with:
Plugins
No response
OpenCode version
1.3.0
Steps to reproduce
"slack": {
"type": "remote",
"url": "https://mcp.slack.com/mcp",
"oauth": {
"clientId": "1601185624273.8899143856786"
}
}
Expected: A callbackPort (or redirectUri) option in McpOAuthConfig so the callback port can be pinned, matching the registered redirect URI.
Screenshot and/or share link
Operating System
macOS 26.3.1 (a)
Terminal
Ghostty