GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Feat(desktop) Add mcp auth from TUI and VS Code support by lesserevil · Pull Request #13085 · anomalyco/opencode

Conversation

@lesserevil

@lesserevil lesserevil commented Feb 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
lesserevil added 10 commits February 10, 2026 23:14
@lesserevil
fix(mcp): use Browser utility for auth flows and handle SSE browser.o…
5cb0b79
…pen events in vscode extension
@lesserevil
refactor(vscode): extract SSE parsing logic and add unit tests
e02acdb
@lesserevil
feat(tui): add inline MCP OAuth authentication via MCPs dialog
d9fd8ed
@lesserevil
fix(mcp): use localhost instead of 127.0.0.1 for OAuth redirect URI t…
44851e7
…o match provider expectations
@lesserevil
fix(mcp): use dynamic port for OAuth callback server to avoid multi-i…
79751b7
…nstance conflicts
@lesserevil
fix(mcp): convert CallToolResult to expected output shape for tool re…
4d9a8ff
…sult processing
@lesserevil
fix(mcp): handle missing or non-standard content in CallToolResult
0fa92b0
@lesserevil
fix(mcp): remove dead content-processing block that crashes on MCP to…
3d966c4
…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.
@lesserevil
refactor(mcp): auto-authenticate on connect, remove separate auth key…
c0de0df
…bind
@lesserevil
fix(mcp): generate OAuth state on-demand to fix MCP auth in VS Code
8665b02
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 github-actions Bot added the needs:title label Feb 11, 2026
@github-actions

github-actions Bot commented Feb 11, 2026

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lesserevil
Merge branch 'dev' into fix/mcp-browser-auth
e26858f
@github-actions

github-actions Bot commented Feb 11, 2026

Copy link
Copy Markdown
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:

  • PR feat(tui): add MCP OAuth authentication in dialog-mcp #11925 - feat(tui): add MCP OAuth authentication in dialog-mcp

    • Directly related: Adds MCP OAuth authentication in TUI (dialog-mcp)
  • PR feat(app): add MCP OAuth authentication UI to settings #11477 - feat(app): add MCP OAuth authentication UI to settings

    • Related: Adds MCP OAuth authentication UI, likely in the app/VSCode extension
  • PR fix: enable MCP server after OAuth completion #6960 - fix: enable MCP server after OAuth completion

    • Related: Handles enabling MCP after OAuth, which aligns with your PR's "enable" workflow
  • PR Fix MCP OAuth auth commands to recognize remote servers by default #5537 - Fix MCP OAuth auth commands to recognize remote servers by default

    • Related: Addresses OAuth with remote servers/VSCode connections

Other related:

  • PR fix: use localhost instead of 127.0.0.1 for OAuth callback #5781 - fix: use localhost instead of 127.0.0.1 for OAuth callback
    • May be relevant to OAuth callback handling in remote tunneling

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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
Merge branch 'dev' into fix/mcp-browser-auth
9c5be16
@lesserevil

lesserevil commented Feb 11, 2026

Copy link
Copy Markdown
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!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lesserevil and others added 8 commits February 11, 2026 12:22
@lesserevil
Merge branch 'anomalyco:dev' into fix/mcp-browser-auth
c05c833
@lesserevil
Merge branch 'dev' into fix/mcp-browser-auth
5db112b
@lesserevil
Merge branch 'dev' into fix/mcp-browser-auth
05cd25d
@lesserevil
Merge branch 'dev' into fix/mcp-browser-auth
e4f59b5
@lesserevil
fix: space key handling in List component for MCP dialog
96f3a21
Fixes bug where pressing space in MCP dialog activated search instead of authenticating.
Added space key handling to List.handleKey to route space to list navigation when item is selected.
@lesserevil
fix: import Truncate in session prompt
9e944bf
@lesserevil @sisyphus-dev-ai
fix: use ctrl+a instead of space to toggle MCP auth
d1ba933
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <[email protected]>
@lesserevil
Merge branch 'dev' into fix/mcp-browser-auth
5f624b5
@github-actions github-actions Bot mentioned this pull request Mar 6, 2026
fix(mcp): generate OAuth state on-the-fly during initial connection #16248
Closed
3 of 6 tasks
@opencode-agent
opencode-agent Bot force-pushed the dev branch from 2f2ed11 to 9f201d6 Compare April 16, 2026 21:55
@github-actions

github-actions Bot commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot closed this Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

needs:title

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@lesserevil
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.