Skip to content
OpenCode
Esc
navigateopen⌘Jpreview

Disconnect MCP server

Disconnect an MCP server at runtime, removing its tools until reconnected.

POST/api/mcp/{server}/disconnect
Path parameters
serverstringrequired
Query parameters
locationobject | any
Responses
204<No Content>
400InvalidRequestError
_tagstringrequired
Allowed:InvalidRequestError
messagestringrequired
kindstring | any
Show properties
Any of:
string
string
any
any
fieldstring | any
Show properties
Any of:
string
string
any
any
401UnauthorizedError
_tagstringrequired
Allowed:UnauthorizedError
messagestringrequired
404McpServerNotFoundError
_tagstringrequired
Allowed:McpServerNotFoundError
serverstringrequired
messagestringrequired
Request
curl -X POST "/api/mcp/string/disconnect"
Response
<No Content>