Swagger MCP Tool Server

Parses and queries Swagger/OpenAPI docs loaded from a URL or file to assist type generation and API usage.
  • typescript

1

GitHub Stars

typescript

Language

3 months ago

First Indexed

3 weeks ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs

You can run and query Swagger/OpenAPI documents with a Bun-based Swagger MCP Server. It lets you load a Swagger document from a local file or a remote URL, then search, inspect, and extract schemas and API details to help generate TypeScript definitions and API call code. This guide shows practical ways to run the server and use it from an MCP client.

How to use

You interact with the Swagger MCP Server through an MCP client by pointing it at a Swagger document. Use the client’s built‑in tools to list API groups, search for APIs by tag or keyword, fetch detailed API definitions, and retrieve schema definitions for data models. This makes it easy to obtain interface definitions and sample structures for code generation.

How to install

Prerequisites: you need a Bun runtime installed to run this server, and you should have access to a Swagger/OpenAPI document (local file or remote URL). Install Bun if you don’t have it yet.

curl -fsSL https://bun.sh/install | bash

Cursor MCP configuration and usage notes

Configure the MCP client to access the Swagger MCP Tool using either a remote URL or a local file. You can also use Bun to run the same tool.

{
  "mcpServers": {
    "swagger_tools_http_remote": {
      "command": "npx",
      "args": ["swagger-mcp-tool", "http://example.com/api/swagger.json"]
    }
  }
}
{
  "mcpServers": {
    "swagger_tools_http_local": {
      "command": "npx",
      "args": ["swagger-mcp-tool", "./docs/swagger.json"]
    }
  }
}
{
  "mcpServers": {
    "swagger_tools_bunx_remote": {
      "command": "bunx",
      "args": ["swagger-mcp-tool", "http://example.com/api/swagger.json"]
    }
  }
}
{
  "mcpServers": {
    "swagger_tools_bunx_local": {
      "command": "bunx",
      "args": ["swagger-mcp-tool", "./docs/swagger.json"]
    }
  }
}

Configuration notes

  • Use absolute paths for local Swagger documents when possible for reliability.

  • If you need to switch between a remote URL and a local file, you can configure multiple MCP entries as shown above.

  • After adding or changing MCP configurations, restart the client (Cursor) to pick up the new settings.

API tools available in the Swagger MCP Tool

You can perform several operations to work with your Swagger document.

Available tools

list_api_groups

Lists all API groups (tags) defined in the Swagger document. If the document lacks top-level tags, it collects tags used in API paths.

search_apis

Searches APIs by tag or keyword. Can filter by tag or search in path, summary, and description.

get_api_detail

Retrieves full details for a specific API by path and HTTP method, including parameters, responses, and descriptions.

get_schema

Fetches a data model Schema by reference or name, such as a component schema.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational