MCP Swagger Server 🚀
将 OpenAPI/Swagger 规范转换为 Model Context Protocol (MCP) 格式的服务器
零配置将您的 REST API 转换为 AI 可调用的工具
Languages: English | 中文
🎯 项目简介
MCP Swagger Server 是一个 Monorepo 项目,核心功能是将任何符合 OpenAPI/Swagger 规范的 REST API 转换为 Model Context Protocol (MCP) 格式,让 AI 助手能够理解和调用您的 API。
📦 项目结构
✨ 核心特性
- 🔄 零配置转换: 输入 OpenAPI 规范,立即获得 MCP 工具
- 🎯 AI 原生设计: 专为 Claude、ChatGPT 等 AI 助手优化
- 🔌 多传输协议: 支持 SSE、Streamable 和 Stdio 传输
- 🔐 安全认证: 支持 Bearer Token 认证保护 API 访问
- ⚡ 高性能: 基于 TypeScript 构建,提供完整的类型安全
🚀 快速开始
环境要求
- Node.js ≥ 20.0.0
- pnpm ≥ 8.0.0 (推荐)
安装
快速启动
📖 使用指南
🔧 mcp-swagger-server
包
这是项目的核心包,提供了完整的 MCP 服务器功能。
安装和使用
支持的传输协议
- stdio: 用于命令行集成
- sse: Server-Sent Events,适用于 Web 应用
- streamable: HTTP 流传输,适用于现代 Web 应用
命令行选项
示例
🔐 Bearer Token 认证
mcp-swagger-server
支持 Bearer Token 认证,可以保护需要身份验证的 API 访问。
认证方式
1. 直接指定 Token
2. 环境变量方式
3. 配置文件方式
环境变量配置
创建 .env
文件:
🤖 与 AI 助手集成
Claude Desktop 配置
编程方式使用
🛠️ 开发
构建系统
测试和调试
开发 MCP 服务器
📋 项目状态
包 | 状态 | 描述 |
---|---|---|
mcp-swagger-server | ✅ 可用 | 核心 MCP 服务器,支持多种传输协议 |
mcp-swagger-parser | 🚧 开发中 | OpenAPI 解析器和转换工具 |
mcp-swagger-ui | 🚧 开发中 | Vue.js Web 界面 |
mcp-swagger-api | 🚧 开发中 | NestJS REST API 后端 |
🤝 贡献
欢迎贡献!请先阅读 贡献指南。
📄 许可证
MIT License - 详见 LICENSE 文件。
Built with ❤️ by ZhaoYaNan(ZTE)
This server cannot be installed
A Model Context Protocol (MCP) server that converts OpenAPI/Swagger specifications to MCP format, enabling AI assistants to interact with REST APIs through standardized protocol.
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol (MCP) server implementation for the OpenLedger API. This server provides structured context to AI models according to the MCP specification.Last updated -8TypeScriptApache 2.0
- -securityFlicense-qualityA Model Context Protocol server implementation that enables connection between OpenAI APIs and MCP clients for coding assistance with features like CLI interaction, web API integration, and tool-based architecture.Last updated -28Python
- -securityAlicense-qualityA server that enables interaction with any API that has a Swagger/OpenAPI specification through Model Context Protocol (MCP), automatically generating tools from API endpoints and supporting multiple authentication methods.Last updated -61TypeScriptApache 2.0
- -securityAlicense-qualityA tool that creates MCP (Model Context Protocol) servers from OpenAPI/Swagger specifications, enabling AI assistants to interact with your APIs.Last updated -8319TypeScriptMIT License