Overview
What is mastra
Mastra is an opinionated TypeScript framework designed to help developers quickly build AI applications and features. It offers essential components such as workflows, agents, RAG (Retrieval-Augmented Generation), integrations, and evaluations.
How to Use
To use Mastra, you can install it via npm and set up your development environment. You can run Mastra locally or deploy it to a serverless cloud platform. The framework provides a unified interface for interacting with various LLM providers.
Key Features
Key features of Mastra include support for multiple LLM models (like GPT-4, Claude, Gemini, and Llama), a unified interface for model routing through the Vercel AI SDK, and the ability to create workflows and agents for various AI tasks.
Where to Use
Mastra can be used in various fields such as software development, AI research, and any application requiring natural language processing or AI-driven functionalities.
Use Cases
Use cases for Mastra include building chatbots, developing AI assistants, implementing RAG systems for enhanced information retrieval, and creating custom AI workflows for specific business needs.
Usage
Installation
Generate your exclusive SSE URL:
MCP Server Configuration (for all clients):
Installation in Cursor
Click on the Cursor settings icon in the top right, find the MCP option, then click the + button in the top right of that page and add the configuration in the config panel.
Note: Do not delete previously added configuration items
After completion, restart Cursor, chat with Cursor, and you can use MCP functions
Installation in Claude
Find this json file at the following path: macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json If this file doesn't exist, create one and paste the content above into the file.
Note: Do not delete previously added configuration items.
After completion, restart Claude, and you can use MCP functions through the Claude dialog
SDK
Installation in Python
Install composio-toolset by running the following commands in your terminal:
pip install composio_openai
Python example code:
from composio_openai import ComposioToolSet, App
from openai import OpenAI
openai_client = OpenAI()
composio_toolset = ComposioToolSet(entity_id="default")
tools = composio_toolset.get_tools(apps=[App.GITHUB])
Installation in TypeScript
Install composio-core by running the following commands in your terminal:
npm install -g composio_core
TypeScript example code:
import { OpenAI } from "openai";
import { OpenAIToolSet } from "composio-core";
const openaiClient = new OpenAI();
const composioToolset = new OpenAIToolSet();
const tools = await composioToolset.getTools({
apps: ["github"],
});