Skip to main content

Update a custom MCP

Updates the name, description, or configuration of a custom MCP. Changing the configuration redeploys the service.

Endpoint

POST /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.

Request parameters

ParameterTypeRequiredDescription
mcpCodestringYesMCP code
The request body must contain at least one modifiable field:
FieldTypeRequiredDescription
server_namestringNoNew name. Cannot be blank
descriptionstringNoNew description. Cannot be blank
mcp_typestringNoNew service type. Must be submitted with mcp_config
mcp_configobjectNoNew configuration. Must be submitted with mcp_type. Replaces the existing configuration entirely
Disable the service before changing its configuration. If the service is running or deploying, the update returns 400.

Response

Returns a CreateResponse. Unassigned fields are omitted. When only the name or description is changed, status fields are not returned.
FieldTypeDescription
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

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)"
  }'
{
  "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"
}

Errors

HTTP statuserror_codeDescription
400InvalidParameterThe request body is empty, or mcp_type and mcp_config are not submitted together
400OperationNotSupportedThe service is an official MCP, or the service is running or deploying
404McpServerNotFoundThe MCP service does not exist or does not belong to the current workspace
409McpServerBusyAnother operation is running on the MCP service