All Products
Search
Document Center

API Gateway:CreateMcpServer

Last Updated:Feb 05, 2026

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

object

gatewayIdstringYes

Gateway ID

gw-cq7l5s5lhtgi6qac0
namestringYes

MCP server name

fetch-time
descriptionstringNo

MCP server description

mcp tool fetch time
typestringYes

MCP server type

RealMCP
domainIdsarrayNo

List of domain IDs for the MCP server

stringNo

string

d-cr62ts5lhtglnu***
matchHttpRouteMatchNo

Route matching conditions

backendConfigobjectNo

Backend configuration

scenestringNo

Backend scene type

SingleService
servicesarray<object>No

List of backend services

objectNo

object

protocolstringNo

Service protocol

HTTP
portintegerNo

Service port

8080
weightintegerNo

Service weight

49
serviceIdstringNo

Service ID

svc-crbgq0dlhtgr***
versionstringNo

Service version

2.1.6
protocolstringNo

MCP protocol

HTTP
exposedUriPathstringNo

Exposed URI path for SSE/StreamableHTTP protocols

/sse
assembledSourcesarray<object>No

Assembled MCP server sources

objectNo

object

mcpServerNamestringNo

Source MCP server name

test-mcp
mcpServerIdstringNo

MCP Server ID

mcp-sdfa3qgavz
toolsarrayNo

List of tool names to include

stringNo

string

tool1
mcpStatisticsEnablebooleanNo

Enable MCP statistics

false
createFromTypestringNo

Creation source type

ApiGatewayMcpHosting
grayMcpServerConfigsarray<object>No

Gray route configurations

objectNo

object

routeIdstringNo

Route ID for update operations

gray-route-123
matchHttpRouteMatchNo

Route matching rules

backendConfigobjectNo

Backend configuration for gray route

scenestringNo

Must be SingleService

SingleService
servicesarray<object>No

Exactly one service

objectNo

object

protocolstringNo

Service protocol type

HTTP
portintegerNo

Service port number

8080
weightintegerNo

Service weight for load balancing

100
serviceIdstringNo

Service ID

svc-gray
versionstringNo

Service version

v2.0.0
mcpServerConfigobjectNo

MCP server specification

swaggerConfigstringNo

Raw Swagger/OpenAPI document

swagger.yaml
mcpServerSpecstringNo

Converted MCP server spec YAML

mcp-spec.yaml

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

requestIdstring

Id of the request

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

code

200
messagestring

message

success
dataobject

object

mcpServerIdstring

MCP Server ID

mcp-afegaijoijaoji24a
namestring

MCP server name

test-mcp

Examples

Sample success responses

JSONformat

{
  "requestId": "464F9EA0-1052-51BD-8187-D292AA2D8D24",
  "code": 200,
  "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
2026-01-22The internal configuration of the API is changed, but the call is not affectedView Change Details
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