Skip to content

Bug: /mcp toggling doesn't persist changes to opencode.json #17799

Closed as duplicate

Description

@xgmyz

Bug Description

Using /mcp command to enable/disable MCP servers doesn't persist changes to opencode.json. The toggle appears to work in the UI but after restarting OpenCode, the changes are lost.

Steps to Reproduce

  1. Run OpenCode v1.2.27
  2. Use /mcp command
  3. Toggle any MCP server (e.g., disable "excel")
  4. Check ~/.config/opencode/opencode.json - the enabled field is NOT updated
  5. Restart OpenCode - MCP server is still running

Expected Behavior

Changes made via /mcp should be saved to opencode.json

Additional Context

Workaround

Manually edit opencode.json to enable/disable MCP servers

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 16, 2026
  2. github-actions commented on Mar 16, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of an existing issue. Please check:

  3. added 2 commits that reference this issue on Mar 16, 2026
    1cfb6e3
    82422b0
  4. ariane-emory commented on Mar 16, 2026

    @ariane-emory
    Contributor

    IMHO, opencode.jsone is a configuration file, not a state file, and as such nothing ought be persisted to it. Any persistence should be to state files.

  5. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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