Build AI Agents with Cosmos DB Data in IBM watsonx Orchestrate using CData Connect AI

Mohsin Turki
Mohsin Turki
Technical Marketing Engineer
Learn how to build intelligent agents in IBM watsonx Orchestrate that can securely access and act on live Cosmos DB data through CData Connect AI.

IBM watsonx Orchestrate is a no-code and pro-code AI agent platform that lets you rapidly build and deploy intelligent automation workflows. You can design collaborative agents capable of executing real business tasks that connect seamlessly to large language models (LLMs) and enterprise systems.

Agents in watsonx Orchestrate can reason, plan, and integrate with APIs and tools to deliver automated workflows that augment human teams.

CData Connect AI integrates IBM watsonx Orchestrate with over 350+ enterprise data sources and cloud services. With Connect AI, agents can query and act on live Cosmos DB data in real time — without replication or data movement. Connect AI provides governed, secure access using the Model Context Protocol (MCP) while keeping your data within its original system.

Together, IBM watsonx Orchestrate and CData Connect AI enable you to:

  • Build AI agents that interact directly with governed enterprise data through CData's MCP server.
  • Manage authentication securely — credentials and tokens remain encrypted and private.
  • Query live Cosmos DB data without copying or replicating it.
  • Maintain governance and compliance using CData's unified connectivity platform.

In this article, you will learn how to connect Cosmos DB to CData Connect AI, import Remote MCP tools into IBM watsonx Orchestrate, and build secure, real-time agent workflows using live Cosmos DB data.

Prerequisites

  1. A CData Connect AI account – Sign up for a free trial or log in to your existing account.
  2. An IBM watsonx Orchestrate account – Start a 30-day free trial.
  3. A Cosmos DB account with valid credentials.
  4. Python 3.x and pip installed for using the IBM watsonx Orchestrate Agent Development Kit (ADK) to manage or import MCP toolkits.

Overview

Here is a quick overview of the steps covered in this article:

  1. Connect: Add a connection to your Cosmos DB in CData Connect AI and verify that the connection is successful.
  2. Build: Create an AI agent in IBM watsonx Orchestrate by authenticating the connection to Cosmos DB from Connect AI and importing the MCP tools using the ADK.
  3. Deploy: Deploy and test your AI agent in watsonx Orchestrate to confirm real-time interaction with live Cosmos DB data through CData Connect AI.

Step 1: Configure Cosmos DB Connectivity for IBM watsonx

Before connecting IBM watsonx Orchestrate to Cosmos DB, you must first create a connection to Cosmos DB in CData Connect AI. This connection enables the Remote MCP server to access live Cosmos DB data through a secure, governed endpoint.

Note: If you have already added a Cosmos DB connection in CData Connect AI, you can skip this step and continue to the next section.

1.1 Add a Connection in CData Connect AI

  1. Log in to CData Connect AI, click Sources in the left panel, and then click Add Connection on top-right.
  2. Search and select Cosmos DB from the Add Connection panel.
  3. Enter the required authentication properties to connect to Cosmos DB.

    To obtain the connection string needed to connect to a Cosmos DB account using the SQL API, log in to the Azure Portal, select Azure Cosmos DB, and select your account. In the Settings section, click Connection String and set the following values:

    • AccountEndpoint: The Cosmos DB account URL from the Keys blade of the Cosmos DB account
    • AccountKey: In the Azure portal, navigate to the Cosmos DB service and select your Azure Cosmos DB account. From the resource menu, go to the Keys page. Find the PRIMARY KEY value and set AccountKey to this value.
  4. Click Save & Test to validate the connection.
  5. Navigate to the Permissions tab on the Add Cosmos DB Connection page and update user-based permissions as needed.

1.2 Create a Personal Access Token (PAT)

A Personal Access Token (PAT) is used to authenticate IBM watsonx Orchestrate when connecting to CData Connect AI. It is recommended to create a separate PAT for each integration to maintain fine-grained access control.

  1. Click the gear icon () in the upper-right corner of the Connect AI interface to open Settings.
  2. On the Settings page, open the Access Tokens section and click Create PAT.
  3. Provide a descriptive name and click Create.
  4. Note: The PAT is displayed only once at creation. Copy and store it securely for later use when configuring IBM watsonx Orchestrate.

With the connection configured and a PAT generated, you are now ready to connect to live Cosmos DB data from IBM watsonx Orchestrate and begin importing MCP tools through the Agent Development Kit (ADK).


Step 2: Build an AI Agent with Your Cosmos DB data

