Framework Integrations
The mutagent integrate command generates ready-to-use SDK integration code for your framework. This is the recommended way for AI coding assistants to integrate MutagenT into any project.
For AI Agents: Use mutagent integrate <framework> --raw to get clean markdown that can be directly applied to a codebase.
Quick Start
# Interactive - auto-detects your framework
mutagent integrate
# Direct - specify framework
mutagent integrate mastra
# Save to file
mutagent integrate langchain --output INTEGRATION.md
# Raw output for AI agents
mutagent integrate vercel-ai --raw
Supported Frameworks
| Framework | Command | Description |
|---|
| Mastra | mutagent integrate mastra | Modern AI agent framework with built-in observability |
| LangChain | mutagent integrate langchain | Most popular LLM application framework |
| LangGraph | mutagent integrate langgraph | Graph-based agent workflow framework |
| Vercel AI | mutagent integrate vercel-ai | AI SDK for streaming chat UIs |
| Claude Code | mutagent integrate claude-code | Native Anthropic Claude integration |
| Generic | mutagent integrate generic | OpenAI-compatible API endpoint |
How It Works
The CLI:
- Detects your framework from
package.json and config files
- Generates framework-specific callback handler code
- Provides step-by-step integration instructions
- Optionally verifies the integration works
Framework Examples
Mastra
mutagent integrate mastra
Generates:
import { Mastra } from '@mastra/core';
import { MutagentPlugin } from '@mutagent/mastra';
const mastra = new Mastra({
plugins: [
new MutagentPlugin({
apiKey: process.env.MUTAGENT_API_KEY,
}),
],
});
LangChain
mutagent integrate langchain
Generates:
import { ChatOpenAI } from '@langchain/openai';
import { MutagentCallbackHandler } from '@mutagent/langchain';
const handler = new MutagentCallbackHandler({
apiKey: process.env.MUTAGENT_API_KEY,
});
const llm = new ChatOpenAI({
callbacks: [handler],
});
Vercel AI SDK
mutagent integrate vercel-ai
Generates:
import { openai } from '@ai-sdk/openai';
import { streamText } from 'ai';
import { withMutagent } from '@mutagent/vercel-ai';
const result = await streamText({
model: withMutagent(openai('gpt-5.1'), {
apiKey: process.env.MUTAGENT_API_KEY,
}),
prompt: 'Hello!',
});
Options
| Option | Description |
|---|
-o, --output <path> | Save integration guide to file |
--raw | Output raw markdown without terminal formatting |
--verify | Test the integration after generation |
Auto-Detection
When run without arguments, the CLI scans your project:
It checks:
package.json dependencies
- Common config files (
mastra.config.ts, langchain.config.js, etc.)
- Import patterns in source files
And suggests the most likely framework with a confidence score.
List Available Frameworks
Output:
Available frameworks:
mastra Modern AI agent framework
langchain Popular LLM framework
langgraph Agent workflow framework
vercel-ai AI SDK for streaming chat
claude-code Native Anthropic integration
generic OpenAI-compatible endpoint