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(tui): expose open_terminal over client MCP (experimental) by jlongster · Pull Request #57506 · anomalyco/opencode

Conversation

@jlongster

@jlongster jlongster commented Oct 20, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Stack 5/5, based on client-mcp-endpoint. Merge in order.

Part of the client MCP stack (experimental): a client (TUI/desktop/web) opens a WebSocket to the server, and the server treats that incoming socket as an internal MCP server scoped to a location. Tool calls carry _meta["ai.opencode/sessionID"] so the client acts on the calling session. MCP has no official WebSocket transport, so this is a custom transport, which the spec allows.

This PR

The TUI connects as client MCP server tui (behind the client-mcp experiment, off by default) and exposes open_terminal and write_terminal.

  • Opens or reuses the calling session's terminal without taking keyboard focus
  • Errors if the session is unknown or not open in this TUI
  • write_terminal({ text }) types text as-is into the same terminal open_terminal would use (selected, else newest, else a new one); no newline is appended, so include \n to run a command. Input written before the pane attaches is queued and sent once it does
  • Headless <ClientMcp />; reconnects when the endpoint, credentials or directory change

Tests run the real TUI against a fake WebSocket peer (connection count, flag off, errors, create/reuse, no focus, written input reaches the PTY).

Two TUIs in the same directory both stay connected as tui: the most recently attached one serves the tools, and the earlier one takes over when it closes (connection stacking, #57503), so they don't keep replacing each other and reconnecting.

Stack

  1. feat(core): add MCP transport over incoming client sockets #57502 feat(core): add MCP transport over incoming client sockets
  2. feat(core): attach client-hosted MCP servers #57503 feat(core): attach client-hosted MCP servers
  3. feat(client): add connectClientMcp helper for client-hosted MCP tools #57504 feat(client): add connectClientMcp helper for client-hosted MCP tools
  4. feat(server): add client MCP websocket endpoint (experimental) #57505 feat(server): add client MCP websocket endpoint (experimental)
    → 5. feat(tui): expose open_terminal over client MCP (experimental) #57506 feat(tui): expose open_terminal over client MCP (experimental)

Sorry, something went wrong.

Uh oh!

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

All reactions
This was referenced Oct 20, 2026
feat(core): add MCP transport over incoming client sockets #57502
Merged
feat(core): attach client-hosted MCP servers #57503
Merged
feat(client): add connectClientMcp helper for client-hosted MCP tools #57504
Merged
feat(server): add client MCP websocket endpoint (experimental) #57505
Merged
@jlongster
jlongster force-pushed the client-mcp-endpoint branch from de29b40 to fc76153 Compare October 20, 2026 19:29
@jlongster
jlongster force-pushed the client-mcp-tui branch from 124aeec to 78bcc34 Compare October 20, 2026 19:30
@jlongster
jlongster force-pushed the client-mcp-endpoint branch from fc76153 to 3a3cf4b Compare October 20, 2026 19:37
@jlongster
jlongster force-pushed the client-mcp-tui branch from 78bcc34 to d462594 Compare October 20, 2026 19:37
@jlongster
jlongster force-pushed the client-mcp-endpoint branch 2 times, most recently from 5c13f0f to 2ed5e8b Compare October 22, 2026 19:39
Base automatically changed from client-mcp-endpoint to dev October 22, 2026 19:56
jlongster added 4 commits October 22, 2026 15:58
@jlongster
feat(tui): expose open_terminal over client MCP (experimental)
c77fd5a
@jlongster
fix(tui): keep agent-opened terminals unfocused and simplify client M…
f04813c
…CP wiring
@jlongster
fix(tui): keep selected terminal for open_terminal and attach client …
fd5f3dd
…MCP to viewed location
@jlongster
refactor(tui): use declarative tools API for client MCP
1ffbd38
@jlongster
jlongster force-pushed the client-mcp-tui branch from 3b3727f to 1ffbd38 Compare October 22, 2026 19:59
@jlongster
feat(tui): add write_terminal client MCP tool
a8d011e
@jlongster
jlongster merged commit 0b93f0b into dev Oct 22, 2026
14 checks passed

Uh oh!

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

@jlongster
jlongster deleted the client-mcp-tui branch October 22, 2026 20:16
@Edulynch Edulynch mentioned this pull request Oct 23, 2026
[Research] OpenCode 2.1.4: evaluar mejoras útiles para OlympusAgents Edulynch/OpenCode-OlympusAgents#85
Closed
5 tasks
@Hona Hona mentioned this pull request Oct 27, 2026
refactor(browser): serve the in-app browser's tools from the desktop over client MCP #59477
Closed
@Skeptomenos Skeptomenos mentioned this pull request Nov 22, 2026
[FEATURE]: desktop/web app: host the client-MCP terminal tools (open, write, read) so the agent can hand an interactive prompt to the user #65559
Open
1 task done
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

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

1 participant

@jlongster
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.