@abhishekkumar00019/swagger-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@abhishekkumar00019/swagger-mcpFind pet with ID 1 using the Pet Store API"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@abhishekkumar00019/swagger-mcp
A dynamic Model Context Protocol (MCP) server that converts any Swagger 2.0 or OpenAPI 3.x specification into callable MCP tools on the fly.
Point it at any OpenAPI/Swagger JSON or YAML spec URL, and every API endpoint automatically becomes an interactive tool for Claude, Copilot, ChatGPT, Cursor, Windsurf, and other MCP-enabled clients.
⨠Features
š Dynamic Tool Generation ā Automatically parses Swagger 2.0 & OpenAPI 3.x specs at startup.
š ļø Zero Boilerplate ā Give it a spec URL and every endpoint is instantly exposed as an MCP tool.
š Flexible Auth Support ā Bearer Tokens, API Keys, and Basic Auth configured effortlessly via env vars or CLI flags.
š Smart Base URL Resolution ā Auto-derives base URL from config ā spec server definition ā spec origin URL.
š Hot Reloading ā Re-fetch and re-parse the spec live at runtime using the
_swagger_mcp_reloadtool.š Rich Schemas & Descriptions ā Translates OpenAPI parameters and request bodies into strict JSON schemas for precise LLM tool calling.
ā±ļø Configurable Timeouts & Custom Headers ā Easily set custom request headers and request timeout thresholds.
š Quick Start
Option A: Direct via npx (No Installation Required)
SWAGGER_MCP_SPEC_URL=https://petstore.swagger.io/v2/swagger.json npx @abhishekkumar00019/swagger-mcpOption B: Global NPM Installation
npm install -g @abhishekkumar00019/swagger-mcp
SWAGGER_MCP_SPEC_URL=https://petstore.swagger.io/v2/swagger.json swagger-mcpOption C: Local Repository Setup
Clone & Install Dependencies:
git clone https://github.com/itachiuchihadev/swagger-mcp.git cd swagger-mcp npm installBuild the Project:
npm run buildRun locally:
SWAGGER_MCP_SPEC_URL=https://petstore.swagger.io/v2/swagger.json node dist/index.js
āļø MCP Client Configurations
Below are sample configurations for popular MCP clients using npx @abhishekkumar00019/swagger-mcp.
1. Claude Desktop
Add to your claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json",
"SWAGGER_MCP_BEARER_TOKEN": "your-api-token-here"
}
}
}
}2. Claude Code (CLI)
Add directly via the Claude Code CLI:
claude mcp add swagger-mcp -- npx -y @abhishekkumar00019/swagger-mcp --spec-url https://petstore.swagger.io/v2/swagger.jsonOr add to .mcp.json in your project root:
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}3. GitHub Copilot / VS Code
Add to .vscode/mcp.json in your workspace or global VS Code settings:
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json",
"SWAGGER_MCP_API_KEY": "your-api-key"
}
}
}
}4. Cursor
Add to .cursor/mcp.json or configure in Cursor Settings ā Features ā MCP:
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}5. Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}6. Roo Code / Cline (VS Code Extension)
Add to cline_mcp_settings.json (or roo_code_mcp_settings.json):
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}7. ChatGPT & OpenAI (Custom GPTs / Assistants / API)
Direct OpenAPI Spec Import (Native Custom GPT Actions): ChatGPT Custom GPTs support OpenAPI specifications natively. You can directly import your Swagger/OpenAPI JSON/YAML spec URL in the Actions section of the Custom GPT Builder without needing an intermediate server.
Via MCP HTTP/SSE Gateway:
If connecting ChatGPT or OpenAI agents to this MCP server via an HTTP/SSE bridge (e.g., using supergateway or mcp-remote), start swagger-mcp with an SSE proxy:
npx supergateway --stdio "npx -y @abhishekkumar00019/swagger-mcp --spec-url https://petstore.swagger.io/v2/swagger.json" --port 80008. Zed Editor
Add to ~/.config/zed/settings.json:
{
"context_servers": {
"swagger-mcp": {
"command": {
"path": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"]
},
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}š§ Configuration Reference
All configuration parameters can be supplied via environment variables or CLI arguments. SWAGGER_MCP_SPEC_URL is the only required parameter.
Environment Variable | CLI Argument | Required | Default | Description |
|
| Yes | ā | Swagger/OpenAPI spec URL |
|
| No | Auto-derived | Override target API base URL |
|
| No | ā | Bearer token for |
|
| No | ā | API Key header value |
|
| No |
| Custom header name for API Key |
|
| No | ā | Username for Basic Auth |
|
| No | ā | Password for Basic Auth |
|
| No |
| HTTP request timeout in milliseconds |
|
| No |
| Extra HTTP headers as JSON string |
š Authentication Examples
Multiple authentication methods can be set simultaneously:
# Bearer Token
SWAGGER_MCP_BEARER_TOKEN=sk-your-token-here
# API Key (Custom Header)
SWAGGER_MCP_API_KEY=your-api-key
SWAGGER_MCP_API_KEY_HEADER=X-Custom-Key
# Basic Auth
SWAGGER_MCP_BASIC_USER=admin
SWAGGER_MCP_BASIC_PASS=secret123If both Bearer and Basic Auth are specified, Basic Auth will overwrite theAuthorization header. Combine Bearer Token with API Key headers if multiple headers are required.
š·ļø Tool Naming Strategy
Endpoints from your OpenAPI spec are converted into MCP tools using the following priority order:
Priority | Source | Example |
1st |
|
|
2nd | Tag + Method + Path |
|
3rd | Method + Path |
|
š§° Built-in Meta Tools
Tool | Description |
| Re-fetches and parses the Swagger spec live. Useful when developing or updating APIs without restarting the server. |
š Project Structure
swagger-mcp/
āāā package.json
āāā tsconfig.json
āāā src/
ā āāā index.ts # Entry point & CLI argument parser
ā āāā server.ts # MCP server initialization & tool registration
ā āāā swagger-parser.ts # OpenAPI 2.0/3.x spec fetcher & parser
ā āāā tool-builder.ts # Converts OpenAPI operations -> JSON Schema tools
ā āāā request-handler.ts # Proxies MCP tool calls to HTTP endpoints
ā āāā auth.ts # Authentication header builder
ā āāā config.ts # Environment & CLI configuration manager
ā āāā types.ts # Shared TypeScript interfaces
āāā dist/ # Compiled JavaScript outputš License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/itachiuchihadev/swagger_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server