Skip to main content

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:
This creates a 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:
Get your Metorial API key and deployment ID at https://metorial.com/

3. Use in Your Widgets

Import and use the Metorial integration in your FastApps tools:

Generated File Structure

When you run fastapps use metorial, a metorial_mcp.py file is created in the /server/api folder: /server/api/metorial_mcp.py

What This File Does

The metorial_mcp.py file provides a simple API wrapper to:
  1. Load Credentials - Automatically loads API keys and deployment ID from environment variables
  2. Simple Interface - Provides a clean call_metorial() function with minimal parameters
  3. Handle Authentication - Validates required environment variables
  4. 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