How to Use the Zengain MCP in Mastra AI
Build complex, fault-tolerant workflows with Zengain using Mastra AI.
Works with every AI agent you already use
…and any MCP-compatible client
Connect Zengain MCP to Mastra AI
Create your Vinkius account to connect Zengain to Mastra AI and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Run Multi-Step Data Investigations
You don't just need one piece of data; you need a sequence. Use Mastra AI to chain together actions, like first calling `list_products` and then running `get_product` for each item found. The workflow engine manages the entire process. If the initial product search fails, the system doesn't crash. It automatically retries or moves to a fallback step, ensuring your data pipeline remains stable.
Manage User and Account Lifecycle
Handling user accounts requires precision. Set up a workflow that first calls `list_users` to check existence, then runs `get_user_details`, and finally triggers an action like tracking an event via `track_event`. Mastra AI handles the conditional logic here. This reliability is key. If the user data endpoint times out, your agent knows exactly how to handle that failure without needing manual intervention.
Analyze Business Health Over Time
Measuring customer health isn't a one-time thing. Build a workflow that regularly calls `get_health_score` and logs the result using `list_events`. Mastra AI ensures these checks run on schedule, even if external services are flaky. Furthermore, you can use the tool to check general analytics summaries (`get_analytics_summary`) as part of an automated reporting cycle. The workflow handles retries until it gets a clean report.
Set up Zengain MCP in Mastra AI
Prerequisites
- Node.js 18+ and a TypeScript project
-
@mastra/mcp+@mastra/corepackages - Active Vinkius subscription with a valid endpoint token
- 1
Install dependencies
Run
npm install @mastra/mcp @mastra/coreplus your preferred model provider (e.g.@ai-sdk/openai). - 2
Configure the MCPClient
Create an
MCPClientwith your Vinkius endpoint as aURLobject. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. - 3
Discover and inject tools
Call
mcpClient.listTools()and spread the result into your agent'stoolsobject. All Zengain tools become native Mastra tools. - 4
Run with any model
Swap
openai("gpt-4o")for any AI SDK-compatible provider. Callagent.generate()and the agent routes tool calls through MCP automatically.
import { MCPClient } from "@mastra/mcp";
import { Agent } from "@mastra/core/agent";
import { openai } from "@ai-sdk/openai";
const mcpClient = new MCPClient({
id: "zengain-mcp-client",
servers: {
"zengain-mcp": {
url: new URL(
"https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp"
),
},
},
});
const agent = new Agent({
name: "Zengain Agent",
model: openai("gpt-4o"),
instructions: "You have access to Zengain tools.",
tools: {
...(await mcpClient.listTools()),
},
});
const result = await agent.generate(
"List recent Zengain transactions"
);
console.log(result.text); Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Zengain. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about Zengain MCP in Mastra AI
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the Zengain MCP today
We host it, we monitor it, we maintain it. You just paste one token.