OpenAPI MCP Server
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., "@OpenAPI MCP Server find the endpoint for creating a user"
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.
OpenAPI MCP Server
An MCP (Model Context Protocol) server that provides AI assistants with tools to explore and understand OpenAPI specifications. Point it at any OpenAPI spec (JSON or YAML) and give your AI the ability to search endpoints, explore schemas, and understand API structures.
Features
OpenAPI 3.x Support - Works with OpenAPI 3.0 and 3.1 specifications
JSON & YAML - Automatically detects and parses both formats
Smart Caching - Caches specs with configurable TTL to minimize API calls
Reference Resolution - Automatically resolves
$refreferences for complete schema viewsDual Transport - Run via stdio (local) or HTTP stream (remote/Docker)
Authentication - Optional API key authentication for HTTP transport
Related MCP server: OpenAPI MCP Server
Available Tools
Tool | Description |
| Search API endpoints by path pattern, HTTP method, tags, or description |
| Get complete details for a specific endpoint including parameters and schemas |
| Search for schemas/models by name or property |
| Get full schema definition with resolved references |
| Retrieve the full spec or filtered sections (info, paths, components, etc.) |
| List the platform overview and guides, grouped by topic, with id, title and summary |
| Get the full markdown of one platform guide (or |
| Search the overview, guides and endpoints (path, operationId, summary, description) to find which one covers a topic |
Platform guides
The guide tools read guides that the spec carries itself:
Guides are tags carrying an
x-guideobject with anid(a common naming isguide:<id>). The object holdsid, and optionallygroup,order,summaryandverified_against. The tag'sdescriptionis the guide's markdown.The overview is
info.description, exposed as the guide with idoverview(it is only present wheninfo.descriptionis not empty).list_guidesgroups guides as inx-tagGroups(falling back tox-guide.group). Inside a group, guides are ordered byx-guide.order, then by their position.get_guidereturns one guide by id (with or without theguide:prefix), andsearch_docssearches the overview, guides and endpoints (path, operationId, summary, description).get_openapi_specreplaces the guide text with a pointer toget_guideininfo, intags(as anx-notekey) and in the defaultfullsection (also withpathFilter), so the spec stays small. This only applies when the spec has at least one guide; a spec without guides is returned unchanged.search_docssplits the query on whitespace; an entry matches when every term appears in it, and ranks first when every term is in its title, id or summary (the overview also matchesoverviewand itsinfo.x-guideid and summary). A query starting withguide:also matches theguide:<id>name (guide:overview, and alsoguide:<x-guide id>when the spec sets one). Endpoint hits always rank after the overview and guides.For a spec without guides,
list_guidesandsearch_docsguide results are empty (list_guidesreturns no groups; the overview still comes frominfo.descriptionwhen present), andget_guidereports the available ids.
Quick Start
Prerequisites
Node.js >= 18.0.0
npm or yarn
Installation
# Clone the repository
git clone https://github.com/matpb/openapi-mcp.git
cd openapi-mcp
# Install dependencies
npm install
# Build
npm run buildConfiguration
Create a .env file in the project root (see .env.example):
# Required: URL to your OpenAPI specification
OPENAPI_SPEC_URL=https://api.example.com/openapi.json
# Optional: API key if your spec endpoint requires authentication
OPENAPI_API_KEY=your-api-key
# Optional: Cache TTL in seconds (default: 300)
SPEC_CACHE_TTL=300
# Optional: Spec fetch timeout in seconds (default: 30)
SPEC_FETCH_TIMEOUT=30
# Transport: 'stdio' for local, 'http-stream' for remote (default: stdio)
MCP_TRANSPORT=stdio
# HTTP transport settings (only used when MCP_TRANSPORT=http-stream)
MCP_PORT=8080
API_KEYS=key1,key2 # Comma-separated API keys for client authentication
CORS_ORIGIN=*Running Locally
# Development (build + run)
npm run dev
# Or production
npm run build
npm startEnvironment Variables
Variable | Required | Default | Description |
| Yes | - | URL to the OpenAPI specification (JSON or YAML) |
| No | - | API key for authenticated spec endpoints (sent as |
| No |
| How long to cache the spec in seconds |
| No |
| Timeout of the spec fetch in seconds. After a failed refetch the stale cache is served and the next fetch waits min( |
| No |
| Transport type: |
| No |
| Port for HTTP transport |
| No | - | Comma-separated API keys for HTTP client authentication |
| No |
| Allowed CORS origins for HTTP transport |
Usage
With Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"openapi": {
"command": "node",
"args": ["/path/to/openapi-mcp/dist/index.js"],
"env": {
"OPENAPI_SPEC_URL": "https://api.example.com/openapi.json",
"OPENAPI_API_KEY": "your-api-key"
}
}
}
}With Claude Code
Add to your project's .mcp.json:
{
"mcpServers": {
"openapi": {
"command": "node",
"args": ["/path/to/openapi-mcp/dist/index.js"],
"env": {
"OPENAPI_SPEC_URL": "https://api.example.com/openapi.json"
}
}
}
}With MCP Inspector
For testing and debugging, use the MCP Inspector:
# Start the server in HTTP mode
MCP_TRANSPORT=http-stream npm run dev
# Connect Inspector to http://localhost:8080/mcpDocker Deployment
Using Docker Compose (Recommended)
cd docker
# Set required environment variables
export OPENAPI_SPEC_URL=https://api.example.com/openapi.json
export OPENAPI_API_KEY=your-api-key # if needed
# Start the server
docker-compose up -dUsing Docker Directly
# Build the image
docker build -f docker/Dockerfile -t openapi-mcp .
# Run the container
docker run -d \
-p 8080:8080 \
-e OPENAPI_SPEC_URL=https://api.example.com/openapi.json \
-e OPENAPI_API_KEY=your-api-key \
-e API_KEYS=client-key-1,client-key-2 \
openapi-mcpDocker Environment
When running in Docker, the server automatically uses HTTP stream transport on port 8080. Configure client authentication by setting the API_KEYS environment variable.
The container includes:
Health check endpoint at
/mcpGraceful shutdown handling
Automatic restart on failure (when using docker-compose)
HTTP API Authentication
When running in HTTP stream mode with API_KEYS configured, clients must include an API key in requests:
# Via header
curl -H "X-API-Key: your-client-key" http://localhost:8080/mcp
# Or via query parameter
curl http://localhost:8080/mcp?api_key=your-client-keyIf no API_KEYS are configured, the server runs without authentication (suitable for local development or trusted networks).
Tool Examples
Search for Endpoints
{
"tool": "search_endpoints",
"arguments": {
"pathPattern": "user",
"method": "GET",
"limit": 10
}
}Get Endpoint Details
{
"tool": "get_endpoint_details",
"arguments": {
"path": "/api/v2/users/{id}",
"method": "GET",
"resolveRefs": true
}
}Search Schemas
{
"tool": "search_schemas",
"arguments": {
"namePattern": "User",
"propertyName": "email"
}
}Get Schema Details
{
"tool": "get_schema_details",
"arguments": {
"schemaName": "UserResponse",
"resolveRefs": true,
"maxDepth": 5
}
}Get Spec Section
{
"tool": "get_openapi_spec",
"arguments": {
"section": "paths",
"pathFilter": "/users"
}
}Development
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run in development mode
npm run dev
# Run the tests (compiles to dist-test and runs node --test)
npm testProject Structure
openapi-mcp/
├── src/
│ ├── index.ts # Server entry point
│ ├── config.ts # Environment configuration
│ ├── __tests__/ # node:test suites (npm test)
│ ├── tools/ # MCP tool implementations
│ │ ├── SearchEndpointsTool.ts
│ │ ├── GetEndpointDetailsTool.ts
│ │ ├── SearchSchemasTool.ts
│ │ ├── GetSchemaDetailsTool.ts
│ │ ├── GetOpenAPISpecTool.ts
│ │ ├── ListGuidesTool.ts
│ │ ├── GetGuideTool.ts
│ │ └── SearchDocsTool.ts
│ └── utils/
│ ├── OpenAPIManager.ts # Spec fetching and caching
│ └── RefResolver.ts # $ref resolution
├── docker/
│ ├── Dockerfile
│ └── docker-compose.yml
├── .env.example
├── tsconfig.json
├── tsconfig.test.json # Test build (outDir dist-test)
└── package.jsonLicense
MIT
Available Tools
8 toolsget_endpoint_detailsA
Get detailed information about a specific API endpoint including parameters, request body schema, and response schemas.
Inputs: path (required), method (required), resolveRefs.
get_guideA
Return the full markdown of one platform guide by id (from list_guides), or the platform overview with id "overview". Use it when you need to understand a concept, feature or workflow before calling endpoints.
Inputs: id (required).
get_openapi_specA
Return the full OpenAPI spec or a filtered section. Use section to get specific parts (info, paths, components, tags, servers, full). Use pathFilter to filter paths by regex pattern. Platform guides are tags carrying an x-guide object with an id (a common naming is guide:); use list_guides, get_guide and search_docs to read them instead of dumping the spec.
Inputs: section, pathFilter.
get_schema_detailsB
Get detailed information about a specific schema/model including all properties and nested schemas with resolved $ref references.
Inputs: schemaName (required), maxDepth, resolveRefs.
list_guidesA
List the platform guides: the overview plus guides grouped by topic, each with id, title and summary. Call this first to discover what the platform guides cover, then use get_guide for the full text.
Inputs: no named parameters.
search_docsA
Search the platform overview, guides and endpoints (path, operationId, summary, description; endpoint hits rank after guides) for one or more words (case-insensitive; an entry matches when it contains every word, in any order; page through hits with limit and offset). Use it to find which guide or endpoint covers a topic, then open it with get_guide or get_endpoint_details.
Inputs: query (required), limit, offset.
search_endpointsB
Search API endpoints by path pattern, HTTP method, tags, or description. Returns a paginated list of matching endpoints.
Inputs: tags, limit, method, offset, +2 more.
search_schemasA
Search for schemas/models in the OpenAPI spec by name pattern or property name. Returns a paginated list of matching schemas.
Inputs: limit, offset, namePattern, propertyName.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Search/detail pairs are clearly separated for endpoints, schemas, and guides, so those are easy to distinguish. The one real overlap is search_docs, which per its description also searches endpoints and guides, partially duplicating search_endpoints and list_guides; descriptions mitigate this but boundaries are slightly blurred.
All eight tools follow a clean verb_noun pattern (get_, list_, search_ + resource), with consistent snake_case throughout. No mixing of conventions or vague one-word verbs.
Eight tools is well-scoped for an OpenAPI spec exploration server: discovery (list/search), retrieval (get spec/details), and guide access. Each tool earns its place without redundancy at the count level.
Covers spec retrieval, endpoint discovery/details, schema discovery/details, and platform guides—a full lifecycle for spec reading. Minor gaps: no direct tag listing or explicit security/auth-scheme tool, though those are reachable via get_openapi_spec sections and search_docs.
Maintenance
Related MCP Connectors
Tailor Platform for AI assistants: search, list and read the platform documentation.
Access and search Branch's official API documentation directly within any AI agent or client.
Find, write, publish and check pages and API references in your DeveloperHub docs from an AI client
Publish your API docs so AI assistants can look up endpoints and call your API correctly.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to load, parse, and query OpenAPI/Swagger documentation from URLs with intelligent search across endpoints, schemas, and authentication methods. Provides 10 specialized tools for comprehensive API exploration including path details, operation lookups, and multi-criteria search capabilities.4-
- 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.13 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI tools to search and explore API documentation from Apidog projects or OpenAPI/Swagger specifications, providing endpoint details, schemas, and project statistics through natural language queries.1ISC
- AlicenseAqualityDmaintenanceExposes Swagger/OpenAPI API documentation to AI models, enabling exploration, search, and interaction with endpoints, schemas, and execution of API calls.1427 npm2MIT