Skip to main content

Partnership

Mastra has officially featured Klavis AI in their MCP registry documentation, showcasing how to connect to MCP servers for building powerful AI agents.
Mastra and Klavis Integration - Connect to MCP servers through registry

Prerequisites

Before we begin, you’ll need OpenAI API key and Klavis API key.
You can find the complete example code in Klavis GitHub repository: 📁 Checkout here

Setup Environment Variables

Create a .env file in your project root:

Project Structure

Code Example

Running the Agent

Video Tutorial

Summary

This implementation demonstrates how to integrate Mastra with Klavis Strata servers to access multiple MCP services (Gmail and Slack) through a single unified server. The agent is configured with MCP tools and can interact with various services through the MCP protocol.

Useful Resources

Happy building with Mastra and Klavis! 🚀