Swagger Navigator MCP Server

Swagger Navigator MCP Server

Enables AI assistants to discover, search, and interact with REST APIs by parsing OpenAPI/Swagger specifications with intelligent fuzzy search across endpoints, supporting both local and remote API sources.

Category
Visit Server

README

๐Ÿ” Swagger Navigator MCP Server

License: MIT Node.js TypeScript

An MCP server implementation that provides intelligent discovery and search capabilities for Swagger/OpenAPI endpoints. This tool enables AI assistants to dynamically explore, understand, and interact with REST APIs by parsing OpenAPI specifications and providing fuzzy search across endpoints.


๐Ÿš€ How It Works

The Swagger Navigator MCP Server acts as an intelligent API knowledge hub, seamlessly connecting developers with their API specifications. When you ask Cursor/Claude/LLMs to generate API clients, anticorruption layers, or type definitions, Cursor/Claude/LLMs consults the MCP server to get accurate, structured API information and then generates perfect code based on the actual API schema.

flowchart TD
    A[๐Ÿ‘จโ€๐Ÿ’ป Developer] -->|"๐Ÿ’ฌ Generate API client<br/>for /users endpoint"| B[๐ŸŽฏ Cursor/IDE/LLMs]
    B -->|"๐Ÿ” Query: What is<br/>/users endpoint?"| C[๐Ÿš€ Swagger Navigator MCP Server]
    C -->|"๐Ÿ“Š Returns endpoint<br/>schema & structure"| B
    B -->|"โœจ Here's your<br/>generated API client"| A

    style A fill:#74b9ff,stroke:#0984e3,stroke-width:2px,color:#fff
    style B fill:#a29bfe,stroke:#6c5ce7,stroke-width:2px,color:#fff
    style C fill:#ff6b6b,stroke:#333,stroke-width:4px,color:#fff

    linkStyle 0 stroke:#fd79a8,stroke-width:3px
    linkStyle 1 stroke:#00b894,stroke-width:3px
    linkStyle 2 stroke:#fdcb6e,stroke-width:3px
    linkStyle 3 stroke:#e17055,stroke-width:3px

โœจ Features

  • ๐Ÿ” Dynamic API Discovery: Automatically parse and index Swagger/OpenAPI specifications from multiple sources
  • ๐ŸŽฏ Intelligent Search: Use fuzzy matching to find relevant endpoints based on natural language queries
  • ๐Ÿ”— Multi-source Support: Handle both local files and remote HTTP endpoints with authentication
  • โšก Real-time Updates: Monitor configuration changes and refresh API data automatically
  • ๐Ÿ”„ Hot-reload Configuration: Detect config file changes without server restart

๐Ÿ› ๏ธ Tools

๐Ÿ“‹ list_all_sources

Retrieves a comprehensive list of all available Swagger/OpenAPI sources in the system.

Purpose:

  • Provides overview of all loaded API specifications
  • Shows available APIs for search and exploration
  • Returns source names for use with other tools

Returns:

  • Array of sources with name, description, and OpenAPI info (title, version)

๐Ÿ“„ list_endpoints_for_source

Retrieves all endpoints from a specific API source with pagination support.

Inputs:

  • name (string): The source name to list endpoints for
  • limit (number, optional): Maximum endpoints to return (1-100, default: 10)
  • offset (number, optional): Number of endpoints to skip (default: 0)

Returns:

  • Array of endpoints with path, method, description, and metadata
  • Pagination information with total count and navigation flags

๐Ÿ”Ž search_endpoint

Intelligently searches endpoints using fuzzy matching across multiple attributes.

Inputs:

  • query (string): Search query using natural language (e.g., "create user", "authentication", "GET users")

Returns:

  • Ranked array of matching endpoints with relevance scores
  • Weighted search across descriptions, paths, methods, and tags

โš™๏ธ Configuration

๐Ÿค– Usage with Cursor

Add this to your ~/.cursor/mcp.json:

Using npx

{
  "mcpServers": {
    "swagger-navigator-mcp": {
      "command": "npx",
      "args": ["-y", "swagger-navigator-mcp"],
      "env": {
        "CONFIG_PATH": "path/to/swagger-navigator-mcp.config.yaml"
      }
    }
  }
}

๐Ÿ“ Configuration File

Create a swagger-navigator-mcp.config.yaml file:

# Swagger Navigator MCP Server Configuration

sources:
  # Local file example
  - name: "petstore-local"
    source: "./specs/petstore.json"
    description: "Local Petstore API specification"

  # Remote HTTP source with authentication
  - name: "github-api"
    source: "https://api.github.com"
    description: "GitHub REST API v3"
    headers:
      Authorization: "token ${GITHUB_TOKEN}"
      Accept: "application/vnd.github.v3+json"

  # API with custom headers
  - name: "internal-api"
    source: "https://internal.company.com/api/swagger.json"
    description: "Internal company API"
    headers:
      X-API-Key: "${API_KEY}"

# Optional: Search configuration
search:
  fuzzyThreshold: 0.6 # 0-1, lower = more fuzzy matching

# Optional: Refresh interval in seconds
refreshInterval: 300 # Refresh every 5 minutes

๐Ÿ” Environment Variable Substitution

The configuration file supports environment variable substitution using ${VARIABLE_NAME} syntax. This allows you to securely store sensitive information like API keys and tokens outside of your configuration file.

Examples:

  • ${GITHUB_TOKEN} - Substituted with the value of the GITHUB_TOKEN environment variable
  • ${API_KEY} - Substituted with the value of the API_KEY environment variable
  • ${DATABASE_URL} - Any environment variable can be used

Note: If an environment variable is not set, the substitution will result in an empty string.

๐ŸŒ Environment Variables

Set environment variables for configuration and authentication:

export CONFIG_PATH="./swagger-navigator-mcp.config.yaml"
export GITHUB_TOKEN="your-github-token"
export API_KEY="your-api-key"

๐Ÿš€ Usage

๐Ÿ“ฆ Install Dependencies

npm install

๐Ÿ”จ Build the Project

npm run build

โ–ถ๏ธ Start the Server

CONFIG_PATH=./swagger-navigator-mcp.config.yaml npm start

๐Ÿงช Development Mode

npm run dev

๐Ÿ“„ License

This project is licensed under the ISC License - see the LICENSE file for details.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured