Skip to content

Conversation

@Timorleiderman
Copy link
Contributor

Summary

  • Add ability to restart all MCP servers without restarting opencode
  • Useful for developers working on MCP servers who need to quickly reconnect after code changes

Changes

  • Add MCP.restartAll() function to disconnect and reconnect all connected/failed servers
  • Add POST /mcp/restart API endpoint
  • Add r keybind in MCP dialog to restart all servers
  • Add /restart-mcp slash command
  • Add "Restart MCPs" to command palette
  • Regenerate SDK with new endpoint

Usage

  1. Open MCP dialog with /mcp, then press r to restart all
  2. Use /restart-mcp slash command
  3. Use command palette → "Restart MCPs"

- Add MCP.restartAll() function to disconnect and reconnect all connected/failed servers
- Add POST /mcp/restart API endpoint
- Add 'r' keybind in MCP dialog to restart all servers
- Add /restart-mcp slash command
- Add 'Restart MCPs' to command palette
- Regenerate SDK with new endpoint
@rekram1-node
Copy link
Collaborator

the api already allows u to disconnect and reconnect mcp servers I think u can just use that instead?

Address PR review feedback - instead of adding a new /mcp/restart
endpoint, use the existing disconnect and connect endpoints on
the client side to restart MCP servers.
@Timorleiderman
Copy link
Contributor Author

Good point! Updated the implementation to use the existing disconnect and connect endpoints instead of adding a new API endpoint.
The restart logic now lives entirely on the client side - it:

  1. Gets all MCP servers with status "connected" or "failed"
  2. Calls disconnect on each in parallel
  3. Calls connect on each in parallel
  4. Refreshes the status
    No new API surface added.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants