Use Agno to Talk to Your Paylocity 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 Paylocity 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 Paylocity 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 Paylocity data.

Prerequisites

  1. Python 3.9+.
  2. A CData Connect AI account – Sign up or log in here.
  3. An active Paylocity 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 Paylocity 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 Paylocity data.

Step 1: Configure Paylocity in CData Connect AI

To enable Agno to query live Paylocity data, first create a Paylocity 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 "Paylocity" from the Add Connection panel.
  3. Enter the required authentication properties.

    Set the following to establish a connection to Paylocity:

    • RSAPublicKey: Set this to the RSA Key associated with your Paylocity, if the RSA Encryption is enabled in the Paylocity account.

      This property is required for executing Insert and Update statements, and it is not required if the feature is disabled.

    • UseSandbox: Set to true if you are using sandbox account.
    • CustomFieldsCategory: Set this to the Customfields category. This is required when IncludeCustomFields is set to true. The default value for this property is PayrollAndHR.
    • Key: The AES symmetric key(base 64 encoded) encrypted with the Paylocity Public Key. It is the key used to encrypt the content.

      Paylocity will decrypt the AES key using RSA decryption.
      It is an optional property if the IV value not provided, The driver will generate a key internally.

    • IV: The AES IV (base 64 encoded) used when encrypting the content. It is an optional property if the Key value not provided, The driver will generate an IV internally.

    Connect Using OAuth Authentication

    You must use OAuth to authenticate with Paylocity. OAuth requires the authenticating user to interact with Paylocity using the browser. For more information, refer to the OAuth section in the Help documentation.

    The Pay Entry API

    The Pay Entry API is completely separate from the rest of the Paylocity API. It uses a separate Client ID and Secret, and must be explicitly requested from Paylocity for access to be granted for an account. The Pay Entry API allows you to automatically submit payroll information for individual employees, and little else. Due to the extremely limited nature of what is offered by the Pay Entry API, we have elected not to give it a separate schema, but it may be enabled via the UsePayEntryAPI connection property.

    Please be aware that when setting UsePayEntryAPI to true, you may only use the CreatePayEntryImportBatch & MergePayEntryImportBatchgtable stored procedures, the InputTimeEntry table, and the OAuth stored procedures. Attempts to use other features of the product will result in an error. You must also store your OAuthAccessToken separately, which often means setting a different OAuthSettingsLocation when using this connection property. 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 Paylocity 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 Paylocity data data.

You can now query live Paylocity 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