@abhishekkumar00019/swagger-mcp
@abhishekkumar00019/swagger-mcp
Un servidor dinámico de Model Context Protocol (MCP) que convierte cualquier especificación Swagger 2.0 u OpenAPI 3.x en herramientas MCP invocables sobre la marcha.
Proporciónale cualquier URL de especificación OpenAPI/Swagger en JSON o YAML, y cada endpoint de API se convierte automáticamente en una herramienta interactiva para Claude, Copilot, ChatGPT, Cursor, Windsurf y otros clientes compatibles con MCP.
✨ Características
🔄 Generación dinámica de herramientas — Analiza automáticamente especificaciones Swagger 2.0 y OpenAPI 3.x al iniciar.
🛠️ Cero código repetitivo — Dale una URL de especificación y cada endpoint se expone al instante como una herramienta MCP.
🔐 Soporte de autenticación flexible — Tokens Bearer, claves de API y autenticación básica configurados sin esfuerzo mediante variables de entorno o flags de CLI.
🌐 Resolución inteligente de URL base — Deriva automáticamente la URL base desde la configuración → definición del servidor de la especificación → URL de origen de la especificación.
🔁 Recarga en caliente — Vuelve a obtener y analizar la especificación en vivo en tiempo de ejecución usando la herramienta
_swagger_mcp_reload.📝 Esquemas y descripciones enriquecidos — Traduce los parámetros de OpenAPI y los cuerpos de solicitud a esquemas JSON estrictos para una llamada precisa de herramientas LLM.
⏱️ Tiempos de espera configurables y cabeceras personalizadas — Configura fácilmente cabeceras de solicitud personalizadas y umbrales de tiempo de espera.
Related MCP server: Swagger to MCP
🚀 Inicio rápido
Opción A: Directamente mediante npx (sin necesidad de instalación)
SWAGGER_MCP_SPEC_URL=https://petstore.swagger.io/v2/swagger.json npx @abhishekkumar00019/swagger-mcpOpción B: Instalación global de NPM
npm install -g @abhishekkumar00019/swagger-mcp
SWAGGER_MCP_SPEC_URL=https://petstore.swagger.io/v2/swagger.json swagger-mcpOpción C: Configuración del repositorio local
Clona e instala las dependencias:
git clone https://github.com/itachiuchihadev/swagger-mcp.git cd swagger-mcp npm installCompila el proyecto:
npm run buildEjecuta localmente:
SWAGGER_MCP_SPEC_URL=https://petstore.swagger.io/v2/swagger.json node dist/index.js
⚙️ Configuraciones de clientes MCP
A continuación se muestran configuraciones de ejemplo para clientes MCP populares usando npx @abhishekkumar00019/swagger-mcp.
1. Claude Desktop
Añádelo a tu claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json",
"SWAGGER_MCP_BEARER_TOKEN": "your-api-token-here"
}
}
}
}2. Claude Code (CLI)
Añádelo directamente mediante la CLI de Claude Code:
claude mcp add swagger-mcp -- npx -y @abhishekkumar00019/swagger-mcp --spec-url https://petstore.swagger.io/v2/swagger.jsonO añádelo a .mcp.json en la raíz de tu proyecto:
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}3. GitHub Copilot / VS Code
Añádelo a .vscode/mcp.json en tu espacio de trabajo o en la configuración global de VS Code:
{
"server": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json",
"SWAGGER_MCP_API_KEY": "your-api-key"
}
}
}
}4. Cursor
Añádelo a .cursor/mcp.json o configúralo en Cursor Settings → Features → MCP:
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}5. Windsurf
Añádelo a ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}6. Roo Code / Cline (VS Code Extension)
Añádelo a cline_mcp_settings.json (o roo_code_mcp_settings.json):
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}7. ChatGPT & OpenAI (Custom GPTs / Assistants / API)
Importación directa de especificaciones OpenAPI (acciones nativas de Custom GPT): Los Custom GPTs de ChatGPT admiten especificaciones OpenAPI de forma nativa. Puedes importar directamente la URL de tu especificación Swagger/OpenAPI en JSON/YAML en la sección Actions del Custom GPT Builder sin necesidad de un servidor intermedio.
Mediante la puerta de enlace MCP HTTP/SSE:
Si conectas agentes de ChatGPT o OpenAI a este servidor MCP mediante un puente HTTP/SSE (por ejemplo, usando supergateway o mcp-remote), inicia swagger-mcp con un proxy SSE:
npx supergateway --stdio "npx -y @abhishekkumar00019/swagger-mcp --spec-url https://petstore.swagger.io/v2/swagger.json" --port 80008. Zed Editor
Añádelo a ~/.config/zed/settings.json:
{
"context_servers": {
"swagger-mcp": {
"command": {
"path": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"]
},
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}🔧 Referencia de configuración
Todos los parámetros de configuración pueden proporcionarse mediante variables de entorno o argumentos de CLI. SWAGGER_MCP_SPEC_URL es el único parámetro obligatorio.
Variable de entorno | Argumento de CLI | Obligatorio | Por defecto | Descripción |
|
| Sí | — | URL de la especificación Swagger/OpenAPI |
|
| No | Derivada automáticamente | Sobrescribe la URL base de la API de destino |
|
| No | — | Token Bearer para |
|
| No | — | Valor de la cabecera de API Key |
|
| No |
| Nombre de cabecera personalizado para la API Key |
|
| No | — | Nombre de usuario para la autenticación básica |
|
| No | — | Contraseña para la autenticación básica |
|
| No |
| Tiempo de espera de la solicitud HTTP en milisegundos |
|
| No |
| Cabeceras HTTP adicionales como cadena JSON |
🔑 Ejemplos de autenticación
Se pueden configurar varios métodos de autenticación simultáneamente:
# Bearer Token
SWAGGER_MCP_BEARER_TOKEN=sk-your-token-here
# API Key (Custom Header)
SWAGGER_MCP_API_KEY=your-api-key
SWAGGER_MCP_API_KEY_HEADER=X-Custom-Key
# Basic Auth
SWAGGER_MCP_BASIC_USER=admin
SWAGGER_MCP_BASIC_PASS=secret123[!NOTE] Si se especifican tanto Bearer como Basic Auth, Basic Auth sobrescribirá la cabecera
Authorization. Combina el token Bearer con las cabeceras de API Key si se requieren varias cabeceras.
🏷️ Estrategia de nomenclatura de herramientas
Los endpoints de tu especificación OpenAPI se convierten en herramientas MCP utilizando el siguiente orden de prioridad:
Prioridad | Origen | Ejemplo |
1.º |
|
|
2.º | Tag + Método + Ruta |
|
3.º | Método + Ruta |
|
🧰 Herramientas meta integradas
Herramienta | Descripción |
| Vuelve a obtener y analiza la especificación Swagger en vivo. Útil al desarrollar o actualizar APIs sin reiniciar el servidor. |
📁 Estructura del proyecto
swagger-mcp/
├── package.json
├── tsconfig.json
├── src/
│ ├── index.ts # Entry point & CLI argument parser
│ ├── server.ts # MCP server initialization & tool registration
│ ├── swagger-parser.ts # OpenAPI 2.0/3.x spec fetcher & parser
│ ├── tool-builder.ts # Converts OpenAPI operations -> JSON Schema tools
│ ├── request-handler.ts # Proxies MCP tool calls to HTTP endpoints
│ ├── auth.ts # Authentication header builder
│ ├── config.ts # Environment & CLI configuration manager
│ └── types.ts # Shared TypeScript interfaces
└── dist/ # Compiled JavaScript output📄 Licencia
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
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
Point Gecko at an OpenAPI spec; get first-call-correct, auth-hidden agent tools.
MCP server for AI access to Swagger by SmartBear.
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceDynamically generates MCP tools from Swagger/OpenAPI specifications by extracting swagger.json files at runtime. Enables natural language interaction with any REST API that has Swagger documentation.-
- AlicenseNot gradedqualityNot gradedmaintenanceAutomatically converts Swagger/OpenAPI specifications into dynamic MCP tools, enabling interaction with any REST API through natural language by loading specs from local files or URLs.-
- FlicenseNot gradedqualityDmaintenanceDynamically converts any API with an OpenAPI v3 specification into MCP tools for AI assistants. It supports multiple authentication methods including OAuth2, Bearer tokens, and API keys for flexible integration.-
- AlicenseNot gradedqualityCmaintenanceConverts any OpenAPI/Swagger API specification into MCP tools that AI assistants can use to interact with the API.377MIT
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/itachiuchihadev/swagger_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server