Get the FREE Ultimate OpenClaw Setup Guide →

swagger2mcp

🚀 Instantly transform any OpenAPI/Swagger schema into a production-ready Model Context Protocol (MCP) server! 🤖✨ Bridge your APIs with LLMs securely and effortlessly.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio tomer1983-swagger2mcp docker run -i swagger2mcp

How to use

Swagger2MCP transforms OpenAPI/Swagger specifications into MCP (Model Context Protocol) servers. With this tool, you can upload an OpenAPI v2/v3 document or point to a documentation site to let Swagger2MCP crawl and extract schemas, then automatically generate a production-ready, type-safe MCP server in TypeScript. The generated server can be exported directly to GitHub/GitLab or downloaded as a ZIP, enabling easy integration into your existing MC/P workflow. The project is Dockerized, so you can run it locally with Docker Compose, or deploy it in your CI/CD pipeline and cloud environments.

Key capabilities include:

  • Drag & Drop Upload: Import OpenAPI specifications in JSON or YAML formats (v2 and v3).
  • Automatic Code Generation: Create ready-to-run MCP servers in TypeScript with strong typing.
  • Web Crawling: Provide a documentation URL and Swagger2MCP will discover relevant schemas automatically.
  • One-Click Export: Push to GitHub/GitLab or download a ZIP to integrate into your deployment pipeline.
  • Secure Management: Store API tokens and configuration securely with audit logs, suitable for production use.
  • Dockerized Deployment: Run the entire stack via Docker Compose for rapid local development and consistent deployments.

To use it, run Swagger2MCP in Docker (or via your preferred container runtime), point it at your OpenAPI document or documentation URL, and let it generate the MCP server. Once built, you can customize the generated MCP server as needed and deploy it to your environment. The system supports exporting artifacts to your Git hosting service or as a ZIP bundle for manual deployment.

How to install

Prerequisites:

  • Docker and Docker Compose installed on your machine
  • Optional: Node.js 18+ if you prefer running locally without Docker

Install and run (Docker):

  1. Clone the repository: git clone https://github.com/tomer1983/swagger2mcp.git cd swagger2mcp

  2. Start the application with Docker Compose: docker-compose up

  3. Open the UI in your browser at: http://localhost:5173

  4. Use the UI to upload an OpenAPI specification or provide a documentation URL, then generate and export your MCP server.

If you prefer to run locally without Docker:

  1. Ensure Node.js 18+ is installed.
  2. Install dependencies and run the development server as documented within the repo (see CONTRIBUTING/DEVELOPMENT docs for exact commands).

Prerequisites recap:

  • Docker and Docker Compose
  • Optional Node.js 18+ for local development without Docker

Additional notes

Tips and common considerations:

  • Dockerized deployment: The project is designed to run well with docker-compose up, which simplifies local development and testing.
  • Security: When deploying to production, follow the production deployment checklist in the docs, including setting JWT secrets, strong passwords, HTTPS, and restricted CORS.
  • Environment variables: The MCP backend may rely on environment variables for secrets and configuration. Prepare your .env accordingly in your deployment environment.
  • Export options: Use the One-Click Export to publish your generated MCP server to GitHub/GitLab or download as a ZIP for manual deployment.
  • Troubleshooting: If the UI cannot connect to the backend, verify Docker containers are running, check logs via docker-compose logs, and ensure network access to required services (e.g., Redis, PostgreSQL) defined in the environment.
  • Kubernetes/Helm: For production deployments beyond Docker Compose, refer to the Kubernetes deployment guide in the docs.

Related MCP Servers

Sponsor this space

Reach thousands of developers