Overview
FastApps allows you to integrate external MCP servers as APIs in your widgets using Metorial. Metorial is an open-source integration platform that provides access to 600+ MCP servers with enterprise-grade observability and scaling. With FastApps + Metorial integration, you can:- Access hundreds of verified MCP servers (Slack, Gmail, Google Calendar, etc.)
- Use external MCP servers directly as APIs in your tools
- Get instant deployment with built-in scaling
- Monitor and debug with detailed logging
Quick Setup
1. Generate Integration File
Run the FastApps CLI command to generate the Metorial integration:metorial_mcp.py file under the /api folder in your project.
2. Configure Environment Variables
Add your Metorial API key, OpenAI API key, and deployment ID to your environment:3. Use in Your Widgets
Import and use the Metorial integration in your FastApps tools:Generated File Structure
When you runfastapps use metorial, a metorial_mcp.py file is created in the /server/api folder:
/server/api/metorial_mcp.py
What This File Does
Themetorial_mcp.py file provides a simple API wrapper to:
- Load Credentials - Automatically loads API keys and deployment ID from environment variables
- Simple Interface - Provides a clean
call_metorial()function with minimal parameters - Handle Authentication - Validates required environment variables
- Return Results - Processes and returns text responses from MCP servers
Using MCP Servers in Widgets
Basic Example
Here’s how to integrate external MCP servers in your FastApps widget:Custom Deployment
Use a specific deployment ID or customize the model:Learn More
For complete documentation and advanced features, visit: Metorial Documentation: https://metorial.com/Next Steps
Tool Basics
Back to Tool Basics
API Integration
External API Integration
Advanced Patterns
Advanced Tool Patterns

