Skip to main content

Activate an official MCP

Activates an official MCP service. After submission, the service enters the activating state. Use the details API to check the result.

Endpoint

POST /api/v1/mcp/servers/{mcpCode}/activate Activates an official MCP service. One Key MCP services are activated or ordered according to the product type.

Request parameters

ParameterTypeRequiredDescription
mcpCodestringYesOfficial MCP code
The request body is optional. It supports the following fields:
FieldTypeRequiredDescription
envmap<string,string>Depends on the serviceEnvironment variables. All required variables declared by the service must be provided and cannot be blank
fc_deploy_regionstringNoFunction Compute region. Must match the current region in the console
For MCP services that require a KMS credential or a RAM role, activate the service in the console.

Response

Returns a complete DetailResponse. When activation is newly initiated, some basic fields may be null. Use the status field to track progress.
StatusDescription
ACTIVATINGActivating
ACTIVATEDEnabled
ACTIVATE_FAILEDActivation failed

Example

curl -X POST "https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/mcp/servers/amap-maps/activate" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "env": {
      "AMAP_MAPS_API_KEY": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    }
  }'
{
  "success": true,
  "error_code": null,
  "error_msg": null,
  "data": {
    "mcp_code": "amap-maps",
    "server_name": null,
    "description": null,
    "type": null,
    "server_type": null,
    "server_status": "ACTIVATING",
    "server_status_text": "开通中",
    "dashscope_endpoint": "https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/mcps/amap-maps/mcp",
    "meta_info": {
      "icon": null,
      "provider": null,
      "is_onekey": false,
      "console_detail_url": "https://bailian.console.aliyun.com/store/mcp/detail/amap-maps",
      "classification": "交通物流",
      "activate_user_count": 3000,
      "call_total_count": 120000,
      "average_call_time": 80,
      "call_success_rate": 0.995
    },
    "mcp_config": null
  },
  "request_id": "6f1c2a8e-3b0d-4c55-9a0e-2f7d1c9b8a11"
}

Errors

HTTP statuserror_codeDescription
400InvalidParameterA required environment variable is missing, or the region does not match the console
400OperationNotSupportedThe service is a cloud marketplace MCP, or requires a KMS credential or RAM role
404McpServerNotFoundThe MCP service does not exist
409McpServerBusyAnother operation is running on the MCP service
An activated service may return its current details directly.