feat(opencode): add mcp remove command - #44233
Open
Neelesh2512 wants to merge 3 commits into
Open
Conversation
Adds an `opencode mcp remove [name]` subcommand so MCP servers can be removed from the CLI instead of hand-editing opencode.json (anomalyco#4570). The delete runs through jsonc-parser so surrounding comments and formatting survive. The defining file is located by checking project config paths before global ones, matching config precedence. Stored OAuth tokens for the removed server are cleaned up when present. Config path lookup helpers are now shared between add and remove.
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Author
|
Hi @rekram1-node , Thanks! |
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 #4570
Type of change
What does this PR do?
#4570 asked for a way to remove MCP servers from the CLI. Right now the only option is editing opencode.json by hand. That issue was closed as completed but the command never landed.
This adds
opencode mcp remove [name]:To support this, some config path lookup code already used by
mcp addis now shared between the two commands.How did you verify your code works?
Screenshots / recordings
Checklist