How to Connect Flowise AI Agents to Live Amazon Athena Data via CData Connect AI

Integrate Flowise AI with the CData Connect AI MCP Server to enable agents to securely query and act on live data without replication.

Flowise AI is an open-source, no-code tool for building AI workflows and custom agents visually. Its drag-and-drop interface allows you to integrate large language models (LLMs) with APIs, databases, and external systems effortlessly.

CData Connect AI enables real-time connectivity to over 350+ enterprise data sources. Through its Model Context Protocol (MCP) server, CData Connect AI bridges Flowise agents with live Amazon Athena securely and efficiently, no data replication required. By combining Flowise AI's intuitive agent builder with CData's MCP integration, users can create agents capable of fetching, analyzing, and acting upon live Amazon Athena data directly within Flowise AI workflows.

This guide shows you how to connect Flowise AI to CData Connect AI MCP, set up credentials, and enable your agents to query live Amazon Athena data in real time.

About Amazon Athena Data Integration

CData provides the easiest way to access and integrate live data from Amazon Athena. Customers use CData connectivity to:

  • Authenticate securely using a variety of methods, including IAM credentials, access keys, and Instance Profiles, catering to diverse security needs and simplifying the authentication process.
  • Streamline their setup and quickly resolve issue with detailed error messaging.
  • Enhance performance and minimize strain on client resources with server-side query execution.

Users frequently integrate Athena with analytics tools like Tableau, Power BI, and Excel for in-depth analytics from their preferred tools.

To learn more about unique Amazon Athena use cases with CData, check out our blog post: https://www.cdata.com/blog/amazon-athena-use-cases.


Getting Started


Step 1: Configure Amazon Athena Connectivity for Flowise

Connectivity to Amazon Athena from Flowise AI is made possible through CData Connect AI's Remote MCP Server. To interact with Amazon Athena data from Flowise AI, we start by creating and configuring a Amazon Athena connection in CData Connect AI.

  1. Log into Connect AI, click Sources, and then click Add Connection
  2. Select Amazon Athena from the Add Connection panel
  3. Enter the necessary authentication properties to connect to Amazon Athena.

    Authenticating to Amazon Athena

    To authorize Amazon Athena requests, provide the credentials for an administrator account or for an IAM user with custom permissions: Set AccessKey to the access key Id. Set SecretKey to the secret access key.

    Note: Though you can connect as the AWS account administrator, it is recommended to use IAM user credentials to access AWS services.

    Obtaining the Access Key

    To obtain the credentials for an IAM user, follow the steps below:

    1. Sign into the IAM console.
    2. In the navigation pane, select Users.
    3. To create or manage the access keys for a user, select the user and then select the Security Credentials tab.

    To obtain the credentials for your AWS root account, follow the steps below:

    1. Sign into the AWS Management console with the credentials for your root account.
    2. Select your account name or number and select My Security Credentials in the menu that is displayed.
    3. Click Continue to Security Credentials and expand the Access Keys section to manage or create root account access keys.

    Authenticating from an EC2 Instance

    If you are using the CData Data Provider for Amazon Athena 2018 from an EC2 Instance and have an IAM Role assigned to the instance, you can use the IAM Role to authenticate. To do so, set UseEC2Roles to true and leave AccessKey and SecretKey empty. The CData Data Provider for Amazon Athena 2018 will automatically obtain your IAM Role credentials and authenticate with them.

    Authenticating as an AWS Role

    In many situations it may be preferable to use an IAM role for authentication instead of the direct security credentials of an AWS root user. An AWS role may be used instead by specifying the RoleARN. This will cause the CData Data Provider for Amazon Athena 2018 to attempt to retrieve credentials for the specified role. If you are connecting to AWS (instead of already being connected such as on an EC2 instance), you must additionally specify the AccessKey and SecretKey of an IAM user to assume the role for. Roles may not be used when specifying the AccessKey and SecretKey of an AWS root user.

    Authenticating with MFA

    For users and roles that require Multi-factor Authentication, specify the MFASerialNumber and MFAToken connection properties. This will cause the CData Data Provider for Amazon Athena 2018 to submit the MFA credentials in a request to retrieve temporary authentication credentials. Note that the duration of the temporary credentials may be controlled via the TemporaryTokenDuration (default 3600 seconds).

    Connecting to Amazon Athena

    In addition to the AccessKey and SecretKey properties, specify Database, S3StagingDirectory and Region. Set Region to the region where your Amazon Athena data is hosted. Set S3StagingDirectory to a folder in S3 where you would like to store the results of queries.

    If Database is not set in the connection, the data provider connects to the default database set in Amazon Athena.

  4. Click Save & Test
  5. Navigate to the Permissions tab and update user-based permissions

Once the connection is established, Amazon Athena data is now accessible in CData Connect AI and ready to be used with MCP enabled tools.

Add a Personal Access Token

A Personal Access Token (PAT) is used to authenticate the connection to Connect AI from Flowise AI. It is best practice to create a separate PAT for each integration to maintain granular access control.

  1. Click the gear icon () at the top right of the Connect AI app to open Settings
  2. On the Settings page, go to the Access Tokens section and click Create PAT
  3. Give the PAT a descriptive name and click Create
  4. Copy the token when displayed and store it securely. It will not be shown again

With the Amazon Athena connection configured and a PAT generated, Flowise AI can now connect to Amazon Athena data through the CData MCP Server.

Step 2: Configure Connect AI credentials in Flowise AI

Log in to Flowise AI workspace to set up the integration.

Add OpenAI credentials

  1. Navigate to Credentials and choose Add Credential
  2. Select OpenAI API from the dropdown
  3. Provide a name (e.g., OpenAI_Key) and paste the API key

Add the PAT variable

  1. Navigate to Variables and Add Variable
  2. Set Variable Name (e.g., PAT), choose Static as type, and set the Value to Base64-encoded username:PAT
  3. Click Add to save the variable

Step 3: Build the agent in Flowise AI

  1. Go to Agent Flows, select Add New
  2. Click the "+" icon to add a new node and choose Agent and drag the agent to the workflow
  3. Connect the Start node to the Agent node

Configure agent settings

Double-click on the Agent node and fill in the details:

  • Model: select ChatOpenAI or preferred model (e.g., gpt-4o-mini)
  • Connect Credential: Select OpenAI API key credential which was created earlier
  • Streaming: Enabled

Add the custom MCP tool

  1. Under Tools, click Add Tool and choose Custom MCP
  2. Fill in the JSON parameters as shown below:
 
{
  "url": "https://mcp.cloud.cdata.com/mcp",
  "headers": {
    "Authorization": "Basic {{$vars.PAT}}"
  }
}

Click the refresh icon to load available MCP actions. Once actions are listed, now Flowise agent is successfully connected to CData Connect AI MCP.

Step 4: Test and query live Amazon Athena data in Flowise

  1. Open the Chat tab in Flowise
  2. Type a query such as "Show top 10 records from Amazon Athena data table"
  3. Observe that responses are fetched in real time via the CData Connect AI MCP connection

With the workflow run completed, Flowise demonstrates successful retrieval of Salesforce data through the CData Connect AI MCP server, with the MCP Client node providing the ability to ask questions, retrieve records, and perform actions on the data.


Get CData Connect AI

To access 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