You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Currently opencode cli only have this subcommands for mcp>
list List configured MCP servers and their status
add Add an MCP server to your configuration
auth Authenticate with an OAuth-capable remote MCP server
logout Remove stored OAuth credentials for an MCP server
I propose a focused opencode mcp remove <name> [--global] command. In the v2 CLI, the command registry has list/add/auth/logout but no removal command. Add selects a project or global configuration file and updates JSONC; logout deletes OAuth credentials, so it does not remove a configured server.
The proposed scope is:
Use the same file selection and explicit --global scope as add.
Remove only the named server definition in that file, preserving comments, other servers and unrelated settings. Cover both the v2 mcp.servers.<name> form and the legacy mcp.<name> server form still accepted by normalization.
Report the file changed, or report that the name was not defined in that scope without creating or rewriting a config file. Removing an override can expose an inherited definition; do not silently delete definitions in other files.
Leave credential deletion to mcp logout.
After design approval, I would add the command/handler and relevant CLI tests for JSON/JSONC preservation, local/global scope, legacy definitions, absent names and inherited definitions, then run the affected package checks. Could the core team approve this scope and the distinction between removing a definition and removing a server from all effective configuration layers?
Thanks for the suggestion, @Sahil-Gupta584! You're asking for an opencode mcp remove <name> subcommand that undoes opencode mcp add, so you can remove a server from your config without editing it by hand. Maintainers will consider it.
Until then, you can remove a server by deleting its entry under mcp.servers.<name> in the config file that mcp add wrote to. That is opencode.json / opencode.jsonc (or the same files under .opencode/) in your project, or your global config if you used --global.
Activity
Dante-dan commentedon Sep 30, 2026
I propose a focused
opencode mcp remove <name> [--global]command. In the v2 CLI, the command registry has list/add/auth/logout but no removal command. Add selects a project or global configuration file and updates JSONC; logout deletes OAuth credentials, so it does not remove a configured server.The proposed scope is:
--globalscope as add.mcp.servers.<name>form and the legacymcp.<name>server form still accepted by normalization.mcp logout.After design approval, I would add the command/handler and relevant CLI tests for JSON/JSONC preservation, local/global scope, legacy definitions, absent names and inherited definitions, then run the affected package checks. Could the core team approve this scope and the distinction between removing a definition and removing a server from all effective configuration layers?
opencodejr commentedon Oct 28, 2026
Thanks for the suggestion, @Sahil-Gupta584! You're asking for an
opencode mcp remove <name>subcommand that undoesopencode mcp add, so you can remove a server from your config without editing it by hand. Maintainers will consider it.Until then, you can remove a server by deleting its entry under
mcp.servers.<name>in the config file thatmcp addwrote to. That isopencode.json/opencode.jsonc(or the same files under.opencode/) in your project, or your global config if you used--global.