The MCP API manages MCP services in Alibaba Cloud Model Studio, including query, creation, update, activation, start and stop, deletion, tool invocation, and recommendation.
The MCP API manages MCP services in Alibaba Cloud Model Studio. It covers querying, creating, updating, activating, starting, stopping, and deleting official and custom MCP services, and provides tool listing, tool invocation, and tool recommendation.
Successful responses and business errors use the following structure. The response header contains
type
server_type
server_status
The status text is returned in Chinese.
Service information returned by detail, list, activate, deactivate, disable, enable, and delete operations.
The
Service information returned by create and update operations. Unassigned fields are omitted.
Pagination uses
Before calling the API, configure authentication. For error handling, see MCP API error codes.
Prerequisites
- Alibaba Cloud Model Studio is activated, and an API Key is created.
- A workspace ID is available. Log on to the Model Studio console, open the workspace menu in the upper-right corner, and copy the workspace ID.
Endpoint
workspace_id: the workspace ID.
Response structure
Successful responses and business errors use the following structure. The response header contains x-request-id:
| Field | Type | Description |
|---|---|---|
| success | boolean | Whether the request succeeded. For tool execution, also check data.isError |
| error_code | string / null | Error code. null on success |
| error_msg | string / null | Error message. null on success |
| data | object / array / null | Business data. null on failure |
| request_id | string | Request ID |
Enumerations
type
| Value | Description |
|---|---|
| OFFICIAL | Official MCP |
| CUSTOMER | Custom MCP |
| Value | Description |
|---|---|
| STDIO | Started with npx or uvx and deployed on Function Compute |
| HTTP | Remote Streamable HTTP service |
| SSE | Remote SSE service |
| OPENAPI | Converts an existing HTTP API into an MCP service |
| Value | Custom MCP text | Official MCP text |
|---|---|---|
| INACTIVE | 未启用 | 未开通 |
| ACTIVATING | 部署中 | 开通中 |
| ACTIVATED | 已启用 | 已启用 |
| ACTIVATE_FAILED | 部署失败 | 开通失败 |
| DELETED | 已删除 | - |
Data structures
DetailResponse
Service information returned by detail, list, activate, deactivate, disable, enable, and delete operations.
| Field | Type | Description |
|---|---|---|
| mcp_code | string / null | MCP code |
| server_name | string / null | MCP name |
| description | string / null | MCP description |
| type | string / null | OFFICIAL or CUSTOMER |
| server_type | string / null | STDIO, HTTP, SSE, or OPENAPI |
| server_status | string / null | Service status |
| server_status_text | string / null | Status text |
| dashscope_endpoint | string / null | MCP endpoint. Returned only when the service is enabled or activating |
| meta_info | object / null | Service metadata |
| mcp_config | object / null | Saved configuration of a custom MCP. null for official MCP |
meta_info
| Field | Type | Description |
|---|---|---|
| icon | string / null | Icon URL. Official MCP only |
| provider | string / null | Provider. Official MCP only |
| is_onekey | boolean | Whether the service is a One Key MCP. Official MCP only |
| console_detail_url | string | Console detail URL |
| classification | string / null | Classification name, returned in Chinese. null when not configured |
| activate_user_count | long / null | Total number of activated users |
| call_total_count | long / null | Total number of calls |
| average_call_time | long / null | Average successful call duration of the day, in milliseconds |
| call_success_rate | double / null | Success rate, from 0 to 1 |
meta_info of a custom MCP does not contain icon, provider, or is_onekey.
CreateResponse
Service information returned by create and update operations. Unassigned fields are omitted.
| Field | Type | Description |
|---|---|---|
| mcp_code | string | MCP code |
| server_name | string | MCP name |
| server_status | string | Service status |
| server_status_text | string | Status text |
| activate_fail_reason | string | Deployment failure reason. Returned only when deployment fails |
Request naming
Pagination uses pageNo and pageSize, recommendation count uses topN, and the path parameter uses mcpCode. Request and response fields use snake_case, except for tool results: tool schemas use the MCP protocol fields inputSchema and additionalProperties, and tool results use isError.
API list
| API | Method | Description |
|---|---|---|
| List MCP services | GET /list | Lists official and custom MCP services |
| Create a custom MCP | POST / | Creates and deploys a custom MCP |
| Get MCP details | GET /{mcpCode} | Gets MCP details |
| Update a custom MCP | POST /{mcpCode} | Updates the name, description, or configuration |
| Delete a custom MCP | DELETE /{mcpCode} | Deletes a custom MCP |
| List tools | GET /{mcpCode}/tools | Lists the tools provided by an MCP service |
| Call a tool | POST /{mcpCode}/tools/call | Calls a tool |
| Recommend tools | GET /tools/recommend | Recommends tools based on a natural-language request |
| Activate an official MCP | POST /{mcpCode}/activate | Activates an official MCP |
| Deactivate an official MCP | POST /{mcpCode}/deactivate | Deactivates an official MCP |
| Disable a custom MCP | POST /{mcpCode}/disable | Disables a custom MCP |
| Enable a custom MCP | POST /{mcpCode}/enable | Enables a custom MCP |