Provides tools for parsing and querying Swagger/OpenAPI documentation to retrieve API paths, HTTP methods, detailed endpoint information, and data model schemas.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@swagger-mcp-toolshow me the details for the GET /user/profile endpoint"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
swagger-mcp-tool
基于 Node.js 的 Swagger MCP Server,用于解析和查询 Swagger/OpenAPI 文档。为 AI 模型提供 Swagger 文档查询工具,辅助生成接口代码。例如:AI 可以查询 Swagger 文档获取接口定义,然后生成对应的 TypeScript 接口代码。
功能
用户使用
1. 准备环境
仅需 Node.js(建议 18+)
2. 准备 Swagger 文档
准备 Swagger/OpenAPI 文档(本地文件路径或远程 URL)。
3. 运行命令
4. 参数说明
第一个参数必填:Swagger 文档的 URL 或本地文件路径
5. MCP 客户端配置(Cursor 示例)
在 Cursor 的 MCP 配置文件中(通常是 ~/.cursor/mcp.json 或项目中的 .cursorrules),添加:
开发
1. 安装 Bun(开发/构建用)
2. 本地开发运行
3. 构建产物(单文件 JS)
构建后目录结构:
4. 一键发布(npm)
可用工具(简述)
list_api_groups:列出 API 分组search_apis:按标签或关键词搜索 APIget_api_detail:获取指定接口的详细定义get_schema:获取数据模型 Schema 定义
许可证
MIT License