GetMcpServer

更新时间:
复制 MD 格式

Get the MCP server.

Operation description

This API supports creating multiple services.

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

apig:GetMcpServer

none

*All Resource

*

None None

Request syntax

GET /v1/mcp-servers/{mcpServerId} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

mcpServerId

string

No

The ID of the MCP server.

mcp-adfefz24afg

Request parameters

Parameter

Type

Required

Description

Example

No parameters required.

Response elements

Element

Type

Description

Example

object

The response schema.

requestId

string

The ID of the request.

2A6E90D5-A711-54F4-A489-E33C2021EDDF

code

string

The response code.

Ok

message

string

The response message.

Success

data

object

The data returned.

mcpServerId

string

The ID of the MCP Server.

mcp-adfefz24afg

name

string

The name of the MCP Server.

test-mcp

type

string

The type of the MCP Server.

RealMCP

description

string

The description of the MCP Server.

测试专用MCP Server

gatewayId

string

The ID of the gateway instance.

gw-cq2vundlhtg***

environmentId

string

The ID of the environment.

env-cq7l5s5lhtgi6qasrdc0

routeId

string

The ID of the route.

hr-cr82undlhtgrlej***

createFromType

string

Specifies how the MCP Server was created. Valid values:

ApiGatewayHttpToMCP: The API gateway converts HTTP requests to the MCP protocol. ApiGatewayMcpHosting: The API gateway acts as a direct proxy for MCP services. ApiGatewayAssembly: The API gateway assembles responses from multiple MCP services. NacosHttpToMCP: The API gateway converts HTTP requests to the MCP protocol, with service discovery provided by Nacos. NacosMcpHosting: The API gateway acts as a direct proxy for MCP services, with service discovery provided by Nacos.

ApiGatewayHttpToMCP

backend Backend

The backend service of the route.

match HttpRouteMatch

The match rule for the route.

{\"product_code\":\"apigw\"}

domainIds

array

A list of domain name IDs.

string

The ID of the domain name.

d-aafefqefz

domainInfos

array<object>

A list of domain information.

object

protocol

string

The protocol.

HTTP,HTTPS

name

string

The domain name.

verifyicket

domainId

string

The ID of the domain name.

www.abc.com

protocol

string

The service protocol.

HTTP

mcpServerPath

string

The access path to the MCP Server provided by the gateway.

/mcp-servers/test-mcp

exposedUriPath

string

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

/sse

nacosMcpSyncInfo

object

Information about the MCP Server synchronized from Nacos.

importInstanceId

string

The ID of the Nacos instance.

mse-xxxxx

importNamespace

string

The Nacos namespace.

test-ns

importMcpServerId

string

The ID of the synchronized MCP Server.

test-mcp

assembledSources

array<object>

A list of assembly sources. This parameter is required when type is AssemblyMCP.

object

An assembly source.

mcpServerName

string

The name of the MCP Server.

test-mcp

mcpServerId

string

The ID of the MCP Server.

mcp-xdafeafzz

tools

array

A list of MCP tools.

string

An MCP tool.

test-tool

mcpServerConfig

string

The configuration for converting HTTP requests to the MCP protocol.

MCP Server配置 base64

mcpServerConfigPluginAttachmentId

string

The attachment ID of the MCP Server plugin configuration.

pa-adfaefwaef

deployStatus

string

The API's deployment status in the current environment.

Deployed

mcpStatisticsEnable

boolean

Specifies whether to enable MCP observability. The default value is false.

false

grayMcpServerConfigs

array<object>

A list of canary route configurations.

array<object>

A canary route configuration.

routeId

string

The ID of the canary route.

gray-route-xxx

match HttpRouteMatch

The match rule for the canary route.

backendConfig

object

The backend configuration for the canary route.

scene

string

The backend scene.

SingleService

services

array<object>

A list of service configurations.

object

A backend service configuration.

protocol

string

The service protocol.

HTTP

port

integer

The service port.

8080

weight

integer

The service weight.

100

serviceId

string

The ID of the service.

svc-xxx

version

string

The service version.

v2.0.0

apiId

string

Examples

Success response

JSON format

{
  "requestId": "2A6E90D5-A711-54F4-A489-E33C2021EDDF",
  "code": "Ok",
  "message": "Success",
  "data": {
    "mcpServerId": "mcp-adfefz24afg",
    "name": "test-mcp",
    "type": "RealMCP",
    "description": "测试专用MCP Server",
    "gatewayId": "gw-cq2vundlhtg***",
    "environmentId": "env-cq7l5s5lhtgi6qasrdc0\n",
    "routeId": "hr-cr82undlhtgrlej***",
    "createFromType": "ApiGatewayHttpToMCP",
    "backend": {
      "scene": "Single",
      "services": [
        {
          "serviceId": "service-cq2bmmdlhtgj***",
          "name": "item-service",
          "protocol": "HTTP",
          "port": 0,
          "weight": 49,
          "version": "v1"
        }
      ]
    },
    "match": {
      "ignoreUriCase": true,
      "path": {
        "type": "Prefix",
        "value": "/user"
      },
      "headers": [
        {
          "type": "Exact",
          "name": "dev",
          "value": "true"
        }
      ],
      "methods": [
        "GET"
      ],
      "queryParams": [
        {
          "type": "Exact",
          "name": "age",
          "value": "17"
        }
      ]
    },
    "domainIds": [
      "d-aafefqefz"
    ],
    "domainInfos": [
      {
        "protocol": "HTTP,HTTPS",
        "name": "verifyicket",
        "domainId": "www.abc.com"
      }
    ],
    "protocol": "HTTP",
    "mcpServerPath": "/mcp-servers/test-mcp",
    "exposedUriPath": "/sse",
    "nacosMcpSyncInfo": {
      "importInstanceId": "mse-xxxxx",
      "importNamespace": "test-ns",
      "importMcpServerId": "test-mcp"
    },
    "assembledSources": [
      {
        "mcpServerName": "test-mcp",
        "mcpServerId": "mcp-xdafeafzz",
        "tools": [
          "test-tool"
        ]
      }
    ],
    "mcpServerConfig": "MCP Server配置 base64",
    "mcpServerConfigPluginAttachmentId": "pa-adfaefwaef",
    "deployStatus": "Deployed",
    "mcpStatisticsEnable": false,
    "grayMcpServerConfigs": [
      {
        "routeId": "gray-route-xxx",
        "match": {
          "ignoreUriCase": true,
          "path": {
            "type": "Prefix",
            "value": "/user"
          },
          "headers": [
            {
              "type": "Exact",
              "name": "dev",
              "value": "true"
            }
          ],
          "methods": [
            "GET"
          ],
          "queryParams": [
            {
              "type": "Exact",
              "name": "age",
              "value": "17"
            }
          ]
        },
        "backendConfig": {
          "scene": "SingleService",
          "services": [
            {
              "protocol": "HTTP",
              "port": 8080,
              "weight": 100,
              "serviceId": "svc-xxx",
              "version": "v2.0.0"
            }
          ]
        }
      }
    ],
    "apiId": ""
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.