Creates an API MCP service.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
openapiexplorer:CreateApiMcpServer |
create |
*ApiMcpServer
|
None | None |
Request syntax
POST /apimcpserver HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
Creates an API MCP service. |
|
| clientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. Generate a unique value from your client. The ClientToken value can contain only ASCII characters and cannot exceed 64 characters in length. We recommend that you use a UUID. The token expires after 3 days. |
123e4567-e89b-12d3-a456-426655440000 |
| description |
string |
No |
The description of the API MCP service. |
This is an API MCP service. |
| language |
string |
No |
The document language of the API MCP service. You can select Chinese or English API documentation. Different languages may produce different results in AI responses. Valid values:
|
ZH_CN |
| apis |
array<object> |
Yes |
The list of APIs to add. This parameter cannot be empty. |
|
|
object |
Yes |
The API list. |
||
| product |
string |
Yes |
The product code. |
Ecs |
| apiVersion |
string |
Yes |
The POP version to which the API exposed to the MCP SERVER belongs. |
2014-05-26 |
| selectors |
array |
Yes |
The list of API name matching rules. This parameter cannot be empty. |
|
|
string |
Yes |
The API name matching rule. |
*Bucket |
|
| additionalApiDescriptions |
array<object> |
No |
The list of supplementary API descriptions. |
|
|
array<object> |
No |
The supplementary API description. |
||
| product |
string |
No |
The product code. |
Ecs |
| apiVersion |
string |
No |
The POP version to which the API exposed to the MCP SERVER belongs. |
2014-05-26 |
| apiName |
string |
No |
The API name. |
DescribeRegions |
| apiOverrideJson |
string |
No |
The API metadata in JSON format. Refer to the format at https://api.aliyun.com/meta/v1/products/Ecs/versions/2014-05-26/apis/DescribeInstances/api.json. You can override the summary and parameters fields. |
{ |
| executeCliCommand |
boolean |
No |
Specifies whether to return the CLI execute command. In this mode, the API call is not actually executed. Instead, the corresponding CLI command is returned. This is suitable for long-running tasks that require execution with Cloud Assistant CLI. |
true |
| enableOutputSchema |
boolean |
No |
Specifies whether to return the output parameter schema. Returning the output parameter schema increases the overall size of the API MCP SERVER. The default value is null, which indicates that the output parameter schema is not returned. |
true |
| toolAlias |
string |
No |
The tool alias. You can set a custom name such as list_ecs_regions. The alias can contain letters, digits, hyphens (-), and underscores (_). Aliases must be unique. |
list_ecs_regions |
| constParameters |
array<object> |
No |
The list of constant parameters. These parameters are not included in the output during API parameter parsing. |
|
|
object |
No |
The constant parameter. |
||
| key |
string |
No |
The parameter name. Only first-level parameter names are supported. For ROA-style APIs, you can set it to body.xx. Setting values beyond the top-level parameter is not allowed. |
InstanceId |
| value |
any |
No |
The value of the parameter. |
1234 |
| prompts |
array<object> |
No |
The list of prompt configurations. |
|
|
array<object> |
No |
The prompt configuration. |
||
| name |
string |
No |
The prompt name. |
test |
| description |
string |
No |
The description. |
prompt description |
| content |
string |
No |
The content of the prompt. Variables are specified in the {{xxx}} format, where xxx is a variable that must be defined in the arguments parameter. |
Prompt body, {{name}} |
| arguments |
array<object> |
No |
The list of parameters supported by the prompt. |
|
|
object |
No |
The parameter supported by the prompt. |
||
| name |
string |
No |
The parameter name. |
test |
| description |
string |
No |
The description of the parameter. |
argument description |
| required |
boolean |
No |
Specifies whether the parameter is required. |
true |
| name |
string |
Yes |
The MCP SERVER name. The name must consist of lowercase letters (a-z) and digits (0-9), be 3 to 64 characters in length, cannot start with a digit, and must be unique within the same Alibaba Cloud account. |
mcp-demo |
| systemTools |
array |
No |
The list of system tools. |
|
|
string |
No |
The system tool. |
FetchRamActionDetails |
|
| oauthClientId |
string |
No |
The custom OAuth Client ID used when a custom OAuth configuration is selected. |
403*************370 |
| instructions |
string |
No |
The MCP instructions that guide the large language model on how to use this MCP. The client must support the Instructions field in the MCP standard protocol. |
test |
| enableAssumeRole |
boolean |
No |
Specifies whether to enable multi-account access. |
true |
| assumeRoleName |
string |
No |
The name of the RAM role to assume in the target account when performing cross-account operations with multi-account access enabled. |
test |
| assumeRoleExtraPolicy |
string |
No |
The additional policy for role assumption when multi-account access is enabled. When this policy is specified, the permissions for role assumption are based on this value, overriding the permissions defined in the role itself. |
{ "Version": "1", "Statement": [ { "Effect": "Allow", "Action": [ "ecs:Describe*", "vpc:Describe*", "vpc:List*" ], "Resource": "*" } ] } |
| publicAccess |
string |
No |
Specifies whether to enable public network access. Valid values:
Valid values:
|
on |
| enableCustomVpcWhitelist |
boolean |
No |
Specifies whether to enable a custom VPC whitelist. If this feature is not enabled, the account-level configuration is used. |
true |
| terraformTools |
array<object> |
No |
The list of Terraform tools. |
|
|
object |
No |
Terraform Tool。 |
||
| code |
string |
No |
The Terraform tool code. HCL language overview |
variable "name" { default = "terraform-example" } provider "alicloud" { region = "cn-beijing" } resource "alicloud_vpc" "default" { ipv6_isp = "BGP" description = "test" cidr_block = "10.0.0.0/8" vpc_name = var.name enable_ipv6 = true } |
| name |
string |
No |
The Terraform tool name. |
test |
| description |
string |
No |
The Terraform tool description. |
terraform tool description |
| async |
boolean |
No |
Specifies whether to execute asynchronously. When enabled, the system proceeds to the next task immediately after initiating a task, without waiting for each resource operation to complete. |
true |
| destroyPolicy |
string |
No |
The deletion policy. After a task is completed, the system applies the following cleanup policies to temporary resources based on the task execution status. Valid values:
Valid values:
|
ON_FAILURE |
| vpcWhitelists |
array |
No |
The VPC whitelist that restricts the source VPCs when public network access is disabled. If this parameter is not set or is empty, no source restriction is applied. |
|
|
string |
No |
The VPC whitelist entry. The value is the source VPC ID. |
vpc-j6cgd2if5lg**0xs6m5se |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response. |
||
| requestId |
string |
The request ID. |
9BFC4AC1-6BE4-5405-BDEC-CA288D404812 |
| id |
string |
The ID of the API MCP service that was created. |
v6ZZ7ftCzEILW*** |
| urls |
object |
The connection information of the API MCP service. |
|
| sse |
string |
The SSE protocol connection information. |
https://openapi-mcp.cn-hangzhou.aliyuncs.com/accounts/xxxx/custom/xxx/id/xxxx/sse |
| mcp |
string |
The streamable HTTP protocol connection information. This is the recommended option. |
https://openapi-mcp.cn-hangzhou.aliyuncs.com/accounts/xxxx/custom/xxx/id/xxxx/mcp |
| vpcSse |
string |
The SSE protocol endpoint within a VPC. |
https://openapi-mcp-cn.vpc-proxy.aliyuncs.com/accounts/xxxx/custom/xxx/id/xxxx/sse |
| vpcMcp |
string |
The streamable HTTP protocol endpoint within a VPC. |
https://openapi-mcp-cn.vpc-proxy.aliyuncs.com/accounts/xxxx/custom/xxx/id/xxxx/mcp |
Examples
Success response
JSON format
{
"requestId": "\t\n9BFC4AC1-6BE4-5405-BDEC-CA288D404812\n",
"id": "v6ZZ7ftCzEILW***",
"urls": {
"sse": "https://openapi-mcp.cn-hangzhou.aliyuncs.com/accounts/xxxx/custom/xxx/id/xxxx/sse",
"mcp": "https://openapi-mcp.cn-hangzhou.aliyuncs.com/accounts/xxxx/custom/xxx/id/xxxx/mcp",
"vpcSse": "https://openapi-mcp-cn.vpc-proxy.aliyuncs.com/accounts/xxxx/custom/xxx/id/xxxx/sse",
"vpcMcp": "https://openapi-mcp-cn.vpc-proxy.aliyuncs.com/accounts/xxxx/custom/xxx/id/xxxx/mcp"
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParam.Name | Name must be 3 to 64 characters long and can only contain lowercase letters, numbers, underscore, and hyphens. | The name must be 3 to 64 characters in length and can contain only lowercase letters, numbers, underscores, and hyphens. |
| 400 | InvalidParam.Apis.PopVersion | Unsupported product version: %s of product code: %s. | Product% s does not support xxx version. |
| 400 | IdempotentParameterMismatch | The request uses the same client token as a previous request but with different parameters. Client tokens should not be reused across non-identical requests. Each unique request must have a distinct client token. | The request used the same client token as the previous request, but with different parameters. Do not reuse the same token in requests with different parameters. Each request must use a unique token. |
| 400 | Missing.Apis.PopCode | Apis.PopCode is mandatory for this action. | The required parameter popCode is missing in the Apis parameter. |
| 400 | Missing.Apis.PopVersion | Apis.PopVersion is mandatory for this action. | Apis.PopVersion is mandatory for this action. |
| 400 | InvalidParam.Apis.PopCode | Unsupported product code: %s. | The specified product name does not exist |
| 400 | Missing.Apis.Selectors | Apis.Selectors is mandatory for this action. | Apis.Selectors is a required parameter |
| 400 | Missing.Name | Name is mandatory for this action. | |
| 400 | Missing.Apis | Apis is mandatory for this action. | Missing required parameter Apis |
| 400 | InvalidParam.Language | Unsupported language: %s. | Specify multilingual wu'xi |
| 400 | InvalidParam.AdditionalApiDescription.PopVersion | Unsupported product version: %s of product code: %s. | Product% s does not support version% s. |
| 400 | InvalidParam.AdditionalApiDescription.PopCode | Unsupported product code: %s. | The specified product does not exist |
| 400 | InvalidParam.SystemTools | System tool %s is not supported. | |
| 400 | Missing.TerraformTools.Description | TerraformTools.Description is mandatory for this action. | Missing required parameter TerraformTools.Description |
| 400 | Missing.TerraformTools.Code | TerraformTools.Code is mandatory for this action. | The required parameter TerraformTools.Code is missing. |
| 400 | Missing.TerraformTools.Name | TerraformTools.Name is mandatory for this action. | |
| 400 | InvalidParam.TerraformTools.Name | TerraformTools.Name: %s must be 3 to 64 characters long and can only contain lowercase letters, numbers, underscores, and hyphens. | The Terraform tool name must be 3 to 63 characters in length and can contain only lowercase letters, numbers, underscores, and hyphens. |
| 400 | Missing.AccountId | x-acs-account-id is mandatory in request header for this action. | The required parameter x-acs-account-id is missing in the request header. |
| 400 | Missing.CallerUid | x-acs-caller-uid is mandatory in request header for this action. | The required parameter x-acs-caller-uid is missing in the request header. |
| 400 | Missing.PrincipalId | x-acs-sts-token-principal-id is mandatory in request header in STS assumeRole scenario for this action. | In the STS role-playing scenario, the required parameter x-acs-sts-token-principal-id is missing in the request header. |
| 400 | InvalidParam.TerraformTools.Code | The Terraform tool code is not valid: %s. Please check the syntax and try again. | The specified TerraformTools.Code parameter is invalid. |
| 400 | InvalidParam.ClientToken | The specified client token is not valid. | The idempotent parameter is incorrect, please check. |
| 400 | InvalidParam.AdditionalApiDescription.ToolAlias | ToolAlias '%s' is invalid. It must be 1-64 characters, start with a letter, and contain only letters, digits, underscores, and hyphens. | |
| 429 | QuotaExceeded | The number of MCP server created by the user has reached the upper limit. | The number of MCP server created by the user has reached the upper limit. |
| 409 | Exists.Name | The MCP server name already exists. | |
| 409 | Exists.TerraformTools.Name | The Terraform tool name already exists. | The specified Terraform tool name already exists. |
| 409 | Exists.ToolAlias | Duplicate tool alias '%s' found. Each tool alias must be unique within an MCP server. | |
| 409 | Conflict.ToolAlias | Tool alias '%s' conflicts with an existing tool name in this MCP server. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.