swagger-mcp

swagger-mcp

72

Swagger MCP Server is a personal server designed to ingest and serve Swagger/OpenAPI specifications using the Model Context Protocol. It supports multiple authentication methods and automatically generates MCP tools from API endpoints. It also includes features like Server-Sent Events for real-time communication and TypeScript support.

Swagger MCP Server

A server that ingests and serves Swagger/OpenAPI specifications through the Model Context Protocol (MCP).

Features

  • Loads Swagger/OpenAPI specifications
  • Supports multiple authentication methods
  • Automatically generates MCP tools from API endpoints
  • Real-time communication via Server-Sent Events
  • TypeScript support

Prerequisites

  • Node.js (v18 or higher)
  • Yarn package manager
  • TypeScript

Installation

  1. Clone the repository and navigate to the directory
  2. Install dependencies with Yarn
  3. Create and configure a .env file
  4. Configure your Swagger/OpenAPI specification

Usage

  1. Start the development server
  2. Build for production
  3. Start the production server

API Endpoints

  • GET /health - Check server health status
  • GET /sse - Establish SSE connection
  • POST /messages - Send messages to the MCP server

Security

This is a personal server and should not be exposed to the public internet.

Testing

Run the test suite and check for coverage