Swagger MCP Server

An MCP server that loads a Swagger or OpenAPI spec and turns every API endpoint into a tool the agent can call.

  • 115 ★ on the repository
  • Last commit
  • Apache-2.0
MCP server

Broad access

Why this level

  • The agent calls any API method, including ones that change or delete data, with your credentials.
  • Secrets sit in `config.json` and `.env` as plain text, and the server must not be exposed publicly.
All reasons and checks

dcolley/swagger-mcp

Install

Manual install

git clone https://github.com/dcolley/swagger-mcp.git

Then `yarn install`, `cp .env.example .env`, edit `config.json` and `yarn dev`.

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • The agent calls any API method, including ones that change or delete data, with your credentials.
  • Secrets sit in `config.json` and `.env` as plain text, and the server must not be exposed publicly.

This is third-party code. Review the repository files before installing.

What it does

Swagger MCP Server reads a Swagger or OpenAPI spec from a file or URL and automatically creates MCP tools from its endpoints. The agent calls the service API without knowing its URLs and parameters in advance. The server handles Basic Auth, bearer tokens, an API key in a header or query parameter and OAuth2. The base URL and security schemes come from the spec itself, and `config.json` acts as a fallback. The client connects over SSE, and `GET /health` reports server state. Put the spec next to the project or point to it by URL.

Who it is for. Developers who want to give an agent quick access to their own or a third-party REST API that has a spec.

Good fit when

  • A service has a `swagger.json` and its API must be called from an agent chat.
  • Endpoints of an internal service are tried without writing a client.
  • A tool set should come straight from an OpenAPI file.
  • The API requires a key or token for authorization.

Not a fit when

  • You plan to expose the server to the internet: the author calls it personal and asks not to.
  • There is no spec or it is incomplete: tools are built only from it.
  • The API changes data and nobody supervises the agent.

Example request

Load the spec from `swagger.json`, list the API methods and then fetch the list of pets.

MCP

Transport
sse
Authentication
key is optional

Environment variables

DEFAULT_SWAGGER_URL
Default Swagger specification URL
DEFAULT_API_BASE_URL
Default API base URL when the spec omits it
API_TOKEN secret
Token used to authorize API requests
API_USERNAME secret
Username for Basic Auth
API_PASSWORD secret
Password for Basic Auth
PORT
Server port, 3000 by default

Limitations

The author calls the server personal: do not expose it to the public internet, especially when the API needs authorization. Secrets in `config.json` and environment variables are stored as plain text, and user secret support is on the TODO list. The author also calls the test suite incomplete. It needs Node.js 18 or newer, Yarn and TypeScript; there is no npm package, so you install from a cloned repository. The last commit was in July 2026.

How to disable. Stop the server and remove its address from the MCP client settings. Delete the keys and tokens from `config.json` and `.env`.

FAQ

Where do the API address and authorization come from?

From the spec: the first `servers` URL and the security schemes take priority. `config.json` applies only when the file lacks them.

Which authorization methods exist?

Basic Auth, a bearer token, an API key in a header or query and OAuth2 with a ready token.

How do I check the server works?

With `GET /health`. The client connects to `GET /sse` and messages go to `POST /messages`.

Which environment variables does the server read?

`PORT`, `API_USERNAME`, `API_PASSWORD`, `API_TOKEN`, `DEFAULT_API_BASE_URL` and `DEFAULT_SWAGGER_URL`. All are fallbacks.

Can I expose the server to the internet?

No. The author calls it personal and asks not to expose it, especially when the API needs authorization.

Discussion

No questions or reviews yet.

A Pingora gateway that turns existing HTTP services into MCP servers from an OpenAPI spec, with no changes to their code

MCP serverBroad access185Repository stars
Official

Apollo's MCP server: turns chosen GraphQL operations into tools the agent uses to work with your API

MCP serverBroad access318Repository stars

An MCP server and plugin for agents that generate web APIs from OpenAPI, AsyncAPI, GraphQL, gRPC and SQL specs on a Rust core.

MCP serverExtended access123Repository stars

Two GraphQL tools for MCP clients: the agent fetches your API schema and runs queries against a single endpoint

MCP serverExtended access407Repository stars

A Laravel and Lumen package that adds an MCP endpoint to your app's routes and attaches your own tools to it

MCP serverExtended access330Repository stars

A single Go binary turns a SQL database into a REST API with roles and an MCP server for Claude Code, Cursor and VS Code

MCP serverBroad access170Repository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialAuthenticationRepository starsMain difference
Swagger MCP Server (this card)nokey is optional115
openapi-mcp-generatorno644generates a standalone MCP server from OpenAPI; Swagger MCP Server reads the spec at runtime
OpenAPI MCP Serveryesnot required302gives the agent an overview of the spec; Swagger MCP Server creates callable tools for each endpoint

README in short

The TypeScript server runs through `yarn dev`, or `yarn start` after a build. Settings live in `config.json` and `.env`.

README badge

Report a problem

Foxx AISwagger MCP Server
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.