Labsco
SagenKoder logo

OpenAPI MCP Server

โ˜… 1

from SagenKoder

Explore and analyze OpenAPI specifications from local files or remote URLs.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

OpenAPI MCP Server

A Model Context Protocol (MCP) server that enables LLMs to explore and understand OpenAPI specifications through structured tools.

Features

  • ๐Ÿ” Smart API Exploration - Navigate APIs by categories, endpoints, and schemas
  • ๐Ÿš€ Multiple Modes - Run as stdio (for Claude Desktop), HTTP server, or interactive CLI
  • ๐Ÿ’พ Intelligent Caching - Caches remote OpenAPI specs for faster access
  • ๐Ÿ—๏ธ Multi-Architecture - Supports Linux AMD64 and ARM64

Available Tools

The server provides these tools to LLMs:

  1. list_categories - List API categories based on path segments
  2. list_endpoints - List endpoints, optionally filtered by category
  3. show_endpoint - Show detailed endpoint information including parameters and schemas
  4. get_spec_info - Get general information about the API
  5. show_schema - Inspect specific schema components

Examples

Local File

OPENAPI_SPEC_URL=/path/to/openapi.yaml ./openapi-mcp-stdio

With Custom Cache

OPENAPI_CACHE_DIR=/tmp/api-cache \
OPENAPI_SPEC_URL=https://api.example.com/openapi.json \
./openapi-mcp-stdio

Docker with Volume Mount

docker run -i --rm \
  -v $(pwd)/openapi.yaml:/openapi.yaml:ro \
  -e OPENAPI_SPEC_URL=/openapi.yaml \
  ghcr.io/sagenkoder/go-openapi-exploration-mcp-server:latest

Development

Project Structure

cmd/
โ”œโ”€โ”€ openapi-mcp-stdio/       # MCP stdio mode
โ”œโ”€โ”€ openapi-mcp-http/        # HTTP server mode
โ””โ”€โ”€ openapi-mcp-interactive/ # Interactive CLI mode

internal/
โ”œโ”€โ”€ cache.go      # Caching logic
โ”œโ”€โ”€ handlers.go   # MCP tool handlers
โ”œโ”€โ”€ server.go     # Core server logic
โ””โ”€โ”€ utils.go      # Utilities

Building Docker Images

# Build specific mode
docker build --build-arg MODE=stdio -t my-openapi-mcp:stdio .

# Build all modes
./build.sh docker