GetMcpServer - 查询MCP Server详情

接口说明

接口支持创建多个服务。

调试

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

授权信息

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

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用前面加 * 表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
apig:GetMcpServernone
*全部资源
*

请求语法

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

请求参数

名称类型必填描述示例值
mcpServerIdstring

MCP Server ID

mcp-adfefz24afg

返回参数

名称类型描述示例值
object

Schema of Response

requestIdstring

Id of the request

2A6E90D5-A711-54F4-A489-E33C2021EDDF
codestring

响应码。

Ok
messagestring

响应消息

Success
dataobject

响应数据。

mcpServerIdstring

MCP Server ID

mcp-adfefz24afg
namestring

MCP Server 名称

test-mcp
typestring

MCP Server 类型

RealMCP
descriptionstring

描述。

测试专用MCP Server
gatewayIdstring

网关实例 ID

gw-cq2vundlhtg***
environmentIdstring

环境 id。

env-cq7l5s5lhtgi6qasrdc0
routeIdstring

路由 ID。

hr-cr82undlhtgrlej***
createFromTypestring

创建来源类型

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

ApiGatewayHttpToMCP
backendBackend

路由的后端服务。

matchHttpRouteMatch

路由 Match 规则。

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

域名 ID 列表。

domainIdsstring

域名 ID。

d-aafefqefz
domainInfosarray<object>

域名信息列表

domainInfosobject
protocolstring

协议。

HTTP,HTTPS
namestring

域名

verifyicket
domainIdstring

域名 ID。

www.abc.com
protocolstring

服务协议

HTTP
mcpServerPathstring

网关提供的 MCP Server 访问路径

/mcp-servers/test-mcp
exposedUriPathstring

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

/sse
nacosMcpSyncInfoobject

Nacos 同步托管 MCP 信息

importInstanceIdstring

Nacos 实例

mse-xxxxx
importNamespacestring

Nacos 命名空间

test-ns
importMcpServerIdstring

同步的 MCP Server ID

test-mcp
assembledSourcesarray<object>

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

assembledSourcesobject

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

mcpServerNamestring

MCP Server 名称

test-mcp
mcpServerIdstring

MCP Server ID

mcp-xdafeafzz
toolsarray

MCP 工具列表

toolsstring

MCP 工具列表

test-tool
mcpServerConfigstring

HTTP 转 MCP Config

MCP Server配置 base64
mcpServerConfigPluginAttachmentIdstring

MCP Server 插件配置挂载 ID

pa-adfaefwaef
deployStatusstring

API 在当前环境的发布状态

Deployed
mcpStatisticsEnableboolean

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

false

示例

正常返回示例

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
  }
}

错误码

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