Skip to main content
Glama
Swagger/OpenAPI MCP Server

Swagger/OpenAPI MCP Server

by gulbaki

Swagger/OpenAPI MCP Server

A Model Context Protocol (MCP) server that allows LLMs to explore and interact with Swagger/OpenAPI specifications. This server provides tools and resources for loading API specifications, browsing endpoints, and getting detailed information about API operations.

Installation

  1. Clone or create the project directory

  2. Install dependencies:

npm install
  1. Build the TypeScript code:

npm run build

Related MCP server: OpenAPI MCP Server

Usage

Available Tools

load_api

Load an OpenAPI/Swagger specification into the server.

Parameters:

  • apiId (string): Unique identifier for this API

  • source (string): URL or file path to the OpenAPI/Swagger specification

Example:

{
  "name": "load_api",
  "arguments": {
    "apiId": "petstore",
    "source": "https://petstore.swagger.io/v2/swagger.json"
  }
}

get_endpoint_details

Get detailed information about a specific API endpoint.

Parameters:

  • apiId (string): ID of the loaded API

  • method (string): HTTP method (GET, POST, etc.)

  • path (string): API endpoint path

  • natural (boolean, optional): If true, returns a human-readable summary

Example:

{
  "name": "get_endpoint_details",
  "arguments": {
    "apiId": "petstore",
    "method": "GET",
    "path": "/pet/{petId}",
    "natural": true
  }
}

list_apis

List all currently loaded API specifications.

Parameters: None

search_endpoints

Search for endpoints matching a specific pattern.

Parameters:

  • apiId (string): ID of the loaded API

  • pattern (string): Search pattern for endpoint paths or descriptions

Example:

{
  "name": "search_endpoints",
  "arguments": {
    "apiId": "petstore",
    "pattern": "pet"
  }
}

Available Resources

swagger://{apiId}/load

Get overview information about a loaded API specification.

swagger://{apiId}/endpoints

Get a list of all available endpoints for an API.

swagger://{apiId}/endpoint/{method}/{path}

Get detailed information about a specific endpoint.

Configuration with Claude Desktop

To use this server with Claude Desktop, add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "swagger-explorer": {
      "command": "node",
      "args": ["/path/to/your/swagger-mcp-server/build/index.js"]
    }
  }
}

Replace /path/to/your/swagger-mcp-server with the actual path to your project directory.

License

MIT License

Available Tools

4 tools
get_endpoint_detailsD

Inputs: apiId (required), method (required), path (required), natural.

list_apisD

Inputs: no named parameters.

load_apiD

Inputs: apiId (required), source (required).

search_endpointsD

Inputs: apiId (required), pattern (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    D1.9/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: get_endpoint_details retrieves specific endpoint information, list_apis enumerates available APIs, load_api loads an API specification, and search_endpoints searches across endpoints. There is no overlap or ambiguity in their functions.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (get_endpoint_details, list_apis, load_api, search_endpoints). The naming is uniform and predictable, using snake_case throughout with clear action-object pairs.

    Tool Count3/5

    With only 4 tools, the set feels thin for a Swagger/OpenAPI server, which typically involves operations like validating, updating, or testing APIs. While the core functions are covered, the scope could benefit from additional tools for a more comprehensive API management surface.

    Completeness3/5

    The tools cover basic operations (list, load, get, search), but there are notable gaps for a full API lifecycle, such as creating, updating, or deleting APIs/endpoints, and validating specifications. Agents can perform read and search tasks but may hit dead ends for modification workflows.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      A server that enables Large Language Models to discover and interact with REST APIs defined by OpenAPI specifications through the Model Context Protocol.
      12,706 npm
      302
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol Server that enables LLMs to interact with and execute REST API calls through natural language prompts, supporting GET/PUT/POST/PATCH operations on configured APIs.
      6
      Apache 2.0
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that loads multiple OpenAPI specifications and exposes them to LLM-powered IDE integrations, enabling AI to understand and work with your APIs directly in development tools like Cursor.
      7
      90
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      A Model Context Protocol server that generates and runs mock API servers from API documentation like OpenAPI/Swagger specs, enabling developers and AI assistants to quickly spin up mock backends for development and testing.
      18
      MIT