API2AI
Generate production-ready MCP-use servers from any OpenAPI specification
claude mcp add --transport stdio vtempest-api2ai npx -y api2ai https://petstore3.swagger.io/api/v3/openapi.json ./petstore-mcp --name petstore-api
How to use
This MCP server is generated from an OpenAPI specification using the api2ai tool. It creates a complete MCP-use server with tools derived from the OpenAPI endpoints, including authentication options, inspector UI, and support for multiple transports (HTTP, SSE, and Streamable HTTP). After generation, you can explore the built-in inspector at /inspector to test tools, endpoints, and authentication flows. To run, generate the server with the OpenAPI document, install dependencies, and start the server; you’ll then be able to query MCP endpoints (such as POST /mcp) and access supporting tools through the generated UI and tool endpoints.
How to install
Prerequisites:
- Node.js and npm installed on your machine
- Internet access to fetch the generator via npx
Step-by-step:
-
Ensure Node.js is installed. Verify: node -v npm -v
-
Generate the MCP server from an OpenAPI spec (example uses the Petstore OpenAPI): npx -y api2ai https://petstore3.swagger.io/api/v3/openapi.json ./petstore-mcp --name petstore-api
-
Navigate to the generated directory and install dependencies: cd petstore-mcp npm install
-
Start the server: npm start
-
Open in your browser: http://localhost:3000/inspector
Notes:
- If you want to customize port or base URL, pass appropriate options to the generator or set environment variables as needed in the generated .env file.
Additional notes
Tips and common considerations:
- The generated server includes an inspector UI at /inspector for interactive testing.
- Environment variables can control port (PORT), API base URL (API_BASE_URL), and authentication credentials (API_KEY, API_AUTH_HEADER).
- You can filter or exclude endpoints during generation using the programmatic API if you’re integrating tooling into your CI/CD.
- Ensure CORS and API endpoint base URL settings are correct for your deployment environment (ALLOWED_ORIGINS, API_BASE_URL).
- The server exposes /mcp for MCP protocol interactions and /sse for Server-Sent Events streams when needed.
- For production deployments, consider using PM2, Kubernetes, or containerized deployments as indicated by the generator capabilities.
Related MCP Servers
context7
Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
obsidian -tools
Add Obsidian integrations like semantic search and custom Templater prompts to Claude or any MCP client.
openmcp
Turn any openapi file into an mcp server, with just the tools you need.
MiniMax -JS
Official MiniMax Model Context Protocol (MCP) JavaScript implementation that provides seamless integration with MiniMax's powerful AI capabilities including image generation, video generation, text-to-speech, and voice cloning APIs.
openapi2mcptools
OpenAPI specifications => MCP (Model Context Protocol) tools
mcp-bundler
Is the MCP configuration too complicated? You can easily share your own simplified setup!