![]() |
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 Odoo data in real time.
Accessing and integrating live data from Odoo has never been easier with CData. Customers rely on CData connectivity to:
Users frequently integrate Odoo with analytics tools such as Power BI and Qlik Sense, and leverage our tools to replicate Odoo data to databases or data warehouses.
Before starting, make sure you have:
Ensure you have these credentials ready for the connection:
Connectivity to Odoo from Mastra is made possible through CData Connect AI Remote MCP. To interact with Odoo data from Mastra, we start by creating and configuring a Odoo connection in CData Connect AI.
To connect, set the Url to a valid Odoo site, User and Password to the connection details of the user you are connecting with, and Database to the Odoo database.
π 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 Odoo 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