What You’ll Build
By the end of this guide, you’ll have:- ✅ An app that automatically generates tools from an OpenAPI spec
- ✅ Type-safe input validation for all API endpoints
- ✅ Authentication configured for API requests
- ✅ Tools that inherit all your app-level plugins and providers
Prerequisites
- A FrontMCP project initialized (see Installation)
- An OpenAPI 3.x specification (URL or local file)
- Basic understanding of REST APIs
Step 1: Install the Adapter
Step 2: Add Adapter to Your App
Create or update your app to include the OpenAPI adapter:Step 3: Configure Your Server
Add your app to the FrontMCP server:src/main.ts
Step 4: Run and Test
1
Start the server
2
Verify tools are loaded
Check the console output for messages like:
[INFO] Generated 15 tools from expense-api [INFO] Server listening on http://localhost:30003
Test with Inspector
Understanding Generated Tools
Each OpenAPI operation becomes a tool with:Tool Naming
Tools are named using the pattern:{adapter-name}:{method}_{path}
For example:
GET /users→expense-api:get_usersPOST /expenses→expense-api:post_expensesGET /expenses/{id}→expense-api:get_expenses_id
Input Schema
The adapter automatically converts OpenAPI parameters to Zod schemas:OpenAPI spec
Advanced Configuration
Filter Operations
Only include specific endpoints:User-Based Authentication
Use authenticated user context for API requests:Multi-Tenant Setup
Include tenant ID from user context:How It Works
1
Load Spec
The adapter fetches and parses the OpenAPI specification from the URL or uses the provided spec object
2
Generate Tools
Each operation in the spec becomes an MCP tool with: - Automatic input schema (path params, query params, headers,
body) - Type-safe validation using Zod - Description from the operation summary
3
Register Tools
Generated tools are registered with your app and inherit: - App-level plugins (caching, logging, etc.) - App-level
providers - App-level authentication
4
Execute Requests
When a tool is called:
- Input is validated against the schema
- Headers/body are mapped (if configured)
- HTTP request is made to the API
- Response is parsed and returned
Common Patterns
Expose multiple APIs
Expose multiple APIs
Add multiple adapters to one app:
Combine with custom tools
Combine with custom tools
Mix generated and hand-written tools:
Apply plugins to generated tools
Apply plugins to generated tools
Generated tools inherit app plugins:Now all generated tools can use caching!
Troubleshooting
No tools generated
No tools generated
Possible causes:
- Invalid OpenAPI spec URL
- Spec is OpenAPI 2.0 (only 3.x supported)
- All operations filtered out by
filterFn
- Verify the URL is accessible
- Convert OpenAPI 2.0 to 3.x using Swagger Editor
- Check your filter configuration
Authentication errors (401)
Authentication errors (401)
Possible causes:
- Missing or invalid API credentials
- Headers not properly mapped
- Verify
additionalHeadersorheadersMapperconfiguration - Check that
authInfo.tokencontains the expected value - Test the API directly with curl/Postman first
Tools have unexpected inputs
Tools have unexpected inputs
Possible cause:
- OpenAPI spec has complex parameter definitions
- Use
inputSchemaMapperto transform the schema:
What’s Next?
Full OpenAPI Adapter Docs
Explore all configuration options and advanced features
Authentication Setup
Learn how to configure authentication for your APIs
Plugin System
Add caching, logging, and other features to generated tools
Demo App
See a complete example using the OpenAPI adapter

