Skip to content

Feat(desktop) Add mcp auth from TUI and VS Code support#13085

Open
lesserevil wants to merge 15 commits intoanomalyco:devfrom
lesserevil:fix/mcp-browser-auth
Open

Feat(desktop) Add mcp auth from TUI and VS Code support#13085
lesserevil wants to merge 15 commits intoanomalyco:devfrom
lesserevil:fix/mcp-browser-auth

Conversation

@lesserevil
Copy link

@lesserevil lesserevil commented Feb 11, 2026

Closes #12061

This PR adds two features:

  • Add support for auth for mcps which need oauth from TUI
  • Add ability for VSCode remote connections to tunnel the oauth connection back to the host VSCode device

Auth isn't done automatically, only when you 'enable' the mcp. If we did them all at once, we could get ugly auth storms.

Tested via manual testing on multiple MCPs, both from remote and local VSCode connections.

…ol results

The MCP tool wrapper in prompt.ts iterated result.content expecting raw
CallToolResult from the MCP SDK, but convertMcpTool already extracts text
and returns a flat { output, title, metadata } shape — so result.content
was always undefined, causing TypeError on every MCP tool call.
The MCP SDK's OAuthClientProvider.state() is a generator, not a
retriever — the SDK never calls saveState(). The previous
implementation threw when no state was pre-saved, causing all
transport connections to fail silently for OAuth-protected servers.

Also fixes the VS Code extension SSE endpoint path, adds payload
unwrapping for global events, and promotes transport connection
failure logs from debug to info for better diagnostics.
@github-actions
Copy link
Contributor

Hey! Your PR title Add mcp auth from TUI and VS Code support doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found several potentially related PRs that address similar MCP authentication features:

Most Relevant:

Other related:

These PRs suggest that MCP OAuth authentication features are being actively developed across multiple components (TUI, app, remote servers). PR #11925 and #11477 appear to be the closest potential duplicates, as they also implement MCP OAuth authentication support in similar contexts.

@lesserevil lesserevil changed the title Add mcp auth from TUI and VS Code support Feat(desktop) Add mcp auth from TUI and VS Code support Feb 11, 2026
@lesserevil
Copy link
Author

Hey! Your PR title Add mcp auth from TUI and VS Code support doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to authenticate with OpenCode when running on a remote server via VS Code?

1 participant