APISIX Model Context Protocol (MCP) 服务器用于在大型语言模型(LLM)与 APISIX Admin API 之间建立桥梁,目标是让用户通过兼容 MCP 的 AI 客户端,以自然语言方式查看和管理 APISIX 中的资源。
用途 该项目面向 Apache APISIX 的运维与管理场景,借助 MCP 协议把 LLM 与 APISIX Admin API 对接,使 AI 客户端可以执行 APISIX 资源的查询与变更操作。
主要能力 支持的操作分为以下几类:
- 通用操作:get_resource(按类型获取资源,如路由、服务、上游等)、delete_resource(按 ID 删除资源)、send_request_to_gateway(向 APISIX 网关发送一个或多个请求)。
- API 资源操作:创建/更新/删除路由(create_route / update_route / delete_route);创建/更新/删除服务(create_service / update_service / delete_service);创建/更新/删除上游(create_upstream / update_upstream / delete_upstream);创建/更新/删除 SSL 证书(create_ssl / update_ssl / delete_ssl);创建或更新 Protobuf 定义(create_or_update_proto);创建或更新流路由(create_or_update_stream_route)。
- 插件操作:获取所有可用插件名称(get_all_plugin_names);获取插件配置(get_plugin_info / get_plugins_by_type / get_plugin_schema);创建/更新插件配置(create_plugin_config / update_plugin_config);创建/更新插件全局规则(create_global_rule / update_global_rule);管理插件元数据(get_plugin_metadata / create_or_update_plugin_metadata / delete_plugin_metadata)。
- 安全配置:获取/创建/更新密钥(get_secret_by_id / create_secret / update_secret);创建或更新消费者、删除消费者(create_or_update_consumer / delete_consumer);获取/创建或更新/删除消费者凭证(get_credential / create_or_update_credential / delete_credential);创建或删除消费者组(create_consumer_group / delete_consumer_group)。
使用方式 在 AI 客户端中配置使用。需先按照 APISIX Getting Started 指南安装并运行 APISIX。可通过 Smithery 为 Claude Desktop 自动安装 APISIX Model Context Protocol Server,也可以使用源码方式:先克隆 apisix-mcp 仓库,再安装依赖并构建项目。随后在 AI 客户端(Cursor、Claude、Copilot 等)中进行相应配置。若需查看或修改 APISIX 中的 Admin API 配置,可参考 Admin API 文档。
适用场景 适合需要通过 AI 客户端以自然语言方式查看和管理 APISIX 资源(路由、服务、上游、SSL、插件配置、消费者、凭证等)的开发与运维人员,也适用于希望让 AI 应用/代理/LLM 通过常见 Python/TypeScript API 发现该 MCP 服务器并搜索、探索相关服务器与工具的场景。
限制 资料中未提供关于收费、价格、平台限制或效果保证的说明。使用前需自行部署并运行 APISIX,并参考 Admin API 文档完成配置。