![]() |
VOOZH | about |
Mastra is designed for developers and enterprise teams building intelligent, composable AI agents. Its modular framework and declarative architecture make it simple to orchestrate agents, integrate LLMs, and automate data-driven workflows. But when agents need to work with data beyond their local memory or predefined APIs, many implementations rely on custom middleware or scheduled syncs to copy data from external systems into local stores. This approach adds complexity, increases maintenance overhead, introduces latency, and limits the real-time potential of your agents.
CData Connect AI bridges this gap with live, direct connectivity to more than 300 enterprise applications, databases, ERPs, and analytics platforms. Through CData's remote Model Context Protocol (MCP) Server, Mastra agents can securely query, read, and act on real-time data without replication. The result is grounded responses, faster reasoning, and automated decision-making across systems all with stronger governance and fewer moving parts.
This article outlines the steps required to configure CData Connect AI MCP connectivity, register the MCP server in Mastra Studio, and build an agent that queries live Zendesk data in real time.
Before starting, make sure you have:
Ensure you have these credentials ready for the connection:
Connectivity to Zendesk from Mastra is made possible through CData Connect AI Remote MCP. To interact with Zendesk data from Mastra, we start by creating and configuring a Zendesk connection in CData Connect AI.
To connect, set the URL and provide authentication. The URL is your Zendesk Support URL: https://{subdomain}.zendesk.com.
You can authenticate using the Basic or OAuth methods.
To use Basic authentication, specify your email address and password or your email address and an API token. Set User to your email address and follow the steps below to provide the Password or ApiToken.
See the Getting Started guide in the CData driver documentation for an authentication guide.
π Configuring a connection (Salesforce is shown)A Personal Access Token (PAT) is used to authenticate the connection to Connect AI from Mastra. It is best practice to create a separate PAT for each service to maintain granularity of access.
With the connection configured and a PAT generated, we are ready to connect to Zendesk data from Mastra.
npm create mastra@latest
npm install @mastra/core @mastra/libsql @mastra/memory
npm install @mastra/mcp
Create a .env file at the project root with the following keys:
OPENAI_API_KEY=sk-... [email protected] CDATA_CONNECT_AI_PASSWORD=your_PAT
Restart your dev server after saving changes:
npm run dev
Create a file src/mastra/agents/connect-ai-agent.ts with the following code:
import { Agent } from "@mastra/core/agent";
import { Memory } from "@mastra/memory";
import { LibSQLStore } from "@mastra/libsql";
import { MCPClient } from "@mastra/mcp";
const mcpClient = new MCPClient({
servers: {
cdataConnectAI: {
url: new URL("https://connect.cdata.com/mcp/"),
requestInit: {
headers: {
Authorization: `Basic ${Buffer.from(
`${process.env.CDATA_CONNECT_AI_USER}:${process.env.CDATA_CONNECT_AI_PASSWORD}`
).toString("base64")}`,
},
},
},
},
});
export const connectAIAgent = new Agent({
name: "Connect AI Agent",
instructions: "You are a data exploration and analysis assistant with access to CData Connect AI.",
model: "openai/gpt-4o-mini",
tools: await mcpClient.getTools(),
memory: new Memory({
storage: new LibSQLStore({ url: "file:../mastra.db" }),
}),
});
Replace the contents of src/mastra/index.ts with:
import { Mastra } from "@mastra/core/mastra";
import { PinoLogger } from "@mastra/loggers";
import { LibSQLStore } from "@mastra/libsql";
import { connectAIAgent } from "./agents/connect-ai-agent.js";
export const mastra = new Mastra({
agents: { connectAIAgent },
storage: new LibSQLStore({ url: "file:../mastra.db" }),
logger: new PinoLogger({ name: "Mastra", level: "info" }),
observability: { default: { enabled: true } },
});
Start your Mastra server:
npm run devπ Start your Mastra server
In Mastra Studio, open the chat interface and enter one of the following sample prompts:
List available catalogs from my connected data sources.π Run QUery in Mastra Studio
Mastra and CData Connect AI together enable powerful AI-driven workflows where agents have live access to enterprise data and act intelligently without sync pipelines or manual integration logic.
Start your free trial today to see how CData can empower Mastra with live, secure access to hundreds of external systems.
Learn more about CData Connect AI or sign up for free trial access:
Free Trial