mcp-openapi-swagger
Allows for the automatic crawling and parsing of Swagger UI and OpenAPI documentation to retrieve a comprehensive list of API endpoints, summaries, and operation details.
Click on "Deploy 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., "@mcp-openapi-swagger list all endpoints from https://petstore.swagger.io/v2/swagger.json"
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.
mcp-openapi-swagger
一个基于 NodeJS 的 MCP Server:输入 OpenAPI JSON URL 或 Swagger UI URL,自动抓取/解析文档并返回接口清单(summary 级),供 Cursor 的提示词继续处理。
你会得到什么
支持两种输入:
OpenAPI JSON URL(例如
/openapi.json、/v3/api-docs)Swagger UI URL(例如
/swagger-ui/index.html),会自动发现其背后的 spec URL
输出:
method + path + summary + tags + operationId
Related MCP server: openapi-mcp-proxy
安装依赖与构建
npm install
npm run build构建产物在 dist/,并且已配置 bin,可以被 npx 直接执行。
在 Cursor 配置 MCP(npx 启动本地目录)
项目内已提供示例配置:.cursor/mcp.json。
关键配置如下(示例):
{
"mcpServers": {
"openapi-swagger": {
"transport": "stdio",
"command": "npx",
"args": ["-y", "E:/API-MCP"],
"env": {
"OPENAPI_SOURCE_URL": "https://example.com/v3/api-docs"
}
}
}
}把
E:/API-MCP替换成你本机的项目根目录路径。你也可以把
OPENAPI_SOURCE_URL配成 Swagger UI 地址(例如https://example.com/swagger-ui/index.html)。
工具(Tools)
openapi_setSource
缓存一个文档地址,后续 openapi_listEndpoints 可省略入参。
输入:
{ "sourceUrl": "https://example.com/swagger-ui/index.html" }openapi_listEndpoints
抓取并解析 OpenAPI,然后返回接口清单(summary 级)。
输入(两种用法二选一):
{ "sourceUrl": "https://example.com/v3/api-docs" }或(使用已缓存的 source):
{}如果你在
.cursor/mcp.json里配置了OPENAPI_SOURCE_URL,那么第一次调用openapi_listEndpoints直接传{}就能生效。
输出示例:
{
"ok": true,
"source": {
"inputUrl": "https://example.com/swagger-ui/index.html",
"resolvedSpecUrl": "https://example.com/v3/api-docs",
"openapiVersion": "3.0.3"
},
"endpoints": [
{
"method": "GET",
"path": "/pets/{id}",
"operationId": "getPetById",
"summary": "Get a pet",
"tags": ["pets"]
}
]
}失败时输出示例(便于提示词分支处理):
{
"ok": false,
"stage": "fetch/parse/extract",
"inputUrl": "https://example.com/swagger-ui/index.html",
"details": {
"name": "Error",
"message": "Failed to discover spec URL from Swagger UI page"
}
}运行/调试
npm run dev如果你要验证 npx 启动(Cursor 同款):
npx -y E:/API-MCPAvailable Tools
2 toolsopenapi_listEndpointsB
Fetch OpenAPI/Swagger spec and return endpoints summary (method/path/summary/tags).
Inputs: sourceUrl.
openapi_setSourceC
Set OpenAPI/Swagger source URL for later calls.
Inputs: sourceUrl (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have completely distinct purposes: one fetches endpoint summaries from an OpenAPI spec, while the other sets the source URL for that spec. There is no overlap in functionality, making them easy to tell apart.
Both tools follow a consistent naming pattern with the 'openapi_' prefix and descriptive action_noun structure (listEndpoints, setSource). The naming is uniform and predictable throughout the set.
With only 2 tools, the server feels thin for its apparent purpose of interacting with OpenAPI/Swagger specs. Core operations like testing endpoints, validating specs, or detailed querying are missing, making the toolset underpowered for typical API exploration workflows.
The toolset is severely incomplete for OpenAPI/Swagger interaction. While it covers fetching endpoints and setting a source, it lacks essential operations such as testing API calls, retrieving detailed schema information, or validating specs, which are critical for comprehensive API exploration and integration.
Maintenance
Related MCP Connectors
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server for AI access to Swagger by SmartBear.
Capability registry for the agentic economy. Semantic search over verified MCP server listings.
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that crawls API documentation websites and exposes their content to AI models, enabling them to search, browse, and reference API specifications.1MIT
- AlicenseAqualityDmaintenanceAn MCP server that provides tools for exploring large OpenAPI schemas without loading entire schemas into LLM context. Perfect for discovering and analyzing endpoints, data models, and API structure efficiently.914MIT
- AlicenseAqualityDmaintenanceA generic MCP server that dynamically exposes any OpenAPI-documented REST API to LLMs by auto-discovering endpoints. It provides tools for exploring API capabilities and making authenticated requests directly through natural language interfaces.211 npmMIT
- FlicenseAqualityDmaintenanceAn MCP server that lets Claude query, search, and explore OpenAPI specifications from local files. Supports OpenAPI 3.x and Swagger 2.0.4-