Update a custom MCP
Updates the name, description, or configuration of a custom MCP. Changing the configuration redeploys the service.
Endpoint
/api/v1/mcp/servers/{mcpCode}Supports custom MCP only. Changing only the name or description does not redeploy the service. Submitting mcp_type and mcp_config together replaces the configuration and redeploys the service.
Path parameters
mcpCodestringRequiredMCP code
Request body
server_namestringOptionalNew name. Cannot be blank
descriptionstringOptionalNew description. Cannot be blank
mcp_typestringOptionalNew service type. Must be submitted with mcp_config
mcp_configobjectOptionalNew configuration. Must be submitted with mcp_type. Replaces the existing configuration entirely
Response fields
Returns a CreateResponse. Unassigned fields are omitted. When only the name or description is changed, status fields are not returned.
mcp_codestringMCP code
server_namestringUpdated name
server_statusstringRedeployment status. Returned only when the configuration changes
server_status_textstringStatus text. Returned only when the configuration changes
activate_fail_reasonstringDeployment failure reason. Returned only when deployment fails
Examples
Change the name and description
Request example
curl -X POST "https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/mcp/servers/mcp-a1b2c3d4e5f6g7h8" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"server_name": "weather-mcp-v2",
"description": "Weather query MCP (new version)"
}'
Response example
{
"success": true,
"error_code": null,
"error_msg": null,
"data": {
"mcp_code": "mcp-a1b2c3d4e5f6g7h8",
"server_name": "weather-mcp-v2"
},
"request_id": "6f1c2a8e-3b0d-4c55-9a0e-2f7d1c9b8a11"
}
Change the configuration
curl -X POST "https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/mcp/servers/mcp-a1b2c3d4e5f6g7h8" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mcp_type": "SSE",
"mcp_config": {
"url": "https://mcp.example.com/sse"
}
}'
{
"success": true,
"error_code": null,
"error_msg": null,
"data": {
"mcp_code": "mcp-a1b2c3d4e5f6g7h8",
"server_name": "weather-mcp-v2",
"server_status": "ACTIVATED",
"server_status_text": "已启用"
},
"request_id": "6f1c2a8e-3b0d-4c55-9a0e-2f7d1c9b8a11"
}
Error codes
| HTTP status | error_code | Description |
|---|---|---|
| 400 | InvalidParameter | The request body is empty, or mcp_type and mcp_config are not submitted together |
| 400 | OperationNotSupported | The service is an official MCP, or the service is running or deploying |
| 404 | McpServerNotFound | The MCP service does not exist or does not belong to the current workspace |
| 409 | McpServerBusy | Another operation is running on the MCP service |