Skip to content

Hot reload MCP server configuration #37421

Closed

Description

@kitlangton

Parent

Related to #10899 and #6719.

What to build

Hot reload V2 MCP server configuration for a loaded Location. Editing mcp.servers, server commands or URLs, environment, headers, disabled state, OAuth settings, or timeouts should reconcile the running MCP runtime without restarting OpenCode.

Current V2 Config detects and publishes the file change, but MCP captures Config once while constructing its Location-scoped service and has no config.updated subscription or reload operation. Credential refresh and dynamic MCP tool/resource notifications are already live; this issue is specifically about server configuration.

Acceptance criteria

  • Adding a configured MCP server starts it without restarting the service or TUI.
  • Removing or disabling a server closes its connection and removes its tools, prompts, resources, and instructions.
  • Changing connection settings replaces the old connection without leaking processes or subscriptions.
  • An in-flight session Step remains stable while the following Step sees the reconciled MCP catalog.
  • Integration tests cover add, change, disable, and remove through a real config update.

Blocked by

None - can start immediately.

Activity

  1. added
    enhancementNew feature or request
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Jul 17, 2026
  2. opencode-agent commented on Aug 8, 2026

    @opencode-agent
    Contributor

    Addressed by #41204. Each Location-scoped MCP service now subscribes to config.updated, compares the previous and next effective server maps, and reconciles only entries that were added, removed, disabled, or materially changed. Replacement closes the old configured runtime without disturbing unrelated or API-registered servers; unchanged config does not restart connections, and startup reconciliation is installed after the live subscription so updates cannot be missed. Focused MCP tests cover the reconciliation behavior. Closing as resolved on the v2 branch.

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

    2.0coreAnything pertaining to core functionality of the application (opencode server stuff)enhancementNew feature or requestmcp

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions