You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The mcp auth and mcp debug don't send configured headers during OAuth flow #20286
When a remote MCP server requires custom headers on every request (e.g. for routing/realm selection), the opencode mcp auth and opencode mcp debug commands fail because the headers configured under mcp..headers are not forwarded during the OAuth flow.
The headers are correctly sent for normal MCP connections (connectRemote), but three code paths ignore them:
startAuth in src/mcp/index.ts — creates StreamableHTTPClientTransport without requestInit
The fetch probe in src/cli/cmd/mcp.ts (McpDebugCommand) — raw fetch() call omits the headers
The OAuth transport in src/cli/cmd/mcp.ts (McpDebugCommand) — creates StreamableHTTPClientTransport without requestInit
The result: mcp auth gets a 404 instead of 401 from the server and reports "Authentication failed". mcp debug similarly probes without the headers and reports wrong status.
Plugins
No response
OpenCode version
1.3.10
Steps to reproduce
Configure a remote MCP server that requires a custom header on all requests:
Activity
fix: send configured headers during MCP OAuth flow