Add MCP server
Add an MCP server at runtime or replace an existing one, connecting it immediately.
PUT
/api/mcp/{server}Path parameters
serverstringrequiredQuery parameters
locationobject | anyRequest body
requiredapplication/jsonconfigMcp.LocalConfig | Mcp.RemoteConfigrequiredShow propertiesHide properties
Any of:
Mcp.LocalConfig
typestringrequiredAllowed:
localcommandstring[]requiredcwdstring | anyWorking directory for the MCP server process. Relative paths resolve from the workspace directory.
Show propertiesHide properties
Any of:
string
stringany
anyenvironmentobject | anyShow propertiesHide properties
Any of:
object
objectany
anydisabledboolean | anyShow propertiesHide properties
Any of:
boolean
booleanany
anycodemodeboolean | anyExpose this server's tools through Code Mode. Defaults to true.
Show propertiesHide properties
Any of:
boolean
booleanany
anytimeoutMcp.TimeoutConfig | anyShow propertiesHide properties
Any of:
Mcp.TimeoutConfig
startupobject | anyMaximum time in milliseconds to establish and initialize the MCP server.
Show propertiesHide properties
Any of:
object
objectany
anycatalogobject | anyMaximum time in milliseconds to wait for MCP discovery requests such as tools/list and prompts/list.
Show propertiesHide properties
Any of:
object
objectany
anyexecutionobject | anyMaximum time in milliseconds to wait for MCP tool and prompt execution.
Show propertiesHide properties
Any of:
object
objectany
anyany
anyMcp.RemoteConfig
typestringrequiredAllowed:
remoteurlstringrequiredheadersobject | anyShow propertiesHide properties
Any of:
object
objectany
anyoauthMcp.OAuthConfig | boolean | anyShow propertiesHide properties
Any of:
Mcp.OAuthConfig | boolean
Any of:
Mcp.OAuthConfig
client_idstring | anyShow propertiesHide properties
Any of:
string
stringany
anyclient_secretstring | anyShow propertiesHide properties
Any of:
string
stringany
anyscopestring | anyShow propertiesHide properties
Any of:
string
stringany
anycallback_portobject | anyShow propertiesHide properties
Any of:
object
objectany
anyredirect_uristring | anyShow propertiesHide properties
Any of:
string
stringany
anyboolean
booleanany
anydisabledboolean | anyShow propertiesHide properties
Any of:
boolean
booleanany
anycodemodeboolean | anyExpose this server's tools through Code Mode. Defaults to true.
Show propertiesHide properties
Any of:
boolean
booleanany
anytimeoutMcp.TimeoutConfig | anyShow propertiesHide properties
Any of:
Mcp.TimeoutConfig
startupobject | anyMaximum time in milliseconds to establish and initialize the MCP server.
Show propertiesHide properties
Any of:
object
objectany
anycatalogobject | anyMaximum time in milliseconds to wait for MCP discovery requests such as tools/list and prompts/list.
Show propertiesHide properties
Any of:
object
objectany
anyexecutionobject | anyMaximum time in milliseconds to wait for MCP tool and prompt execution.
Show propertiesHide properties
Any of:
object
objectany
anyany
anyResponses
204<No Content>
400InvalidRequestError
_tagstringrequiredAllowed:
InvalidRequestErrormessagestringrequiredkindstring | anyShow propertiesHide properties
Any of:
string
stringany
anyfieldstring | anyShow propertiesHide properties
Any of:
string
stringany
any401UnauthorizedError
_tagstringrequiredAllowed:
UnauthorizedErrormessagestringrequiredRequest
curl -X PUT "/api/mcp/string" \
-H "Content-Type: application/json" \
-d '{
"config": {
"type": "local",
"command": [
"string"
],
"cwd": "string",
"environment": {},
"disabled": true,
"codemode": true,
"timeout": {
"startup": {},
"catalog": {},
"execution": {}
}
}
}'const response = await fetch("/api/mcp/string", {
method: "PUT",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"config": {
"type": "local",
"command": [
"string"
],
"cwd": "string",
"environment": {},
"disabled": true,
"codemode": true,
"timeout": {
"startup": {},
"catalog": {},
"execution": {}
}
}
})
});import requests
response = requests.put(
"/api/mcp/string",
headers={
"Content-Type": "application/json"
},
json={
"config": {
"type": "local",
"command": [
"string"
],
"cwd": "string",
"environment": {},
"disabled": True,
"codemode": True,
"timeout": {
"startup": {},
"catalog": {},
"execution": {}
}
}
},
)Response
<No Content>
{
"_tag": "InvalidRequestError",
"message": "string",
"kind": "string",
"field": "string"
}{
"_tag": "UnauthorizedError",
"message": "string"
}