Once the connection to Cosmos DB is established in CData Connect AI, you can begin building an AI agent in IBM watsonx Orchestrate. This section walks you through adding the connection inside watsonx Orchestrate and configuring authentication for secure access.

2.1 Add a Connection for Cosmos DB in IBM watsonx Orchestrate

This step links your CData Connect AI Remote MCP server to IBM watsonx Orchestrate to manage the connection to Cosmos DB through the Agent Development Kit (ADK). Follow the steps below to configure and authenticate it.

  1. Log in to your IBM watsonx Orchestrate account.
  2. On the home screen, click the three-line Menu icon on the left panel, expand the Manage section, and select Connections.
  3. Click Add new connection.
  4. Under Define connection details, enter a unique Connection ID (for example, mcp-cdata) to identify it later.
  5. Enter the Display name as CData Connect AI MCP, then click Save and continue and confirm the dialog.
  6. Under Configure draft connection, select Authentication type as Key-Value Pair from the drop-down.
  7. Scroll down to Credential type and select the Team credentials radio button.
  8. Enter the following details:
    1. Key: Enter Authorization.
    2. Value: Enter your CData Connect AI registered email and Personal Access Token (PAT) from Step 1, separated by a colon (:), and prefixed with the word Basic. For example: Basic [email protected]:DVolmeSplUCJUdXVFdj.
  9. Click Connect to establish the connection successfully, then click Next.
  10. Under Configure live connection, click Paste draft configuration to copy the settings.
  11. Repeat the same credential configuration as in the draft connection (Team credentials with the same Key-Value Pair).
  12. Click Connect to validate, then click Finish and confirm the dialog to close the connection setup.

2.2 Install the ADK and Requirements

After adding a connection to Cosmos DB in CData Connect AI, install the IBM watsonx Orchestrate Agent Development Kit (ADK) to manage and test the connection.

  1. Install Python 3.x and pip if they are not already installed.
  2. Verify the installation by running the following commands in your terminal:
    python --version and pip --version
  3. Create a project directory and set up a Python virtual environment for the ADK with the following command:
    python -m venv venv
  4. Activate the virtual environment:
    On Windows: venv\Scripts\activate
    On macOS or Linux: source venv/bin/activate
  5. With your environment activated, install the ADK:
    pip install ibm-watsonx-orchestrate
  6. After installation, confirm that the ADK is working by running:
    orchestrate --help
  7. If everything is set up correctly, you will see a list of available ADK CLI commands, similar to the screenshot below.

2.3 Connect the ADK to IBM watsonx Orchestrate

Now that the ADK is installed, connect it to your IBM watsonx Orchestrate SaaS instance so you can manage environments and import MCP tools from CData Connect AI.

You need your watsonx Orchestrate API Key and Service Instance URL. Follow these steps:

  1. Log in back to your IBM watsonx Orchestrate instance.
  2. Click the profile icon in the top-right corner, open the menu, and select Settings.
  3. On the Settings page, open the API details tab and click Generate API key. A pop-up will appear with your new API Key. Copy and save it securely. You will not be able to view it again later.
  4. Copy your Service Instance URL.
  5. Return to your terminal and run the following command to connect the ADK to your IBM watsonx Orchestrate environment:
    orchestrate env add -n <environment-name> -u <service-instance-url> --type mcsp --activate

    Parameter Description Example
    <environment-name> A name for your ADK environment. CData-Env
    <service-instance-url> Your IBM watsonx Orchestrate Service Instance URL copied from your instance settings. https://api.dl.watson-orchestrate.ibm.com/instances/20250605-1433-1621-306a-df42bcdd849c

    Example command:
        orchestrate env add -n wxO-AWS -u
        https://api.dl.watson-orchestrate.ibm.com/instances/20250605-1433-1621-306a-df42bcdd849c --type mcsp --activate
        
  6. When prompted, paste your API Key into the terminal and press Enter to activate the environment. Once completed, a confirmation message will appear indicating that your environment has been created and activated.

2.4 Import the Connect AI MCP Server Toolkits into IBM watsonx Orchestrate

