Creates and immediately deploys a custom MCP service. Supports STDIO, HTTP, SSE, and OPENAPI.
Endpoint
POST /api/v1/mcp/servers
The service is deployed immediately after creation. A successful request returns 201 and a Location header. If deployment fails, the request still returns 201, the status is ACTIVATE_FAILED, and the reason is returned in activate_fail_reason.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| server_name | string | Yes | MCP name. Cannot be blank |
| description | string | Yes | MCP description. Cannot be blank |
| mcp_type | string | Yes | STDIO, HTTP, SSE, or OPENAPI |
| mcp_config | object | Yes | Configuration for the selected mcp_type |
STDIO
| Field | Type | Required | Description |
|---|---|---|---|
| command | string | Yes | npx or uvx |
| args | array<string> | Yes | Non-empty startup arguments. Each item must match [A-Za-z0-9_@./:=,+-]+ |
| env | map<string,string> | No | Environment variables. Names must match [A-Za-z_][A-Za-z0-9_]*. Values must be strings |
| fc_deploy_region | string | No | Function Compute region. Use a region supported by the console |
HTTP / SSE
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | Public HTTP(S) URL. Cannot contain credentials, a # fragment, or backslashes |
| headers | map<string,string> | No | Downstream request headers. Names must be valid HTTP headers. Values cannot contain CR/LF |
/mcp and SSE uses /sse.
OPENAPI
| Field | Type | Required | Description |
|---|---|---|---|
| api_host | string | Yes | Public HTTP(S) URL. Cannot contain a query string, fragment, credentials, or backslashes |
| headers | map<string,string> | No | Downstream request headers. Names must be valid HTTP headers. Values cannot be blank or contain CR/LF |
| api_list | array<Api> | Yes | Non-empty API list |
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Tool name. Cannot be blank and must be unique in api_list |
| description | string | Yes | Tool description. Cannot be blank |
| path | string | Yes | Relative path starting with /. Supports {param} placeholders |
| method | string | Yes | GET or POST |
| content_type | string | No | application/json (default) or application/x-www-form-urlencoded |
| input_params | array<InputParam> | No | Input parameter definitions. Treated as an empty array when omitted |
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Parameter name. Cannot be blank and must be unique at the same level |
| description | string | Yes | Parameter description. Cannot be blank |
| location | string | Required at top level | Query, Path, Header, or Body. Optional for child properties |
| type | string | Yes | String, Number, Integer, Boolean, Object, Array<String>, Array<Number>, Array<Integer>, Array<Boolean>, or Array<Object> |
| required | boolean | No | Whether the parameter is required. Default false |
| properties | array<InputParam> | Depends on type | Required for Object or Array<Object> and cannot be empty |
GET cannot define a top-level Body parameter. Top-level object and array parameters can only be placed in Body. All enumerated values are case-sensitive.
Response
Returns a CreateResponse. Unassigned fields are omitted.
| Field | Type | Description |
|---|---|---|
| mcp_code | string | MCP code |
| server_name | string | MCP name |
| server_status | string | Deployment status |
| server_status_text | string | Status text |
| activate_fail_reason | string | Deployment failure reason. Returned only when deployment fails |
Examples
Create an HTTP MCP
Create an STDIO MCP
Create an OPENAPI MCP
Errors
| HTTP status | error_code | Description |
|---|---|---|
| 400 | InvalidParameter | The request body is missing, a field type is invalid, or a value is invalid |
| 403 | AccessDenied | Function Compute is not authorized, or the target address is not allowed |
| 500 | InternalError | Internal service error |
403. An invalid or unresolvable address returns 400.