mcpwrap
MCP server that wraps any REST API with an OpenAPI spec, dynamically creating MCP tools at runtime without code generation.
README
mcpwrap
Live: https://mcp-forge-black.vercel.app

Turn any REST API into an MCP server in 10 seconds.
npx mcpwrap --spec https://petstore3.swagger.io/api/v3/openapi.json
No code generation. No config files. Just point and serve.
Why?
Other tools generate static code from your OpenAPI spec. mcpwrap wraps your API at runtime - it reads the spec, creates MCP tools dynamically, and proxies requests to your API. Update the spec, restart, done.
Quick Start
# From a URL
npx mcpwrap --spec https://api.example.com/openapi.json
# From a local file
npx mcpwrap --spec ./my-api.yaml
# With authentication
npx mcpwrap --spec ./api.json --auth "Bearer $MY_TOKEN"
# With API key header
npx mcpwrap --spec ./api.json --auth "X-API-Key:your-key-here"
# Filter endpoints
npx mcpwrap --spec ./api.json --include "/pets/*" --exclude "/admin/*"
Claude Desktop Integration
Add to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"my-api": {
"command": "npx",
"args": ["mcpwrap", "--spec", "https://api.example.com/openapi.json"]
}
}
}
How It Works
- Reads your OpenAPI 3.0/3.1 spec (JSON or YAML, local or remote)
- Parses every endpoint into an MCP tool (one tool per operation)
- Maps parameters and request bodies to MCP tool input schemas
- Proxies tool calls to your API and returns the response
- Flattens large/nested responses for LLM readability
Features
- Runtime wrapping - no generated code to maintain
- OpenAPI 3.0 and 3.1 support
- All HTTP methods - GET, POST, PUT, DELETE, PATCH
- Auth passthrough - Bearer tokens, API keys, Basic auth
- Path and query params - automatically mapped from tool arguments
- Request body - JSON body passed as
bodyargument - Response flattening - truncates deep nesting and long arrays
- Endpoint filtering - include/exclude by path pattern
- Verbose mode - logs requests to stderr for debugging
CLI Options
| Option | Description | Default |
|---|---|---|
--spec <path> |
Path or URL to OpenAPI spec (required) | - |
--base-url <url> |
Override base URL from spec | From spec |
--auth <auth> |
Auth: Bearer TOKEN, HEADER:VALUE |
None |
--include <patterns> |
Only include matching paths | All |
--exclude <patterns> |
Exclude matching paths | None |
--transport <type> |
stdio or http |
stdio |
--port <number> |
Port for HTTP transport | 3100 |
--no-flatten |
Disable response flattening | Enabled |
--verbose |
Log requests to stderr | Off |
Tool Naming
Tools are named using the operationId from your spec when available, falling back to METHOD_path_segments (e.g., get_pets_petId).
Development
git clone https://github.com/m4cd4r4/mcpwrap
cd mcpwrap
npm install
npm test
npm run dev -- --spec examples/petstore.json --verbose
License
MIT
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.