feat(tui): add/remove MCP servers from /mcps dialog - #40309
Open
abhirampuranik wants to merge 8 commits into
Open
feat(tui): add/remove MCP servers from /mcps dialog#40309abhirampuranik wants to merge 8 commits into
abhirampuranik wants to merge 8 commits into
Conversation
abhirampuranik
force-pushed
the
dynamic-mcp-servers
branch
from
August 4, 2026 15:34
825db4d to
a13b25d
Compare
Closed
abhirampuranik
marked this pull request as ready for review
August 8, 2026 18:28
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue for this PR
Closes #38993
Type of change
What does this PR do?
This PR introduces adding and deleting MCP dynamically in a given OpenCode session in
/mcpsdialog in the TUI..Currently the
/mcpsdialog box is read-only view, but personally I was feeling a hassle every time to changeopencode.jsonfile to add and remove MCP I use for my day-to-day analysis activities.This adds two keybinds to the MCP dialog:
ctrl+o- add a new MCP server (prompts for name, type, and connection details)ctrl+d- remove the selected serverHow did you verify your code works?
Built the TUI binary, launched it, opened
/mcps, added both local and remote servers viactrl+o, confirmed they appeared and connected, removed them viactrl+d, confirmed they disappeared from the dialog and were removed fromopencode.json. Also verified the optimistic loading state shows while the server is connecting.Screenshots / recordings
Recording of the changes, adding remote and local MCP during the conversation and checking whether tools calls are available. Checked if the MCP calls are unavailable when MCP is removed.
recording.mp4
Checklist