Skip to content

fix(opencode): forward configured headers in startAuth and mcp debug#20291

Open
obaranov wants to merge 1 commit intoanomalyco:devfrom
obaranov:fix-oauth-headers
Open

fix(opencode): forward configured headers in startAuth and mcp debug#20291
obaranov wants to merge 1 commit intoanomalyco:devfrom
obaranov:fix-oauth-headers

Conversation

@obaranov
Copy link
Copy Markdown

Issue for this PR

Closes #20286

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When a remote MCP server requires custom headers on all requests, mcp auth and mcp debug fail because the headers from config are not forwarded during the OAuth flow. The connectRemote path already passes them correctly but we still miss headers when we run initial authentication (oauth).

How did you verify your code works?

Tested against a real MCP server that requires a custom header on every request. Before the fix mcp auth returned 404 and failed. After the fix auth completes successfully. Added two unit tests to test/mcp/headers-start-auth.test.ts that verify startAuth passes requestInit with the configured headers to the transport constructor.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@obaranov obaranov force-pushed the fix-oauth-headers branch 2 times, most recently from 74d67c1 to d2f2d42 Compare March 31, 2026 16:36
@obaranov obaranov force-pushed the fix-oauth-headers branch 2 times, most recently from 614a9ae to 04d4ede Compare April 1, 2026 12:46
@obaranov obaranov force-pushed the fix-oauth-headers branch from 04d4ede to 76e9c64 Compare April 2, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The mcp auth and mcp debug don't send configured headers during OAuth flow

1 participant