
Openapi
io.github.Docat0209Published by GitHub account Docat0209v0.2.3Updated Oct 24, 2026
Turn any OpenAPI/Swagger spec into MCP tools. Zero config, zero code.
Overview
Turns any OpenAPI 3.x or Swagger 2.0 spec into MCP tools, letting an assistant call the REST API endpoints described in that spec.
- What you can do
- Generate MCP tools from an OpenAPI/Swagger spec given as a URL or local file, one tool per endpoint
- Call the underlying REST API endpoints, with path, query, header and body parameters flattened into one schema
- Filter which endpoints become tools by operationId, and prefix tool names
- Browse large APIs through meta-tools that search operations, list by tag and show tool details
- Authenticate requests with a bearer token, API key or OAuth2 client credentials, and retry on 429/5xx
- When to use it
- Useful when you have a documented REST API and want an assistant to call it without writing a custom MCP server or hand-written tool definitions. Best for public or internal APIs with a reasonably complete spec, and for large APIs where dynamic discovery keeps the tool list manageable.
- Requirements
- Node.js 18 or later; runs locally via npx or as a library. Needs an OpenAPI 3.x or Swagger 2.0 spec, as a remote URL or local file. Network access to the spec and to the API itself. Credentials are passed as CLI flags or config values, optionally referencing environment variables such as GITHUB_TOKEN or MCP_OPENAPI_LICENSE_KEY.
Installation
In SourceWeft
- Open Openapi in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
mcp-openapi
Turn any OpenAPI/Swagger spec into MCP tools — so Claude and other AI assistants can call your REST APIs.
[npm version] [License: MIT] [npm downloads]
Point mcp-openapi at any OpenAPI 3.x or Swagger 2.0 spec URL and it generates Model Context Protocol (MCP) tools automatically. No code generation, no config files, no boilerplate. Your AI assistant gets callable tools for every API endpoint in seconds.
Quick Start
1. Run it (no install required):
2. Add it to Claude Desktop (claude_desktop_config.json):
3. Ask Claude to use it:
"List all available pets in the store"
Claude sees MCP tools like find_pets_by_status, get_pet_by_id, add_pet and calls them directly.
Why mcp-openapi?
Most MCP-to-API bridges require you to write tool definitions by hand or generate code from a spec. mcp-openapi skips all of that.
Flat parameter schemas are the key differentiator. Instead of passing nested JSON objects (which LLMs frequently get wrong), mcp-openapi flattens path, query, header, and body parameters into a single flat object. This dramatically improves tool-calling accuracy.
How It Works
Each API endpoint becomes one MCP tool:
- Tool name is derived from
operationId(converted tosnake_case) or frommethod + path - Parameters are flattened into a single input schema (path, query, header, and body params merged)
- Responses are truncated to ~50KB to stay within LLM context limits
- Errors (429, 5xx) trigger automatic retries with exponential backoff (up to 3 retries)
Claude Desktop Integration
Add any API to Claude Desktop by editing your config file:
Location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Public API (no auth)
API with Bearer Token
API with API Key
CLI Reference
General Options
Auth Options
Bearer token:
API key:
OAuth2 client credentials:
CLI Examples
Config File Format
Instead of CLI flags, you can use a JSON config file:
CLI arguments take precedence over config file values.
Supported Specs
Specs can be loaded from:
- Remote URLs (
https://...) - Local file paths (
./api.yaml,/absolute/path/spec.json)
v0.3.0 Features
Doc Quality Warnings
On startup, mcp-openapi checks each tool's documentation quality. If endpoints have sparse descriptions (under 50 characters), you'll see a warning:
This helps you identify which API endpoints might cause poor LLM tool-calling accuracy. Suppress with --no-doc-warnings.
Server Filtering
OpenAPI specs can define multiple servers (production, staging, dev). Select which one to use:
If the selector doesn't match, you'll see all available servers listed.
Dynamic Tool Discovery
For large APIs with 100+ endpoints, registering all tools at once can overwhelm the LLM's context. Dynamic discovery solves this by registering 3 meta-tools instead:
The LLM explores the API through these meta-tools, then calls specific endpoints by name.
Or via config file:
Pro Features (v0.2.0+)
mcp-openapi includes optional Pro features for teams and power users, gated by a license key.
Custom Response Transforms
Shape API responses with JMESPath expressions before they reach the LLM — reducing token usage and improving accuracy:
Smart Response Handling
Instead of hard-truncating large responses at 50KB, Pro enables intelligent truncation:
- Array slicing: Large arrays show first N items + metadata (
"showing 10 of 847 items") - Depth pruning: Deep nested objects are summarized beyond a configurable depth
- Structure preservation: You always see the shape of the data, never a mid-JSON cut
Coming Soon
- Multi-API Composition — Load multiple OpenAPI specs into one MCP session
- Usage Analytics — Track tool calls, latency, and error rates
Interested in Pro? Star the repo and open an issue to get early access.
Programmatic Usage
You can also use mcp-openapi as a library in your own MCP server:
Requirements
- Node.js 18 or later
- An OpenAPI 3.x or Swagger 2.0 spec (URL or local file)
Contributing
Contributions are welcome. Here is how to get started:
Before submitting a PR:
- Add tests for new features
- Run
pnpm lintand fix any issues - Follow Conventional Commits for commit messages
Related
- graphql-to-mcp — Same zero-config approach for GraphQL APIs
License
MIT
Keywords
mcp, model-context-protocol, openapi, swagger, claude, ai, llm, api, tools, rest-api, ai-tools, mcp-server
Source: README.md at commit fff16ab
Tools
0Version history
1- v0.2.3LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts