Enables loading, parsing, and comprehensive querying of OpenAPI/Swagger documentation with 10 specialized tools for exploring API specifications, endpoints, schemas, authentication, and performing intelligent searches across API documentation.
OpenAPI Search MCP Server
This project was built with the assistance of
A powerful Model Context Protocol (MCP) server for loading, parsing, and querying OpenAPI/Swagger documentation.
Features • Quick Start • Installation • Docker • Usage • Architecture
Overview
OpenAPI Search MCP Server is a specialized MCP server that makes OpenAPI/Swagger documentation easily accessible to AI assistants and other MCP clients. It provides 10 powerful tools for loading, searching, and querying API specifications in multiple formats.
Why Use This?
AI-Friendly API Documentation: Make your OpenAPI specs queryable by AI assistants like Claude
Intelligent Search: Multi-criteria search across paths, methods, tags, and keywords
Fast Lookups: Pre-built indexes for O(1) operationId queries
Format Flexibility: Auto-detects JSON and YAML formats
Modular Architecture: Clean, maintainable codebase following Python best practices
Features
🔄 Load from URL - Fetch OpenAPI documents from any HTTP/HTTPS endpoint
💾 In-Memory Storage - Fast access with structured document storage
🔍 10 Query Tools - Comprehensive API exploration capabilities
📚 Multi-Format Support - JSON and YAML with automatic detection
🚀 Version Support - OpenAPI 3.0.x, 3.1.x, and Swagger 2.0
🏗️ Layered Architecture - Modular design with dependency injection
⚡ Fast Indexing - Pre-built operationId and tag indexes
🔐 Auth Discovery - Extract security schemes and requirements
🏷️ Tag-Based Navigation - Browse APIs by functional categories
🎯 Precise Search - Filter by keyword, method, tag, or combinations
Quick Start
That's it! The server is now running and ready to accept MCP connections.
Installation
Prerequisites
Python 3.12 or higher
Conda (recommended) or venv
Step 1: Clone the Repository
Step 2: Create Virtual Environment
Using Conda (Recommended):
Using venv:
Step 3: Install Dependencies
Dependencies
FastMCP (>=0.2.0) - MCP server framework
httpx (>=0.27.0) - Async HTTP client for fetching documents
PyYAML (>=6.0) - YAML parsing support
Pydantic (>=2.0.0) - Type-safe data models
Docker Deployment
For quick and isolated deployment, you can use Docker.
Prerequisites
Docker installed (Get Docker)
Docker Compose (optional, included with Docker Desktop)
Option 1: Using Docker Compose (Recommended)
The easiest way to deploy:
The server will be available at http://localhost:8848
Option 2: Using Docker Directly
Build and run manually:
Docker Configuration
The Docker setup includes:
Base Image:
python:3.12-slim
(lightweight)Port: 8848 (configurable via environment variable)
Health Check: Automatic health monitoring
Resource Limits: Configurable in
docker-compose.yml
Logging: JSON file driver with rotation
Environment Variables
You can customize the deployment by setting environment variables:
Accessing from Claude Desktop
When using Docker, update your Claude Desktop configuration to point to the HTTP endpoint:
Configuration
Claude Desktop Integration
To use this MCP server with Claude Desktop, add the following configuration:
macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Option 1: Using Conda
Option 2: Using Direct Python Path
After adding the configuration, restart Claude Desktop to load the MCP server.
HTTP Mode (Standalone Server)
By default, the server runs in HTTP mode on port 8848. To customize:
Edit main.py
line 57:
Usage
Available Tools
The server provides 10 MCP tools for comprehensive API exploration:
1. load_openapi
Load an OpenAPI document from URL and save to memory.
Parameters:
name
(string, required) - API identifier for subsequent queriesurl
(string, required) - URL of the OpenAPI document
Example:
Response:
2. list_apis
List all loaded APIs with basic information.
Parameters: None
Response:
3. get_path_details
Get complete documentation for a specific API path.
Parameters:
name
(string, required) - API namepath
(string, required) - API path, e.g.,/users/{id}
Example:
Response:
4. list_all_paths
List all paths in an API.
Parameters:
name
(string, required) - API name
Response:
5. get_operation_by_id
Fast lookup by operationId.
Parameters:
name
(string, required) - API nameoperation_id
(string, required) - operationId, e.g.,getUserById
Example:
Response:
6. search_endpoints
Search endpoints by keyword, method, tag, or combinations.
Parameters:
name
(string, required) - API namekeyword
(string, optional) - Search in path, summary, descriptionmethod
(string, optional) - HTTP method filter (GET, POST, etc.)tag
(string, optional) - Tag filter
Example:
Response:
7. list_tags
List all tags in an API.
Parameters:
name
(string, required) - API name
Response:
8. get_endpoints_by_tag
Get all endpoints with a specific tag (overview only).
Parameters:
name
(string, required) - API nametag
(string, required) - Tag name
Example:
Response:
9. get_schema_details
Get data model definition from components/schemas.
Parameters:
name
(string, required) - API nameschema_name
(string, required) - Schema name, e.g.,User
,Pet
Example:
Response:
10. get_auth_info
Get authentication configuration.
Parameters:
name
(string, required) - API name
Response:
Typical Workflows
Workflow 1: Exploring a New API
Workflow 2: Finding Specific Functionality
Workflow 3: Understanding Authentication
Architecture
OpenAPI Search MCP follows a clean layered architecture inspired by enterprise patterns:
Key Design Principles
Separation of Concerns - Each layer has a single responsibility
Dependency Injection - Services receive dependencies via constructor
Type Safety - Pydantic models throughout
Interface-Oriented - Clear contracts between layers
Testability - Each layer can be unit tested independently
Layers Explained
Config Layer - Centralized constants and error messages
Models Layer - Type-safe data structures with validation
Storage Layer - In-memory document storage with consistent error handling
Loaders Layer - HTTP fetching and format detection (JSON/YAML)
Indexers Layer - Building reverse indexes for fast lookups
Services Layer - Business logic (5 services: API, Path, Schema, Search, Tag)
Tools Layer - MCP tool registrations (3 modules)
Entry Layer - Application initialization with dependency wiring
Project Structure
Tech Stack
Technology | Version | Purpose |
Python | 3.12+ | Runtime environment |
FastMCP | >=0.2.0 | MCP server framework |
httpx | >=0.27.0 | Async HTTP client for fetching documents |
PyYAML | >=6.0 | YAML format parsing |
Pydantic | >=2.0.0 | Type-safe data models and validation |
Supported OpenAPI Versions
✅ OpenAPI 3.0.x
✅ OpenAPI 3.1.x
✅ Swagger 2.0
Both JSON and YAML formats are automatically detected and supported.
FAQ
How do I load a local OpenAPI file?
Currently, only URL loading is supported. You can:
Use a local file server:
python -m http.server 8000
Access via:
http://localhost:8000/openapi.json
Future versions will support direct file path loading.
Are documents persisted between restarts?
No, documents are stored in memory only. After server restart, you'll need to reload your OpenAPI documents. This design prioritizes simplicity and speed over persistence.
How do I switch between STDIO and HTTP mode?
Edit main.py
line 57:
Can I load multiple versions of the same API?
Yes, just use different names:
What happens if I load an API with an existing name?
The new document will overwrite the existing one. The server will log a warning message.
Development
Running Tests
Code Structure
See CLAUDE.md for detailed architecture documentation and development guidelines.
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Make your changes
Add tests
Submit a pull request
License
MIT License - see LICENSE for details.
Acknowledgments
This project was developed with the assistance of , Anthropic's AI-powered coding assistant. Claude Code helped with:
Architectural design and refactoring from monolithic to layered structure
Implementation of the service layer with dependency injection
Documentation and code organization
Best practices for Python enterprise development
The project demonstrates the power of human-AI collaboration in software development.
Links
Built with Claude Code • OpenAPI Search MCP Server • MIT License
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables AI assistants to load, parse, and query OpenAPI/Swagger documentation from URLs with intelligent search across endpoints, schemas, and authentication methods. Provides 10 specialized tools for comprehensive API exploration including path details, operation lookups, and multi-criteria search capabilities.