Now that your environment is connected and authenticated, you can import the CData Connect AI Remote MCP toolkits into IBM watsonx Orchestrate. This step registers the live Cosmos DB tools so that your agents can use them directly through the Agent Development Kit (ADK).

  1. Return to your terminal or command prompt with the virtual environment activated.
  2. Run the following command to import the CData Connect AI MCP toolkit:

        orchestrate toolkits import --kind mcp --name cdata-mcp --description "CData Connect AI MCP Toolkit" --url "https://mcp.cloud.cdata.com/mcp/" --transport "streamable_http" --tools "getCatalogs,getSchemas,getTables,getColumns,queryData,getProcedures,getProcedureParameters,executeProcedure" --app-id "mcp-cdata"
        
  3. Replace the parameters as needed:
    Parameter Description Example
    --name Specifies a name for the imported toolkit. cdata-mcp
    --description A short description of the toolkit. "CData Connect AI MCP Toolkit"
    --url The URL of the CData Connect AI MCP server. https://mcp.cloud.cdata.com/mcp/
    --transport The communication protocol used for the MCP connection. streamable_http
    --tools A comma-separated list of tools to import from the CData Connect AI MCP server.
    The following Connect AI MCP tools provide metadata and query access for live Cosmos DB data:
    • getCatalogs
    • getSchemas
    • getTables
    • getColumns
    • queryData
    • getProcedures
    • getProcedureParameters
    • executeProcedure
    "getCatalogs,getSchemas,getTables,getColumns,queryData,getProcedures,getProcedureParameters,executeProcedure"
    --app-id The connection name created earlier in Step 2.1 (for example, mcp-cdata). mcp-cdata
  4. The ADK connects to the CData Connect AI MCP server, validates the available tools, and imports them into your IBM watsonx Orchestrate instance. The process may take up to 30 seconds while the tool schemas are verified.
  5. Once the import is complete, confirm that the toolkit is available by running:
    orchestrate toolkits list

You have now successfully imported the CData Connect AI MCP toolkits into IBM watsonx Orchestrate. Your agents can now call live Cosmos DB data through CData Connect AI using the imported MCP tools.

2.5 Create an Agent in IBM watsonx Orchestrate

You are now ready to create an AI agent in IBM watsonx Orchestrate that uses the imported CData Connect AI MCP tools. This agent allows you to query and interact with live Cosmos DB data directly through the Connect AI integration.

Follow these steps:

  1. On the IBM watsonx Orchestrate Dashboard, click the three-line Menu icon on the left panel, expand the Build section, and select Agent Builder.
  2. On the Build agents and tools page, click the Create agent button in the top-right corner.
  3. Select Create from scratch, enter a desired Name (for example, CData Connect AI), add a short Description, and click Create.
  4. On the agent's main page, click Toolset in the left panel, then click the Add tool button.
  5. Select Add from file or MCP server, then choose Import from MCP server.
  6. In the top-left Select MCP server drop-down, choose the MCP toolkit you imported in the previous step (for example, cdata-mcp).
  7. Turn on all imported CData Connect AI MCP tools as shown, then click Close to save and exit the dialog.
  8. This completes the connection between Cosmos DB data and IBM watsonx Orchestrate by enabling the imported CData Connect AI tools.

Your agent is now ready to use the CData Connect AI MCP tools to query and process live Cosmos DB data directly within IBM watsonx Orchestrate. You can now start building workflows, testing SQL-based queries, and automating actions using real-time data through Connect AI.



Step 3: Test and Deploy the Built Agent

Your agent setup is now complete, and you can begin testing it directly in the IBM watsonx Orchestrate preview interface. This step ensures that your CData Connect AI MCP integration is working correctly and that your agent can query live Cosmos DB data in real time.

  1. In the agent's Preview chat interface, type List catalogs to view available data catalogs retrieved through the connected CData MCP server.
  2. Next, run a sample query by including your Cosmos DB catalog name for better context. For example: Briefly summarize the most recent sprint's performance in the Cosmos DB catalog.

You can further fine-tune your agent before deployment to improve accuracy, usability, and responsiveness. Here are a few ways to enhance your agent:

  • Add natural-language variations — test multiple phrasings of the same request to ensure your agent understands similar intents consistently.
  • Refine the agent's description and behavior — update the Description and Behavior fields in Agent Builder for clearer task context and responses.
  • Combine more MCP tools or connections — import other CData MCP toolkits or data sources to enable multi-source workflows.
  • Test filtering, summaries, and drill-downs — run varied queries in Preview to validate accuracy and performance.

Once you're ready, deploy the agent by clicking the Deploy button at the top to share it with your team and enable access for all users.


Build AI Agents in Minutes with CData Connect AI

With CData Connect AI, you can securely connect and query over 350+ enterprise data sources directly within your AI environments — no data replication or complex setup required. CData's governed SQL-based connectivity makes it easy for tools like IBM watsonx Orchestrate to access, analyze, and automate workflows with real-time data.

Start building your next AI-powered integration today with a free trial of CData Connect AI.

Or better yet, experience it yourself with the live demo — try it now here.

Ready to get started?

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

Free Trial