Skip to content

Hot reload MCP server configuration #37421

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.

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