OpenAPI Swagger

v1.0.0APIsstable

Solve AI context window limits for API docs | Convert any Swagger/OpenAPI to searchable MCP server | AI-powered endpoint discovery & code generation | Works with Cursor, Claude, VS Code

ai-assistantai-toolsapi-clientapi-documentationapi-integration
Share:
17
Stars
0
Downloads
0
Weekly
0/5

What is OpenAPI Swagger?

OpenAPI Swagger is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to solve ai context window limits for api docs | convert any swagger/openapi to searchable mcp server | ai-powered endpoint discovery & code generation | works with cursor, claude, vs code

Solve AI context window limits for API docs | Convert any Swagger/OpenAPI to searchable MCP server | AI-powered endpoint discovery & code generation | Works with Cursor, Claude, VS Code

This server falls under the APIs and Developer Tools categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Solve AI context window limits for API docs | Convert any Sw

Use Cases

Convert Swagger and OpenAPI specs into searchable MCP servers.
Enable AI to discover and use API endpoints automatically.
Generate code from API documentation without hitting context limits.
salacoste

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx openapi-mcp-swagger

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use OpenAPI Swagger

OpenAPI MCP Swagger (swagger-mcp-server) converts any Swagger or OpenAPI JSON specification into a searchable MCP server that AI assistants can query on demand, solving the problem of massive API docs exceeding AI context windows. Instead of pasting huge JSON specs into chat, your AI client calls the MCP server to search endpoints by natural language, retrieve full schema details, and generate working client code — all without hitting context limits. It works with Claude, Cursor, and VS Code Copilot, and supports offline use with local Swagger files as large as 10 MB or more.

Prerequisites

  • Python 3.11 or later
  • pip for dependency installation
  • A Swagger/OpenAPI JSON file for the API you want to work with
  • An MCP-compatible client such as Claude Desktop or Cursor
1

Clone the repository

Clone the openapi-mcp-swagger repository from GitHub and change into the project directory.

git clone https://github.com/salacoste/openapi-mcp-swagger.git
cd openapi-mcp-swagger
2

Install Python dependencies

Install all required packages listed in requirements.txt into your Python environment.

pip install -r requirements.txt
3

Obtain your Swagger/OpenAPI JSON file

Download the API specification you want to work with. Many APIs expose it at common paths. Save it into the swagger-openapi-data directory inside the project.

curl -o swagger-openapi-data/your-api.json "https://api.example.com/swagger.json"
4

Convert the Swagger file to an MCP server

Run the convert command to transform your OpenAPI spec into an MCP-ready server directory. Use a meaningful name so you can identify it later.

python -m swagger_mcp_server convert swagger-openapi-data/your-api.json --name your-api
5

Start the MCP server

Change into the generated server directory and start serving. By default it listens on port 8080.

cd mcp-server-your-api
python -m swagger_mcp_server serve
6

Add the server to your MCP client config

Register the running MCP server with Claude Desktop or Cursor so the AI can call it during conversations.

{
  "mcpServers": {
    "openapi-swagger": {
      "command": "python",
      "args": ["-m", "swagger_mcp_server", "serve"],
      "cwd": "/path/to/mcp-server-your-api"
    }
  }
}

OpenAPI Swagger Examples

Client configuration

Claude Desktop configuration for openapi-mcp-swagger running as a local Python process.

{
  "mcpServers": {
    "openapi-swagger": {
      "command": "python",
      "args": ["-m", "swagger_mcp_server", "serve"],
      "cwd": "/Users/yourname/openapi-mcp-swagger/mcp-server-your-api"
    }
  }
}

Prompts to try

Example prompts to use once your API spec is loaded into the MCP server.

- "Search for all endpoints related to user authentication in the API"
- "Show me the full request schema for POST /users including all required fields"
- "Generate a TypeScript client function to call GET /orders/{id} with error handling"
- "List all endpoints that return paginated results"
- "What are the available response codes for the payment endpoints?"

Troubleshooting OpenAPI Swagger

Context window exceeded error when trying to load a large Swagger file directly

Do not paste the Swagger JSON into the chat. Convert it first with the convert command, then start the MCP server. The AI queries only the relevant endpoint information on demand.

Server fails to start with import errors after pip install

Make sure you are running Python 3.11 or later and that you installed dependencies inside the project directory with pip install -r requirements.txt. Consider using a virtual environment to avoid package conflicts.

Endpoint search returns no results for known API paths

Verify the Swagger JSON is valid OpenAPI 2.0 or 3.x format. Try opening the file in a browser or running it through an online validator. Some APIs export non-standard Swagger that may need minor cleanup before conversion.

Frequently Asked Questions about OpenAPI Swagger

What is OpenAPI Swagger?

OpenAPI Swagger is a Model Context Protocol (MCP) server that solve ai context window limits for api docs | convert any swagger/openapi to searchable mcp server | ai-powered endpoint discovery & code generation | works with cursor, claude, vs code It connects AI assistants to external tools and data sources through a standardized interface.

How do I install OpenAPI Swagger?

Follow the installation instructions on the OpenAPI Swagger GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with OpenAPI Swagger?

OpenAPI Swagger works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is OpenAPI Swagger free to use?

Yes, OpenAPI Swagger is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More APIs MCP Servers

Explore all apis servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "openapi-mcp-swagger": { "command": "npx", "args": ["-y", "openapi-mcp-swagger"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use OpenAPI Swagger?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides