All Products
Search
Document Center

API Gateway:CreateMcpServer

Last Updated:Dec 17, 2025

Creates an MCP server.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
apig:CreateMcpServernone
*All Resources
*
    none
none

Request syntax

POST /v1/mcp-servers HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

The request body.

gatewayIdstringYes

The ID of the gateway.

gw-cq7l5s5lhtgi6qac0
namestringYes

The name of the MCP server. The name must match the regular expression ^a-z0-9?(.a-z0-9?)*$ and can be up to 64 characters in length.

fetch-time
descriptionstringNo

The MCP server description.

mcp tool fetch time
typestringYes

The type. Valid value:

RealMCP: regular MCP service

RealMCP
domainIdsarrayNo

The domain IDs.

stringNo

The domain ID.

d-cr62ts5lhtglnu***
matchHttpRouteMatchNo

The route match rule.

backendConfigobjectNo

The backend service configurations for the route.

scenestringNo

The scenario of the backend service.

SingleService
servicesarray<object>No

The backend services.

objectNo

The backend service.

protocolstringNo

The service protocol. Valid values:

  • HTTP
  • HTTPS
HTTP
portintegerNo

The backend node port of the service.

8080
weightintegerNo

The weight.

49
serviceIdstringNo

The service ID.

svc-crbgq0dlhtgr***
versionstringNo

The service version.

2.1.6
protocolstringNo

The protocol type. Valid values: HTTP, HTTPS, SSE, and StreamableHTTP

HTTP
exposedUriPathstringNo

The exposed URI path. This parameter is required when the protocol parameter is set to SSE or StreamableHTTP, and the type parameter is set to RealMCP.

/sse
assembledSourcesarray<object>No

The list of assembly sources. This parameter is required when the type parameter is set to AssemblyMCP.

objectNo

The assembly source. This parameter is required when the type parameter is set to AssemblyMCP.

mcpServerNamestringNo

The name of the MCP server.

test-mcp
mcpServerIdstringNo

The MCP server ID.

mcp-sdfa3qgavz
toolsarrayNo

The list of the MCP tools.

stringNo

The MCP tool information.

tool1
mcpStatisticsEnablebooleanNo

Specifies whether MCP observability is enabled. Default: false.

false
createFromTypestringNo

Creates the MCP server from the specified type.

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

requestIdstring

The request ID.

464F9EA0-1052-51BD-8187-D292AA2D8D24
codestring

The status code.

Ok
messagestring

The status message.

success
dataobject

The response payload.

mcpServerIdstring

The ID of the MCP server.

mcp-afegaijoijaoji24a
namestring

The name of the MCP server.

test-mcp

Examples

Sample success responses

JSONformat

{
  "requestId": "464F9EA0-1052-51BD-8187-D292AA2D8D24",
  "code": "Ok",
  "message": "success",
  "data": {
    "mcpServerId": "mcp-afegaijoijaoji24a",
    "name": "test-mcp"
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2025-12-05The internal configuration of the API is changed, but the call is not affectedView Change Details
2025-11-06The internal configuration of the API is changed, but the call is not affectedView Change Details