MCP-DOC-MID
Provides tools to query, inspect, and generate code from Swagger/OpenAPI API specifications, including endpoint search, schema retrieval, payload validation, and client code generation.
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-DOC-MIDsearch the middleware-api spec for flight booking endpoints and generate a TypeScript client for it"
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-DOC-MID: MCP Server for OpenAPI and Integration Generation
Enterprise-grade server for the Model Context Protocol (MCP) ecosystem in Node.js (ES Modules), specialized in learning, dereferencing ($ref), and allowing an LLM to query OpenAPI/Swagger specifications and generate production-ready code integrations.
It uses @apidevtools/swagger-parser to resolve all pointers and component schemas in memory at server startup, and exposes a catalog of 8 MCP tools designed for search, inspection, validation, and generation of HTTP clients in multiple languages (TypeScript, Python, JavaScript, cURL, C#).
📚 Detailed Documentation
For specialized guides and complete diagrams, see:
🏛️ System Architecture Guide (
docs/ARCHITECTURE.md): Flow diagrams, Session Binding, observability, atomic persistence, and Circuit Breaker.🛠️ MCP Tools Reference (
docs/TOOLS_REFERENCE.md): Exhaustive detail of parameters, JSON schemas, and response examples for each tool.📂 Swagger / OpenAPI Files Guide (
docs/SWAGGER_GUIDE.md): Instructions for adding, validating, and organizing.ymland.jsonspecifications.📋 Doters API Internal Structural Specification (
docs/MIDDLEWARE_API_SPEC.md): Analysis of the 110 endpoints, 221 DTOs, response wrappers, and 25 domains inmiddleware-api.json.
Related MCP server: mcp-swagger
🏛️ Main Features
Automatic Reading and Dereferencing (
swaggers/):Recursive scanning of
.yml,.yaml, and.jsonfiles.Complete resolution of
$refreferences in components, parameters, and models.
Code Integration Generation for LLMs:
generate_integration_code: Generate strongly typed snippets and clients for any endpoint.Support for TypeScript (
fetch/axios), JavaScript, Python (httpx/requests), cURL, and C#.
Security Validation and Extraction:
validate_payload: Check in advance that a JSON payload meets required types and fields.get_security_schemes: Extract authentication schemes (Bearer tokens, API keys, OAuth2).
Dual Transport:
STDIO: Standard integration with Claude Desktop, Antigravity, Cursor, and MCP extensions.
SSE / HTTP: Express server with
/sse,/messages,/metrics,/health, and/dashboard.
Observability and Security:
Logs directed exclusively to
process.stderrwith Pino.Prometheus metrics (
prom-client) at/metrics.Session Binding and protection against Session Hijacking at
/messages.
🛣️ The 3-Step Integration Flow (Zero-Code)
To make integrating new APIs 100% scalable, friction-free, and without touching a single line of code, the server implements Auto-discovery and Convention-Based Loading:
flowchart LR
A["1. Copiar Archivo\n(swaggers/mi-api.json o .yml)"] --> B["2. Auto-Discovery & Caching\n(Hash SHA-256 + Dereference)"]
B --> C["3. Auto-Diagnóstico\n(npm run self-test)"]
C --> D["✅ Disponible en las 8 Tools MCP\n(search_docs, get_endpoint_doc, etc.)"]1️⃣ Step 1: Place the File in swaggers/
Simply save your .json, .yml, or .yaml file into the swaggers/ folder.
1. Recommended Scalable Structure (By Domains or Microservices):
The scanner is recursive, so you can organize your files into themed subfolders as the number of APIs grows:
swaggers/
├── middleware-api.json # API Core Middleware
├── partners/
│ ├── avasa-car-rental.json # Swagger de Avasa
│ └── iamsa-bus.json # Swagger de IAMSA
├── payments/
│ └── openpay-gateway.yml # OpenAPI de Pasarelas de Pago
└── flights/
└── viva-booking.yaml # OpenAPI de Reservaciones Viva[!TIP] Automatic Identifier (
specId):
The system automatically generates thespecIdfrom the file's base name:
avasa-car-rental.json$\rightarrow$specId: "avasa-car-rental"
openpay-gateway.yml$\rightarrow$specId: "openpay-gateway"
my-api.json$\rightarrow$specId: "my-api"
2️⃣ Step 2: Verify Integrity with npm run self-test
You don't need to start MCP clients or blindly restart servers. Run in your terminal:
npm run self-testWhat does this command do in < 15 ms?
Detect the new file and calculate its SHA-256 hash.
Automatically resolve and dereference all
$refpointers.Clean up broken or missing references so the server never crashes.
Generate the high‑performance snapshot in
.cache/swaggers/.Show the real‑time summary:
{
"status": "healthy",
"checks": {
"swaggers": {
"status": "pass",
"specsCount": 4,
"endpointsCount": 285,
"schemasCount": 412
}
}
}3️⃣ Step 3: Ready for Agents and LLMs to Consult
Immediately, the 8 MCP tools learn the new endpoints and schemas with no additional configuration:
Global search:
search_docs({ query: "renta autos" })will search across all swaggers at once.Filtered search:
search_docs({ query: "renta", specId: "avasa-car-rental" })queries that API exclusively.Code generation:
generate_integration_code({ path: "/v1/cars/book", language: "typescript" })will generate the typed client.Payload validation:
validate_payload({ schemaName: "CarBookingDto", payload: { ... } })will validate against the new model.
🏆 Best Practices for Maximum Quality in the LLM
So that language models generate the best code and accurate responses when reading your new swaggers:
Declare the Base URL (
servers):servers: - url: https://api.vivaaerobus.com/v1 description: Ambiente de ProducciónInclude Examples in the Schemas (
example/examples): Examples allow thegenerate_integration_codetool and the LLM to automatically create realistic test payloads.Use Clear Tags (
tags): Grouping by tags (e.g.[ "CarRental", "Payments", "Security" ]) allows agents to quickly filter endpoint collections withsearch_docs({ tag: "Payments" }).Declare the Security (
components.securitySchemes): Specify whether it usesbearerFormat: JWT,ApiKey, orOAuth2so that theget_security_schemestool exposes the required headers.
🛠️ Available MCP Tools
Tool | Description | Main Parameters |
Lists all loaded APIs with their versions, servers, and route counts. | None | |
Searches endpoints, models, and descriptions by keywords. |
| |
Gets the complete, dereferenced specification of an endpoint. |
| |
Gets the dereferenced data/schema model. |
| |
Generates production‑ready client code (TS, Python, JS, cURL, C#). |
| |
Gets authentication schemes and the required headers. |
| |
Validates a JSON payload against an endpoint's schema before invoking it. |
| |
Synthesizes answers to business or architectural questions about the APIs. |
|
⚙️ Environment Variables (.env)
Variable | Description | Default Value |
| Transport mode ( |
|
| Listening port for SSE/HTTP mode |
|
| Log level ( |
|
| Secret key for API authentication |
|
| Enable/disable authentication ( |
|
| Allowed origins for CORS |
|
| User for web dashboard access |
|
| Password for web dashboard access |
|
| Time window for Rate Limit in ms |
|
| Maximum requests per window |
|
| Persist statistics to disk |
|
| Persistence file path |
|
| Folder for OpenAPI specifications |
|
🚀 Quick Start
# 1. Instalar dependencias
npm install
# 2. Autodiagnóstico en runtime (<5ms)
npm run self-test
# 3. Iniciar en modo STDIO (predeterminado)
npm start
# 4. Iniciar en modo SSE / HTTP (servidor web)
TRANSPORT_MODE=sse PORT=3000 npm start🧪 Automated Tests and Benchmarks
The project includes a comprehensive test suite with 116 passing tests (100%) and coverage above 93% in statements:
# 1. Ejecutar suite completa de pruebas unitarias y de integración
npm test
# 2. Reporte de cobertura detallado con Vitest y V8 (>93% Stmts)
npm run test:coverage
# 3. Pruebas de carga de alta concurrencia (100 agentes concurrentes)
npm run test:load
# 4. Benchmark de latencia y throughput (<5ms)
npm run benchmark
# 5. Pipeline de integración continua (CI)
npm run test:ci🐳 Docker Deployment
# Construir imagen Docker multi-stage
docker build -t mcp-doc-mid:latest .
# Ejecutar contenedor en modo SSE
docker run -p 3000:3000 -e TRANSPORT_MODE=sse mcp-doc-mid:latestMaintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to explore and query OpenAPI specifications, allowing natural language interaction with API endpoints, parameters, request bodies, and response schemas from any OpenAPI 3.x spec.12MIT
- AlicenseAqualityDmaintenanceExposes Swagger/OpenAPI API documentation to AI models, enabling exploration, search, and interaction with endpoints, schemas, and execution of API calls.14102MIT
- FlicenseNot gradedqualityCmaintenanceBrings OpenAPI/Swagger documentation into AI assistants, enabling endpoint discovery, deep inspection, cURL generation, and TypeScript type generation.
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to understand and interact with OpenAPI specifications, providing deep insight into API structures for faster and more accurate API integration.61MIT
Related MCP Connectors
Point Gecko at an OpenAPI spec; get first-call-correct, auth-hidden agent tools.
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
SaaS intelligence for AI agents. 5 unified tools cover 1,000+ services with 91-96% token savings.
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/manuelperezg/mcp-docu-mid'
If you have feedback or need assistance with the MCP directory API, please join our Discord server