Skip to content

[FEATURE]: MCP remove command #49812

Open

Description

@Sahil-Gupta584

Feature hasn't been suggested before.

  • 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

Add remove also.

Activity

  1. Dante-dan commented on Sep 30, 2026

    @Dante-dan
    Contributor

    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?

  2. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions