返回市场
微信MCP服务器

微信MCP服务器

作者:IBM12 星标更新:2025-10-18

项目介绍

WxMCPServer

WxMCPServer 是一个 webMethods 集成服务器(IS)包,它实现了 MCP 服务器,用于 IBM webMethods 混合集成(IWHI)。
它需要 webMethods 集成服务器webMethods 微服务运行时 来托管。

目录


1. 概述

WxMCPServer 允许您通过企业级集成平台将现有的 API(包括其现有的 API 策略)作为 MCP 工具 进行公开。

它利用了现有的 API 管理基础设施:

  • API 目录
    对 API 管理应用程序或开发者门户中的 API 进行内省,以将其作为 MCP 工具公开。
  • API 网关
    执行日志记录、身份验证和授权等策略。

截图

在当前解决方案方法中,MCP 工具目录 API 与其他业务 API 一起分组到一个 API 产品中。然后使用此 API 产品来检索该产品中所有 API 的元数据(包括 OpenAPI 规范)。


2. 主要优势

  • 复用现有企业的 API 作为可访问的 MCP 工具
  • 保留现有的 API 网关安全性和策略执行
  • 无缝集成到 API 目录进行 API 发现
  • 一个 API 密钥或访问令牌可以访问 MCP 工具目录 API 和同一 API 产品中的所有业务 API

3. 要求

WxMCPServer 需要 IBM webMethods 集成服务器IBM webMethods 微服务运行时 作为服务器(已测试 v11.1 版本)。
为了与 API 管理解决方案集成,必须实现 MCP 工具目录 API

有如何在各种系统上实现此 API 的说明(以及预配置的资产)。

3.1 在 webMethods API 管理中实现工具目录

针对 webMethods API 管理的详细描述

3.2 在 Azure API 管理中实现工具目录

针对 Azure API 管理的详细描述

3.3 在 IBM API Connect 中实现工具目录

针对 IBM API Connect 的详细描述

该方法通常对第三方 API 管理解决方案(“联邦 API 管理”)开放。


4. 角色与职责

  • MCP 主机MCP 客户端 外部组件(不属于此解决方案的一部分),对于使用工具是必需的;例如 Claude Desktop 或 Langflow。
  • WxMCPServer webMethods IS 包实现 MCP 服务器。
  • API 网关 托管业务 API(作为 MCP 工具公开)和 MCP 工具目录 API,从 API 目录中提取 API 元数据。
  • API 目录 允许 AI 开发者请求访问 API 产品并检索 API 密钥或 OAuth 凭据。

下图提供了架构概述:

截图


5. 快速入门

5.1 MCP 工具目录 API

  • 首先决定从哪个 API 管理解决方案获取 工具(即来自现有 API 产品的 API)。遵循这些说明。
  • 在继续使用 WxMCPServer 之前,请单独测试 API。

5.2 webMethods 集成服务器

  • 如果您是 webMethods 集成服务器客户,您可以复用现有的集成服务器运行时环境。
  • 如果您还没有 webMethods 集成服务器,可以下载 webMethods Service Designer 以及集成服务器的嵌入式开发运行时环境。
  • 如果您正在使用 IBM webMethods 混合集成 的 SaaS,您可以复用云运行时环境或注册新的 边缘运行时

5.3 在 webMethods 集成服务器上安装 WxMCPServer 包

  • 如果您在本地运行,可以使用 webMethods Service DesignerwebMethods 包注册表 加载包 WxMCPServer截图

  • 如果您在 IBM webMethods 混合集成(SaaS)中运行,可以将此 GitHub 存储库 作为外部 添加到您的 IBM webMethods 混合集成 项目

5.4 配置 WxMCPServer

  • 使用 全局变量 定义 MCP 服务器范围的设置。使用 API 特定的配置头覆盖每个 MCP 客户端 的这些设置。

5.5 保护 WxMCPServer 实现

如果您不运行本地 MCP 服务器,而是运行用于企业场景的共享服务器,则应将 WxMCPServer API 放在 API 网关前面的 WxMCPServer 实现。理想情况下,将其放入与 MCP 工具目录 API 相同的 API 产品中,以便所有 API 共享相同的凭据(“调用您能列出的,反之亦然”)。 以下是完整的企业架构:

截图

有一个预配置的 存档 适用于 webMethods API 网关,实现了 WxMCPServer API 用于 webMethods API 网关


6. 集成服务器全局变量

您可以为 WxMCPServer 设置默认值,如果未发送相应的 HTTP 头,则使用这些默认值。

注意: MCP 客户端 HTTP 头 始终 优先于默认值。

变量名称是否必需默认值描述
wxmcp.cache.manager.nameWxMCP_Cache_Manager_Default要使用的缓存管理器的名称。
wxmcp.auth.type(无)认证类型:"OAUTH""API_KEY"
wxmcp.tool.catalog.base.url(无)API 网关上的 MCP 工具目录 API 的基础 URL,例如,https://<myWebMethodsAPIGateway>/gateway/WxMCP-Tool-Catalog-wMAPIGW/1.1
wxmcp.api.key.headername条件(无)仅当 wxmcp.auth.type = "API_KEY" 时使用。指定 API 密钥头名称。
wxmcp.tool.header.prefixheader_工具头属性的默认前缀。
wxmcp.tool.query.prefixquery_工具查询参数属性的默认前缀。
wxmcp.tool.path.prefixpath_工具路径参数属性的默认前缀。
wxmcp.tool.response.modeboth工具响应格式:textstructuredboth
wxmcp.response.code.modestdio响应模式:"stdio"(总是 HTTP 200)或 "http"(实际状态码)。

7. 配置示例

7.1 Claude Desktop — stdio | npx | API 密钥

{
  "mcpServers": {
    "mcp-iwhi-apikey-demo": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://<Integration Server Host>:<Integration Server Port>/mcp",
        "--header",
        "auth_type:API_KEY",
        "--header",
        "api_key:<The API Key>",
        "--header",
        "tool_catalog_base_url:https://<webMethods API Gateway Host>:<webMethods API Gateway Port>/gateway/WxMCP-Tool-Catalog/1.1",
        "--header",
        "api_key_headername:<Your API Key header - i.e. x-Gateway-APIKey for webMethods>",
        "--header",
        "tool_header_prefix:header_",
        "--header",
        "tool_query_prefix:query_",
        "--header",
        "tool_path_prefix:path_",
        "--header",
        "tool_response_mode:structured",
        "--header",
        "response_code:http"
      ]
    }
  }
}

7.2 Claude Desktop — stdio | npx | OAuth 样式

{
  "mcpServers": {
    "m  cp-iwhi-oauth-demo": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://<Integration Server Host>:<Integration Server Port>/mcp",
        "--header",
        "auth_type:OAUTH",
        "--header",
        "tool_catalog_base_url:https://<webMethods API Gateway Host>:<webMethods API Gateway Port>/gateway/WxMCP-Tool-Catalog/1.1",
        "--header",
        "oauth_bearer_token:<The bearer token>",
        "--header",
        "tool_header_prefix:header_",
        "--header",
  "tool_query_prefix:query_",
        "--header",
        "tool_path_prefix:path_",
        "--header",
        "tool_response_mode:structured",
        "--header",
        "response_code:http"
      ]
    }
  }
}

7.3 IBM watsonx Orchestrate | Langflow - stdio | uvx | API 密钥

uvx mcp-proxy 
--headers api_key <Your API Key header - i.e. x-Gateway-APIKey for webMethods>
--headers tool_catalog_base_url https://<webMethods API Gateway Host>:<webMethods API Gateway Port>/gateway/WxMCP-Tool-Catalog/1.1
http://<Integration Server Host>:<Integration Server Port>/mcp --transport streamablehttp

7.4 VS Code MCP 服务器 - 可流式传输 HTTP

{
  "servers": {
    "my-wxmcp-http-server": {
      "url": "http://<Integration Server Host>:<Integration Server Port>/mcp",
      "type": "http",
      "headers": {
        "auth_type": "API_KEY",
        "tool_catalog_base_url": "https://<webMethods API Gateway Host>:<webMethods API Gateway Port>/gateway/WxMCP-Tool-Catalog/1.1",
        "api_key": "<Your API Key header - i.e. x-Gateway-APIKey for webMethods>",
        "Content-Type": "application/json",
        "api_key_headername": "x-Gateway-APIKey"
      }
    }
  },
  "inputs": []
}

8. 限制

  • 仅支持 "Content-Type": "application/json" 发送和接收数据到 API。