
swagger mcp server
用于解析 Swagger/OpenAPI 文件并提供工具查询和分析 API 端点。
Repository Info
About This Server
用于解析 Swagger/OpenAPI 文件并提供工具查询和分析 API 端点。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Swagger MCP Server
這是一個 Model Context Protocol (MCP)服務,用於解析 Swagger/OpenAPI 規格文件,並提供工具來查詢和分析 API 端點。
功能
- 支持通過文件路徑或 URL 獲取 Swagger/OpenAPI 文檔
- 支持 Swagger 2.0 和 OpenAPI 3.0 格式
- 提供 API 端點列表查詢,支持指定深度和過濾條件
- 提供 API 端點詳細信息查詢
- 提供符合 MCP 規範的工具接口,支持與 Claude 或其他 AI 助手的集成
安裝
# 使用bun安裝依賴
bun install
使用方法
從本地文件啟動
bun run src/index.ts --file examples/petstore.json
從 URL 啟動
bun run src/index.ts --url https://petstore.swagger.io/v2/swagger.json
MCP 工具
listEndpoints
獲取 API 端點列表,支持指定深度和過濾條件。
參數:
depth:查詢深度級別,例如深度為 1 只返回第一級路徑filter:前綴過濾條件,只返回符合指定前綴的端點
示例:
{
"depth": 2,
"filter": "/pets"
}
getEndpointDetail
獲取特定 API 端點的詳細信息。
參數:
path:API 端點的完整路徑method:HTTP 方法(GET, POST, PUT, DELETE 等)
示例:
{
"path": "/pets",
"method": "get"
}
MCP 資源
swagger-info
獲取 Swagger 文檔的信息。
URI 格式:swagger-info://{type}
類型:
general:獲取一般信息,如標題、版本、描述等paths:獲取路徑信息schemas:獲取數據模型信息
示例:
swagger-info://general
swagger-info://paths
swagger-info://schemas
開發
構建
bun run build
運行測試
bun test
許可證
MIT
Quick Start
Clone the repository
git clone https://github.com/vanisoul/swagger-mcp-serverInstall dependencies
cd swagger-mcp-server
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.