CreateApiMcpServer

更新时间:
复制 MD 格式

Creates an API MCP Server.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

openapiexplorer:CreateApiMcpServer

create

*ApiMcpServer

acs:openapiexplorer::{#accountId}:apimcpserver/*

None None

Request syntax

POST /apimcpserver HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

Create an API MCP Server.

clientToken

string

No

Ensure request idempotence. Generate a unique value from your client for this parameter to guarantee uniqueness across different requests. ClientToken supports only ASCII characters, must not exceed 64 characters, and UUID is recommended. The time-to-live (TTL) is 3 days.

123e4567-e89b-12d3-a456-426655440000

description

string

No

Description of the API MCP Server.

这是一个API MCP服务。

language

string

No

Documentation language for the API MCP Server. You can choose between Chinese or English API reference documentation. Different languages may affect the Large Language Model (LLM) response quality.

ZH_CN

apis

array<object>

Yes

List of APIs to add. Cannot be empty.

object

Yes

API list.

product

string

Yes

Product code.

  • Call the GetRequestLog operation and obtain the product code from the response.

  • Find the product code from the OpenAPI portal URL. For example, the OpenAPI portal URL for Short Message Service is https://api.aliyun.com/product/Dysmsapi. The product code for Short Message Service is Dysmsapi.

Ecs

apiVersion

string

Yes

The POP version of the API exposed to the MCP Server.

2014-05-26

selectors

array

Yes

List of API name matching rules. Cannot be empty.

string

Yes

API name matching rule.

*Bucket

additionalApiDescriptions

array<object>

No

List of additional API description information.

array<object>

No

Additional API description information.

product

string

No

Product code.

  • Call the GetRequestLog operation and obtain the product code from the response.

  • Find the product code from the OpenAPI portal URL. For example, the OpenAPI portal URL for Short Message Service is https://api.aliyun.com/product/Dysmsapi. The product code for Short Message Service is Dysmsapi.

Ecs

apiVersion

string

No

The POP version of the API exposed to the MCP Server.

2014-05-26

apiName

string

No

API name.

DescribeRegions

apiOverrideJson

string

No

API metadata in JSON format. See 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.

{ "summary": "本接口支持根据不同请求条件查询实例列表,并关联查询实例的详细信息。" }

executeCliCommand

boolean

No

Return the CLI execution command instead of actually invoking the API. This mode returns the corresponding CLI command and is suitable for long-running tasks that require execution using Alibaba Cloud CLI.

true

enableOutputSchema

boolean

No

Return the response parameter schema. Enabling this increases the overall size of the API MCP Server. The default value is null, which means the response schema is not returned.

true

toolAlias

string

No

Tool alias. Customize the name, such as list_ecs_regions. It can contain only letters, digits, hyphens (-), and underscores (_). Aliases must be unique.

list_ecs_regions

constParameters

array<object>

No

List of constant input parameters. These parameters are excluded from API parameter parsing output.

object

No

Constant input parameter.

key

string

No

Parameter name. Only top-level parameter names are supported. For ROA-style APIs, you can set body.xx. Values beyond top-level parameters are not allowed.

InstanceId

value

any

No

Parameter value.

1234

prompts

array<object>

No

Prompt configuration list.

array<object>

No

Prompt configuration.

name

string

No

Prompt name.

test

description

string

No

Description.

prompt description

content

string

No

Prompt content. Variables use the {{xxx}} format, where xxx is the variable name defined in the arguments parameter.

prompt正文,{{name}}

arguments

array<object>

No

List of prompt-supported parameters.

object

No

Prompt-supported parameter.

name

string

No

Parameter name.

test

description

string

No

Parameter description.

argument description

required

boolean

No

Whether the parameter is required.

true

name

string

Yes

MCP Server name. It must be 3 to 64 characters long, consist of lowercase letters and digits, and cannot start with a digit. The name must be unique within the same Alibaba Cloud account.

mcp-demo

systemTools

array

No

List of system tools.

string

No

System tool.

FetchRamActionDetails

oauthClientId

string

No

Custom OAuth Client ID when using a custom OAuth configuration.

Supports only Web or Native applications, and the OAuth scope must include /acs/mcp-server.

403*************370

instructions

string

No

MCP instruction. This instructs the Large Language Model (LLM) on how to use this MCP. The client must support the Instructions field in the standard MCP protocol.

test

enableAssumeRole

boolean

No

Enable multi-account access.

true

assumeRoleName

string

No

RAM role name of the destination account used for cross-account operations when multi-account access is enabled.

test

assumeRoleExtraPolicy

string

No

Additional policy for role assumption when multi-account access is enabled. If specified, this policy overrides the role's original permissions.

{ "Version": "1", "Statement": [ { "Effect": "Allow", "Action": [ "ecs:Describe*", "vpc:Describe*", "vpc:List*" ], "Resource": "*" } ] }

publicAccess

string

No

Enable public network access.

on

enableCustomVpcWhitelist

boolean

No

Enable custom VPC whitelist. If disabled, the account-level configuration applies.

true

terraformTools

array<object>

No

List of Terraform Tools.

object

No

Terraform Tool.

code

string

No

Terraform Tool code. Overview of HCL language

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

Terraform Tool name.

test

description

string

No

Terraform Tool description.

terraform tool description

async

boolean

No

Asynchronous execution. After initiating a task, the system immediately processes the next task without waiting for each resource operation to complete.

true

destroyPolicy

string

No

Cleanup policy for temporary resources after task execution completes.

  • NEVER: Never delete resources, regardless of task success or failure.

  • ALWAYS: Always delete all related resources immediately after task completion, regardless of success or failure.

  • ON_FAILURE: Delete resources only if the task fails. Keep resources if the task succeeds.

ON_FAILURE

vpcWhitelists

array

No

VPC whitelist that restricts source traffic when public network access is disabled. If not set or empty, no source restrictions apply.

string

No

Each VPC whitelist entry specifies a source VPC ID.

vpc-j6cgd2if5lg**0xs6m5se

Response elements

Element

Type

Description

Example

object

Response.

requestId

string

Request ID.

9BFC4AC1-6BE4-5405-BDEC-CA288D404812

id

string

ID of the created API MCP Server.

v6ZZ7ftCzEILW***

urls

object

Connection information for the API MCP Server.

sse

string

SSE protocol connection information.

https://openapi-mcp.cn-hangzhou.aliyuncs.com/accounts/xxxx/custom/xxx/id/xxxx/sse

mcp

string

Streamable HTTP protocol connection information. Recommended.

https://openapi-mcp.cn-hangzhou.aliyuncs.com/accounts/xxxx/custom/xxx/id/xxxx/mcp

vpcSse

string

SSE protocol endpoint within VPC.

https://openapi-mcp-cn.vpc-proxy.aliyuncs.com/accounts/xxxx/custom/xxx/id/xxxx/sse

vpcMcp

string

Streamable HTTP protocol endpoint within 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.