GetMcpServer - 查询MCP Server详情

更新时间:
复制为 MD 格式

获取MCP server。

接口说明

接口支持创建多个服务。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

apig:GetMcpServer

none

*全部资源

*

请求语法

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

路径参数

名称

类型

必填

描述

示例值

mcpServerId

string

MCP Server ID

mcp-adfefz24afg

请求参数

名称

类型

必填

描述

示例值

当前API无需请求参数

返回参数

名称

类型

描述

示例值

object

Schema of Response

requestId

string

Id of the request

2A6E90D5-A711-54F4-A489-E33C2021EDDF

code

string

响应码。

Ok

message

string

响应消息

Success

data

object

响应数据。

mcpServerId

string

MCP Server ID

mcp-adfefz24afg

name

string

MCP Server 名称

test-mcp

type

string

MCP Server 类型

RealMCP

description

string

描述。

测试专用MCP Server

gatewayId

string

网关实例 ID

gw-cq2vundlhtg***

environmentId

string

环境 id。

env-cq7l5s5lhtgi6qasrdc0

routeId

string

路由 ID。

hr-cr82undlhtgrlej***

createFromType

string

创建来源类型

ApiGatewayHttpToMCP 网关托管 HTTP 转 MCP ApiGatewayMcpHosting 网关托管 MCP 直接代理 ApiGatewayAssembly 网关 MCP 组装 NacosHttpToMCP 网关托管 NACOS 同步 HTTP 转 MCP NacosMcpHosting 网关托管 NACOS 同步 MCP 直接代理

ApiGatewayHttpToMCP

backend Backend

路由的后端服务。

match HttpRouteMatch

路由 Match 规则。

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

domainIds

array

域名 ID 列表。

string

域名 ID。

d-aafefqefz

domainInfos

array<object>

域名信息列表

object

protocol

string

协议。

HTTP,HTTPS

name

string

域名

verifyicket

domainId

string

域名 ID。

www.abc.com

protocol

string

服务协议

HTTP

mcpServerPath

string

网关提供的 MCP Server 访问路径

/mcp-servers/test-mcp

exposedUriPath

string

暴露的 URI 路径,当 protocol 为 SSE 或 StreamableHTTP 且 type 为 RealMCP 时必填

/sse

nacosMcpSyncInfo

object

Nacos 同步托管 MCP 信息

importInstanceId

string

Nacos 实例

mse-xxxxx

importNamespace

string

Nacos 命名空间

test-ns

importMcpServerId

string

同步的 MCP Server ID

test-mcp

assembledSources

array<object>

组装源列表,当 type 为 AssemblyMCP 时必填

object

组装源列表,当 type 为 AssemblyMCP 时必填

mcpServerName

string

MCP Server 名称

test-mcp

mcpServerId

string

MCP Server ID

mcp-xdafeafzz

tools

array

MCP 工具列表

string

MCP 工具列表

test-tool

mcpServerConfig

string

HTTP 转 MCP Config

MCP Server配置 base64

mcpServerConfigPluginAttachmentId

string

MCP Server 插件配置挂载 ID

pa-adfaefwaef

deployStatus

string

API 在当前环境的发布状态

Deployed

mcpStatisticsEnable

boolean

是否启用 MCP 可观测,默认 false

false

grayMcpServerConfigs

array<object>

灰度路由配置

array<object>

参数

routeId

string

灰度路由 ID

gray-route-xxx

match HttpRouteMatch

灰度路由匹配规则

backendConfig

object

灰度路由后端配置

scene

string

后端场景

SingleService

services

array<object>

服务配置列表

object

参数

protocol

string

服务协议

HTTP

port

integer

服务端口

8080

weight

integer

服务权重

100

serviceId

string

服务 ID

svc-xxx

version

string

服务版本

v2.0.0

apiId

string

示例

正常返回示例

JSON格式

{
  "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": ""
  }
}

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情