Skip to content
OpenCode
Esc
navigateopen⌘Jpreview

Connect MCP server

Connect an MCP server at runtime, overriding a disabled configuration until restart.

POST/api/mcp/{server}/connect
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/connect"
Response
<No Content>