Skip to main content

Enable a custom MCP

Redeploys and enables a custom MCP service using its saved configuration.

Endpoint

POST /api/v1/mcp/servers/{mcpCode}/enable Supports custom MCP only. The service is redeployed with its saved configuration. You cannot submit a new configuration or environment variables through this API. No request body is required.

Request parameters

ParameterTypeRequiredDescription
mcpCodestringYesCustom MCP code

Response

Returns a DetailResponse with only mcp_code, server_status, and server_status_text populated. All other fields are null.
curl -X POST "https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/mcp/servers/mcp-a1b2c3d4e5f6g7h8/enable" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"
{
  "success": true,
  "error_code": null,
  "error_msg": null,
  "data": {
    "mcp_code": "mcp-a1b2c3d4e5f6g7h8",
    "server_name": null,
    "description": null,
    "type": null,
    "server_type": null,
    "server_status": "ACTIVATED",
    "server_status_text": "已启用",
    "dashscope_endpoint": null,
    "meta_info": null,
    "mcp_config": null
  },
  "request_id": "6f1c2a8e-3b0d-4c55-9a0e-2f7d1c9b8a11"
}

Errors

HTTP statuserror_codeDescription
400OperationNotSupportedThe service is an official MCP
400EnableFailedThe enable operation failed
404McpServerNotFoundThe MCP service does not exist
409McpServerBusyAnother operation is running on the MCP service