How to Use the Chatwoot MCP in Mastra AI
Build bulletproof Chatwoot workflows that handle errors and retries automatically. Automate your customer support logic with Mastra AI.
Works with every AI agent you already use
…and any MCP-compatible client
Connect Chatwoot MCP to Mastra AI
Create your Vinkius account to connect Chatwoot 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.
Automate Complex Support Logic
This MCP Server gives your Mastra AI agent the tools to manage Chatwoot from your backend. You can build workflows that check for new conversations with `list_woot_conversations`, get customer details using `get_contact_details`, and then take action based on your own business rules. Mastra's real power is in its conditional logic. For example: IF a conversation is from the 'Website' inbox, THEN get the full chat history with `get_chat_history` and summarize it, ELSE just send a first reply with `send_chat_message`. You define the entire sequence.
Reliable Message Delivery with Retries
APIs fail. It happens. With Mastra AI, you can wrap the `send_chat_message` tool in a retry block that uses exponential backoff. Your agent won't just give up if the Chatwoot API has a temporary glitch or network hiccup. This makes your automations far more resilient. You can design a workflow that attempts to send a message, and on failure, it uses `get_conversation_details` to check the conversation's status before trying again. If it still fails, it can trigger an alert.
Your Chatwoot MCP Server for Workflows
Connecting the Chatwoot tools to your Mastra agent is straightforward. It gives your agent a direct line to your customer support platform, equipped with all the functions needed to read and write data. These tools become the building blocks for your automated processes. A common pattern is listing all unassigned conversations with `list_woot_conversations`, looping through them, and then using `get_contact_details` to decide how to route them. This is how you build real automation, not just a simple bot.
Set up Chatwoot 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 Chatwoot 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: "chatwoot-mcp-client",
servers: {
"chatwoot-mcp": {
url: new URL(
"https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp"
),
},
},
});
const agent = new Agent({
name: "Chatwoot Agent",
model: openai("gpt-4o"),
instructions: "You have access to Chatwoot tools.",
tools: {
...(await mcpClient.listTools()),
},
});
const result = await agent.generate(
"List recent Chatwoot 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 Chatwoot. 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 Chatwoot MCP in Mastra AI
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the Chatwoot MCP today
We host it, we monitor it, we maintain it. You just paste one token.