Use Agno to Talk to Your Microsoft Dataverse Data via CData Connect AI

Anusha M B
Anusha M B
Technical Marketing Engineer
Leverage the CData Connect AI Remote MCP Server to enable Agno agents to securely answer questions and take actions on your Microsoft Dataverse data for you.

Agno is a developer-first Python framework for building AI agents that reason, plan, and take actions using tools. Agno emphasizes a clean, code-driven architecture where the agent runtime remains fully under developer control.

CData Connect AI provides a secure cloud-to-cloud interface for integrating 300+ enterprise data sources with AI systems. Using Connect AI, live Microsoft Dataverse data data can be exposed through a remote MCP endpoint without replication.

In this guide, we build a production-ready Agno agent using the Agno Python SDK. The agent connects to CData Connect AI via MCP using streamable HTTP, dynamically discovers available tools, and invokes them to query live Microsoft Dataverse data.

Prerequisites

  1. Python 3.9+.
  2. A CData Connect AI account – Sign up or log in here.
  3. An active Microsoft Dataverse account with valid credentials.
  4. An LLM API key (for example, OpenAI).

Overview

Here is a high-level overview of the process:

  1. Connect: Configure a Microsoft Dataverse connection in CData Connect AI.
  2. Discover: Use MCP to dynamically retrieve tools exposed by CData Connect AI.
  3. Query: Wrap MCP tools as Agno functions and query live Microsoft Dataverse data.

About Microsoft Dataverse Data Integration

CData provides the easiest way to access and integrate live data from Microsoft Dataverse (formerly the Common Data Service). Customers use CData connectivity to:

  • Access both Dataverse Entities and Dataverse system tables to work with exactly the data they need.
  • Authenticate securely with Microsoft Dataverse in a variety of ways, including Azure Active Directory, Azure Managed Service Identity credentials, and Azure Service Principal using either a client secret or a certificate.
  • Use SQL stored procedures to manage Microsoft Dataverse entities - listing, creating, and removing associations between entities.

CData customers use our Dataverse connectivity solutions for a variety of reasons, whether they're looking to replicate their data into a data warehouse (alongside other data sources)or analyze live Dataverse data from their preferred data tools inside the Microsoft ecosystem (Power BI, Excel, etc.) or with external tools (Tableau, Looker, etc.).


Getting Started


Step 1: Configure Microsoft Dataverse in CData Connect AI

To enable Agno to query live Microsoft Dataverse data, first create a Microsoft Dataverse connection in CData Connect AI. This connection is exposed through the CData Remote MCP Server.

  1. Log into Connect AI, click Sources, and then click Add Connection.
  2. Select "Microsoft Dataverse" from the Add Connection panel.
  3. Enter the required authentication properties.

    You can connect without setting any connection properties for your user credentials. Below are the minimum connection properties required to connect.

    • InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
    • OrganizationUrl: Set this to the organization URL you are connecting to, such as https://myorganization.crm.dynamics.com.
    • Tenant (optional): Set this if you wish to authenticate to a different tenant than your default. This is required to work with an organization not on your default Tenant.

    When you connect the Common Data Service OAuth endpoint opens in your default browser. Log in and grant permissions. The OAuth process completes automatically.

    Click Create & Test.
  4. Open the Permissions tab and configure user access.

Add a Personal Access Token

A Personal Access Token (PAT) authenticates MCP requests from Agno to CData Connect AI.

  1. Open Settings and navigate to Access Tokens.
  2. Click Create PAT.
  3. Save the generated token securely.

Step 2: Install dependencies and configure environment variables

Install Agno and the MCP adapter dependencies. LangChain is included strictly for MCP tool compatibility.

pip install agno agno-mcp langchain-mcp-adapters

Configure environment variables:

export CDATA_MCP_URL="https://mcp.cloud.cdata.com/mcp"
export CDATA_MCP_AUTH="Base64EncodedCredentials"
export OPENAI_API_KEY="your-openai-key"

Where "Base64EncodedCredentials" is your Connect AI user email and your Personal Access Token joined by a colon (":") and Base64 Encoded: Base64([email protected]:MY_CONNECT_AI_PAT)

Step 3: Connect to CData Connect AI via MCP

Create an MCP client using streamable HTTP. This establishes a secure connection to CData Connect AI.

import os
from langchain_mcp_adapters.client import MultiServerMCPClient

mcp_client = MultiServerMCPClient(
  connections={
    "default": {
      "transport": "streamable_http",
      "url": os.environ["CDATA_MCP_URL"],
      "headers": {
        "Authorization": f"Basic {os.environ['CDATA_MCP_AUTH']}"
      }
    }
  }
)

Step 4: Discover MCP tools

CData Connect AI exposes operations as MCP tools. These are retrieved dynamically at runtime.

langchain_tools = await mcp_client.get_tools()
for tool in langchain_tools:
  print(tool.name)

Step 5: Convert MCP tools to Agno functions

Each MCP tool is wrapped as an Agno function so it can be used by the agent.

NOTE: Agno performs all reasoning, planning, and tool selection.LangChain is used only as a lightweight MCP compatibility layer to consume tools exposed by CData Connect AI.

from agno.tools import Function

def make_tool_caller(lc_tool):
  async def call_tool(**kwargs):
    return await lc_tool.ainvoke(kwargs)
  return call_tool

Step 6: Create an Agno agent and query live Microsoft Dataverse data

Agno performs all reasoning, planning, and tool invocation. LangChain plays no role beyond MCP compatibility.

from agno.agent import Agent
from agno.models.openai import OpenAIChat

agent = Agent(
  model=OpenAIChat(
    id="gpt-4o",
    temperature=0.2,
    api_key=os.environ["OPENAI_API_KEY"]
  ),
  tools=agno_tools,
  markdown=True
)

await agent.aprint_response(
  "Show me the top 5 records from the available data source"
)

if __name__ == "__main__":
    asyncio.run(main())

The results below show an Agno agent invoking MCP tools through CData Connect AI and returning live Microsoft Dataverse data data.

You can now query live Microsoft Dataverse data using natural language through your Agno agent.


Get CData Connect AI

To get live data access to 300+ SaaS, Big Data, and NoSQL sources directly from your cloud applications, try CData Connect AI today!

Ready to get started?

Learn more about CData Connect AI or sign up for free trial access:

Free Trial