mcp-openapi-runner

mcp-openapi-runner

Turn any OpenAPI spec into MCP tools for Claude — instantly. Point mcp-openapi at any OpenAPI 3.x spec and Claude can call every endpoint through natural language. No custom integration code. No manual tool definitions. One line of config.

Category
Visit Server

README

mcp-openapi

Turn any OpenAPI spec into MCP tools for Claude — instantly.

Point mcp-openapi at any OpenAPI 3.x spec and Claude can call every endpoint through natural language. No custom integration code. No manual tool definitions. One line of config.

Quick start

Add to your Claude Desktop / Cursor / Cline MCP config:

{
  "mcpServers": {
    "my-api": {
      "command": "npx",
      "args": ["-y", "mcp-openapi", "--spec", "https://petstore3.swagger.io/api/v3/openapi.json"]
    }
  }
}

That's it. Claude can now discover and call every endpoint in that API.

Example conversation

You: What pets are available, and add a new dog named Buddy

Claude: Let me check what's available first. [calls list_endpoints → sees findPetsByStatus, addPet, etc.] [calls call_endpoint with findPetsByStatus, status=available]

There are 3 pets currently available. Now I'll add Buddy... [calls call_endpoint with addPet, body {"name":"Buddy","status":"available"}]

Done! Buddy has been added with ID 12345.

Authentication

Pass credentials via environment variables:

{
  "mcpServers": {
    "my-api": {
      "command": "npx",
      "args": ["-y", "mcp-openapi", "--spec", "https://api.example.com/openapi.json"],
      "env": {
        "OPENAPI_BEARER_TOKEN": "your-token-here"
      }
    }
  }
}
Variable Description
OPENAPI_BEARER_TOKEN Bearer token → Authorization: Bearer <token>
OPENAPI_API_KEY API key value
OPENAPI_API_KEY_HEADER Header name for API key (default: X-Api-Key)
OPENAPI_BASIC_USER HTTP Basic auth username
OPENAPI_BASIC_PASS HTTP Basic auth password

Tools

mcp-openapi exposes exactly two tools:

Tool Description
list_endpoints Returns all operations grouped by tag with operationIds, methods, paths, and required parameters
call_endpoint Executes any operation by operationId with path/query/body parameters

The two-tool design means Claude always has a clear workflow: discover → call.

Using a local spec file

{
  "mcpServers": {
    "my-api": {
      "command": "npx",
      "args": ["-y", "mcp-openapi", "--spec", "/path/to/your/openapi.yaml"]
    }
  }
}

Supports both JSON and YAML specs. All $ref references are resolved automatically.

Requirements

  • Node.js 18+
  • OpenAPI 3.x spec (JSON or YAML, local file or URL)

Real-world examples

Stripe API:

["--spec", "https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json"]

GitHub REST API:

["--spec", "https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json"]

Your internal API:

["--spec", "http://localhost:8080/openapi.json"]

CLI usage

# From URL
npx mcp-openapi --spec https://api.example.com/openapi.json

# From file
npx mcp-openapi --spec ./openapi.yaml

# With auth
OPENAPI_BEARER_TOKEN=mytoken npx mcp-openapi --spec https://api.example.com/openapi.json

# Help
npx mcp-openapi --help

How it works

  1. At startup, loads the spec from the given URL or file path
  2. Dereferences all $ref schemas using @apidevtools/swagger-parser
  3. Registers two MCP tools with the connected client
  4. list_endpoints generates a human+LLM-readable summary of all operations
  5. call_endpoint resolves path params, builds the URL, attaches auth headers, and returns the response

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured