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 "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., "@mcp-openapi-swaggerlist 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).
| Name | Required | Description | Default |
|---|---|---|---|
| sourceUrl | No | OpenAPI JSON URL or Swagger UI URL; if omitted uses cached source |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that the tool fetches and returns a summary, but lacks details on behavioral traits such as error handling (e.g., what happens with invalid URLs), caching behavior (e.g., how the cache is managed), rate limits, or authentication needs. The description is minimal and does not compensate for the absence of annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the key action ('Fetch') and output, with no wasted words. It directly communicates the tool's function and parameter implication, making it easy to parse and understand quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (fetching and summarizing API specs), no annotations, no output schema, and 100% schema coverage, the description is minimally adequate. It covers the basic purpose and parameter use but lacks details on output format, error handling, or integration with the sibling tool, leaving gaps in completeness for effective agent use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents the single parameter 'sourceUrl' as an optional URI. The description adds marginal value by clarifying that it's for 'OpenAPI JSON URL or Swagger UI URL' and mentions 'if omitted uses cached source', which provides context beyond the schema's format and optionality. This aligns with the baseline score of 3 when schema coverage is high.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('Fetch') and resource ('OpenAPI/Swagger spec'), and specifies the output format ('endpoints summary (method/path/summary/tags)'). It distinguishes from the sibling tool 'openapi_setSource' by focusing on fetching and summarizing rather than setting the source. However, it doesn't explicitly differentiate the scope or limitations compared to the sibling beyond the different action.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by stating it fetches from a URL or uses a cached source, which suggests when to provide the 'sourceUrl' parameter. However, it lacks explicit guidance on when to use this tool versus the sibling 'openapi_setSource' (e.g., for initial setup vs. retrieval), and does not mention any prerequisites, exclusions, or alternative scenarios beyond the optional parameter.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
openapi_setSourceC
Set OpenAPI/Swagger source URL for later calls.
| Name | Required | Description | Default |
|---|---|---|---|
| sourceUrl | Yes | OpenAPI JSON URL or Swagger UI URL |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states this sets a source URL for later use, implying a configuration or initialization action, but lacks details on permissions, persistence, error handling, or side effects. This is a significant gap for a tool that likely mutates state.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it highly concise and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, and the tool's likely role in configuration or state mutation, the description is insufficient. It doesn't explain what happens after setting the source, how errors are handled, or the scope of 'later calls', leaving critical gaps for agent understanding.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, with the parameter 'sourceUrl' fully documented in the schema as a URI for OpenAPI JSON or Swagger UI. The description adds no additional semantic context beyond what the schema provides, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Set') and the resource ('OpenAPI/Swagger source URL'), specifying it's for configuring a source for subsequent operations. It doesn't explicitly differentiate from the sibling tool 'openapi_listEndpoints', which appears to be a read operation, but the purpose is well-defined.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description mentions 'for later calls', implying this tool should be used to configure a source before making API calls, but it provides no explicit guidance on when to use it versus alternatives, prerequisites, or exclusions. No comparison to the sibling tool is made.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v0.1.0- First observed
openapi_listEndpoints - First observed
openapi_setSource
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
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.214MIT
- FlicenseAqualityDmaintenanceAn MCP server that lets Claude query, search, and explore OpenAPI specifications from local files. Supports OpenAPI 3.x and Swagger 2.0.4-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Leivoo/APIMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server