Enables access to GitHub's API through OpenAPI specifications, allowing AI agents to interact with GitHub resources using dynamically generated tools.
Provides integration with LangChain for AI agents to use dynamically generated MCP tools for natural language interaction with APIs defined by OpenAPI specifications.
Supports LangGraph integration for building AI agent workflows that can interact with APIs through dynamically generated tools from OpenAPI specifications.
Dynamically generates MCP tools from Swagger/OpenAPI specifications (2.0, 3.0.x, 3.1.x), converting API operations into callable tools with full parameter validation and authentication support.
FastMCP OpenAPI
A FastMCP wrapper that dynamically generates MCP (Model Context Protocol) tools from OpenAPI specifications.
Quick Start
Prerequisites
Python 3.8+ with pip
Node.js 16+ (for MCP Inspector)
OpenAI API key (for LangChain demos)
Installation
Basic Usage
Test with MCP Inspector
Claude Desktop Integration
Add to your Claude Desktop config:
Features
✅ Dynamic Tool Generation: Converts OpenAPI operations to MCP tools automatically
✅ Type Safety: Full parameter validation using OpenAPI schemas
✅ Authentication: Bearer tokens, API keys, Basic auth
✅ Multiple APIs: Load multiple OpenAPI specs in one server
✅ Real-time: Add/remove APIs without restart
Command Line Options
Programmatic Usage
Examples
Multiple APIs with Different Auth
Mixed API Sources
Authenticated API
Development Mode
LangChain Integration
The LangChain integration allows AI agents to use the generated MCP tools for natural language interaction with APIs.
How It Works
Load OpenAPI Spec: Fetches and parses OpenAPI/Swagger specifications
Generate Tools: Creates MCP tools for each API operation with proper schemas
Handle Requests: Validates parameters and makes authenticated HTTP requests
Return Results: Formats API responses for AI consumption
Supported Features
✅ OpenAPI 3.0.x, 3.1.x, Swagger 2.0
✅ Path/query parameters, headers, request bodies
✅ Authentication (Bearer, API Key, Basic)
✅ Parameter validation and type checking
✅ Multiple APIs in one server
✅ Multiple transports: stdio, streamable-http, sse
✅ LangChain integration for AI agents
✅ MCP Inspector support for interactive testing
Testing & Examples
Quick Test with Petstore API
Available Transport Modes
stdio: Standard input/output (default, for Claude Desktop)streamable-http: HTTP-based transport (for LangChain integration)sse: Server-Sent Events transport (for MCP Inspector)
Multiple API Management
FastMCP OpenAPI supports combining multiple OpenAPI specifications into a single MCP server, each with their own base URLs and authentication.
Configuration Methods
Method 1: JSON Configuration (Recommended)
Create a JSON config file to clearly define each API:
Method 2: Command Line Arguments (Positional Matching)
⚠️ Important: Arguments must be in the same order - each --base-url and --auth-header matches the corresponding --spec by position.
Benefits
Unified Interface: Access multiple APIs through one MCP server
Individual Configuration: Each API can have its own base URL and auth
Tool Namespacing: Tools are automatically prefixed to avoid conflicts
Mixed Sources: Combine remote APIs, local services, and files
Tool Naming Convention
When multiple APIs are loaded, tools are automatically prefixed:
Single API:
operationId→getPetByIdMultiple APIs:
api_name_operationId→petstore_getPetById,github_getUser
Development
License
MIT License