Skip to content

Mastra

Mastra is a TypeScript-first framework for building production AI agents. It provides a workflow engine with branching/parallel execution, a knowledge graph for structured memory, built-in evaluation for measuring agent quality, and native MCP support. If you are building agents in TypeScript (or JavaScript), Mastra provides the full stack.


Ma
Mastra
Open-Source · mastra.ai
TRANSPORT
Streamable HTTP ✓
PLATFORM
TypeScript · Framework
MCP VIA
Native MCP Support

TypeScript-Native Agent Framework with MCP

Mastra treats MCP as a first-class integration. MCP servers register in your project configuration and their tools become available to all agents and workflows. The framework handles connection management, tool discovery, and type-safe parameter mapping.

The workflow engine goes beyond simple chains — branches run in parallel, conditions control flow, and steps can pause for human review. MCP tools participate in this system as regular workflow steps, making complex automation possible without leaving TypeScript.

Key capabilities:

  • TypeScript-first — full type safety for agent configuration, tools, and workflows
  • Workflow engine — branching, parallel execution, conditions, and human-in-the-loop
  • Knowledge graphs — structured agent memory with relationships and entity tracking
  • Evaluation system — measure agent quality with built-in metrics and custom evaluators
  • Native MCP — register servers, auto-discover tools, type-safe invocation
  • Vercel AI SDK — seamless integration with the Vercel ecosystem
  • RAG support — document ingestion and retrieval with vector stores

TypeScript Configuration

1. Create a Token

In Vinkius Cloud, go to your server → Connection TokensCreate. Copy the URL.

2. Register the Server

typescript
import { Mastra } from '@mastra/core';

const mastra = new Mastra({
  mcpServers: {
    vinkius: {
      url: 'https://edge.vinkius.com/{TOKEN}/mcp',
    },
  },
});

3. Use in Agents or Workflows

MCP tools from Vinkius Cloud are available in all Mastra agents and workflows automatically.


FAQ

How does Mastra handle MCP tool types? Mastra auto-generates TypeScript types from MCP tool schemas. You get full IntelliSense and compile-time checks for tool parameters.

Can MCP tools run inside Mastra workflows? Yes. MCP tools are regular workflow steps. Wire them alongside conditions, branches, and parallel execution blocks.

How does the evaluation system work? Define metrics (accuracy, latency, tool usage patterns) and run evaluations against test cases. Results help you improve agent behavior over time.

Is Mastra free? Open-source under MIT. Use for any project without licensing costs.