IBM Developer

Tutorial

Integrate BigQuery MCP server with IBM watsonx Orchestrate AI agents

Learn how to securely connect enterprise analytics data to AI agents by using OAuth, MCP, and agentic workflows

By Debojyoti S Roy

Enterprise data is one of the most valuable sources of business insights, but accessing that data from AI agents often requires custom integrations, APIs, and security controls. The Google BigQuery MCP Server simplifies this process by providing a standardized and secure way for AI agents to access BigQuery data through the Model Context Protocol (MCP).

In this tutorial, you learn how to integrate the Google BigQuery MCP Server with IBM watsonx Orchestrate. You create a secure OAuth connection, configure the BigQuery MCP Server, and add BigQuery tools to a watsonx Orchestrate agent.

By the end of the tutorial, your agent can discover BigQuery datasets, retrieve table metadata, and access BigQuery data through natural language requests. This integration enables AI-powered analytics, workflow automation, reporting, and business decision support by using enterprise data stored in BigQuery.

Architecture of BigQuery MCP server integration with watsonx Orchestrate

The BigQuery MCP Server provides secure access to BigQuery data for AI agents and large language models (LLMs). The server applies Google Cloud security and governance controls while enabling business users to query enterprise data in natural language. The server returns structured data that AI agents and workflows can use for analysis, reporting, and business decisions.

Through the Google BigQuery MCP Server, AI agents can access:

  • Google Cloud project IDs that the service account can access.
  • Project metadata, including project name, location, and resource quotas (based on IAM permissions).
  • BigQuery dataset IDs and dataset locations.
  • BigQuery dataset metadata.
  • BigQuery table metadata.
  • Table names and table types, such as TABLE and VIEW.
  • SQL query results, including filtered data and joined data from multiple tables.

Architecture diagram for integrating the BigQuery MCP Server with IBM watsonx Orchestrate

In this tutorial, you first create and configure a Google Cloud project, assign the required IAM roles, and enable the BigQuery and MCP-related APIs by using the gcloud CLI. You can also create BigQuery datasets and tables or load sample data for testing.

Next, create OAuth 2.0 credentials in Google Cloud and configure an OAuth connection in IBM watsonx Orchestrate. Then, use this connection to connect watsonx Orchestrate to the Google BigQuery MCP Server.

Finally, create an AI agent in watsonx Orchestrate, add the BigQuery MCP tools to the agent, and validate the integration by running sample prompts. The sample prompts list BigQuery datasets, view BigQuery tables, and retrieve table schemas. These validation steps confirm that the agent can successfully access and use BigQuery data through the MCP Server.

Prerequisites

  • A trial instance of watsonx Orchestrate SaaS:
  • A Builder or Admin role in watsonx Orchestrate. The role must support:
    • Remote MCP Server integrations
    • OAuth 2.0 Authorization Code connections
  • A Google Cloud account. The Google Cloud free tier is sufficient for testing and learning purposes.

Note: Verify that your watsonx Orchestrate environment supports Remote MCP Server integrations and OAuth 2.0 Authorization Code authentication.

Step 1. Configure the Google Cloud environment for BigQuery

In this step, create and configure a Google Cloud project for BigQuery access. Then, create a project, assign the required IAM roles, enable the required APIs, install the Google Cloud SDK (gcloud CLI), and enable the BigQuery MCP service for MCP-based access to BigQuery resources.

  1. Set up the Google Cloud project.

    a. Sign in to the Google Cloud Console.

    b. Create a new Google Cloud project or use an existing project.

    c. When creating a new project, provide the following information:

    • Project name
    • Organization name (optional). Leave this field blank if you do not want to associate the project with an organization or folder.

      Google Cloud form for creating a new project

  2. Configure required IAM roles.

    a. Select your Google Cloud project and open the project home page.

    Note: Copy and save the Project ID. You will need it in later steps.

    Google Cloud project details page with the project ID highlighted

    b. In the Google Cloud Console, select View All Products > IAM and admin.

    c. From the left navigation menu, select Roles.

    Google Cloud IAM roles page showing available roles

    d. Verify that the following IAM roles are available and assigned as needed for your project:

    • roles/bigquery.user: Run BigQuery queries
    • roles/bigquery.dataViewer: Access BigQuery datasets and tables
    • roles/mcp.toolUser: Access MCP tools
    • roles/serviceusage.serviceUsageAdmin: Enable Google Cloud APIs
    • roles/iam.oauthClientViewer: View OAuth client configurations
    • roles/iam.serviceAccountViewer: View service account configurations
    • roles/oauthconfig.editor: Create and manage OAuth configurations
  3. Enable the BigQuery MCP service by using the gcloud CLI.

    a. Open a macOS Terminal or Linux Terminal.

    b. Download and install the Google Cloud SDK.

       https://docs.cloud.google.com/sdk/docs/install-sdk
    

    c. Extract the downloaded SDK archive.

    d. From the root directory of the extracted folder, run the installation script.

       ./google-cloud-sdk/install.sh
    

    e. During installation, accept the recommended setup options.

    • Install Python 3 if required.
    • Add the gcloud CLI to your system PATH.
    • Enable command completion for the gcloud CLI.
    • Optionally, allow anonymous usage statistics collection.

      f. Initialize the gcloud CLI.

      gcloud init
      

      Sign in with your Google account when prompted. The command opens a browser window for authentication.

      g. Install the Google Cloud CLI beta components.

      gcloud components install beta
      

      h. Set the active Google Cloud project.

      gcloud config set project <PROJECT_ID>
      

      i. Enable the BigQuery MCP service for the project.

      gcloud beta services mcp enable bigquery.googleapis.com --project=<PROJECT_ID>
      

Step 2. Load a sample dataset into BigQuery (Optional)

In this step, you can create BigQuery datasets and tables for testing and demonstration purposes. You can use either the Google Cloud Console or the BigQuery CLI. The Google Cloud Console provides a visual interface for creating datasets and tables. The BigQuery CLI is useful for automation and repeatable environment setup.

  1. Create a dataset and table by using the Google Cloud Console

    a. Open the Google Cloud Console and select your project.

    b. Navigate to BigQuery:

    • Select BigQuery from the home page, or
    • Select View All Products > BigQuery.

      c. In BigQuery Studio, select Create Table.

      BigQuery Studio interface with the Create Table option selected

      d. If you do not have a dataset, create a new dataset. Otherwise, select an existing dataset.

      e. Provide the required table details and create the table.

      f. Load sample data into the table by:

    • Uploading a file, or

    • Inserting data through SQL statements.

      Note: Some data loading operations may require an active Google Cloud billing account.

      After you create the dataset and table, you can use the data to test BigQuery queries and BigQuery MCP tools in IBM watsonx Orchestrate.

  2. Create a dataset and table by using the BigQuery CLI.

    a. Create a new dataset.

       bq mk --dataset <PROJECT_ID>:<DATASET_ID>
    

    b. Create a new table.

       bq mk --table <PROJECT_ID>:<DATASET_ID>.<TABLE_NAME> <SCHEMA>
    

    Example:

       bq mk --table mydataset.mytable qtr:STRING,sales:FLOAT,year:STRING
    

    You can also add table properties such as description, labels, and expiration settings when creating the table.

When to use the Google Cloud Console

Use the Google Cloud Console when you need a quick and visual setup for learning, testing, demonstrations, or small datasets. The BigQuery interface makes it easy to create datasets, create tables, define schemas, and inspect data without using command-line tools.

When to use the BigQuery CLI

Use the BigQuery CLI when you need automation and repeatable configuration. Command-line tools are useful for scripts, CI/CD pipelines, environment provisioning, and consistent dataset and table creation across development, test, and production environments.

After you create the dataset and table, you can use the data to test BigQuery MCP tools and BigQuery queries from IBM watsonx Orchestrate.

Step 3. Configure OAuth 2.0 credentials in Google Cloud

In this step, create OAuth 2.0 credentials in your Google Cloud project. These credentials enable secure authentication between IBM watsonx Orchestrate and the Google BigQuery MCP Server. Then, configure the OAuth consent screen, create a web application client, and collect the client credentials that are required for the connection.

  1. In the Google Cloud Console, navigate to APIs and Services > OAuth Consent Screen.

  2. Configure the application information:

    • App name
    • Support email
    • Audience: External
    • Contact email
  3. Accept the data usage policy and create the OAuth consent configuration.

  4. After the configuration is created, open the Branding page and add your authorized domain (for example, ibm.com).

  5. Navigate to the Clients page.

  6. Create a new Web Application OAuth client.

    Google Cloud page for creating a web application OAuth client

  7. After the client is created, open the client details and copy the following values:

    • Client ID
    • Client Secret

    Save these values. You will use them when creating the OAuth connection in IBM watsonx Orchestrate.

    Google Cloud OAuth client details page showing the client ID and secret

  8. Open the Audience page.

  9. Add your Google Cloud user account email address to the Test users list.

    Google Cloud OAuth audience page for adding test users

Step 4. Create an OAuth 2.0 connection in IBM watsonx Orchestrate

In this step, create an OAuth 2.0 Authorization Code connection in IBM watsonx Orchestrate by using the OAuth credentials that you created in Google Cloud. After you configure the connection, you can connect to the Google BigQuery MCP Server and use BigQuery tools in an AI agent.

  1. Create an OAuth 2.0 Authorization Code connection.

    a. In IBM watsonx Orchestrate, create a new OAuth 2.0 Authorization Code connection. For detailed instructions, see the IBM documentation for creating and managing connections.

    b. Configure the connection with the following values:

    • Token URL: https://oauth2.googleapis.com/token
    • Authorization URL: https://accounts.google.com/o/oauth2/auth
    • Scope: https://www.googleapis.com/auth/bigquery
    • Client ID: Your Google Cloud Client ID
    • Client Secret: Your Google Cloud Client Secret

      IBM watsonx Orchestrate OAuth connection form for Google BigQuery

      c. When you attempt to connect, you may receive an Invalid Redirect URI error.

      • Click Error Details.

        watsonx Orchestrate error details showing the redirect URI

      • Copy the Redirect URI displayed in the error message.

      • Return to the Google Cloud Console and open the OAuth client that you created earlier.

      • Add the copied Redirect URI to the list of Authorized Redirect URIs.

      • Save the OAuth client configuration.

        Google Cloud OAuth client settings page for adding an authorized redirect URI

      • Return to IBM watsonx Orchestrate and reconnect by using the OAuth connection.

      • Complete the authentication process and verify that the connection is successful.

  2. Create an AI Agent and add BigQuery MCP tools.

    a. Create an AI agent in IBM watsonx Orchestrate.

    b. Add a new MCP server to the agent by using the following settings:

    • MCP Server URL: https://bigquery.googleapis.com/mcp
    • Transport Type: Streamable HTTP

      c. Select the OAuth connection that you created in the previous step.

      d. Verify that the connection is successful.

      watsonx Orchestrate agent setup with a connected BigQuery MCP server

      e. After the connection is established, watsonx Orchestrate retrieves the list of available BigQuery MCP tools.

      watsonx Orchestrate showing the list of available BigQuery MCP tools

      f. Select the required BigQuery tools and add them to the agent.

      g. Save and deploy the agent.

      watsonx Orchestrate page for saving and deploying the AI agent

  3. Run sample prompts to verify that the agent can access BigQuery through the MCP Server.

    • List all datasets

        Get all datasets
      

      Agent response that lists available BigQuery datasets

    • List all tables in a dataset

        Get tables in dataset <DATASET_NAME>
      

      Agent response that lists tables in a BigQuery dataset

    • Retrieve a table schema

        Get schema for table <TABLE_NAME>
      

      Agent response that returns the schema for a BigQuery table

Summary

By completing this integration, you have connected IBM watsonx Orchestrate to the Google BigQuery MCP Server and enabled secure access to BigQuery data. This integration allows AI agents to discover datasets, retrieve table information, and access analytics data directly from BigQuery through a standardized MCP interface.

With this foundation, you can use BigQuery data in AI agents, business workflows, reporting processes, and decision-support applications. The integration also supports secure authentication, centralized data access, workflow automation, and governance controls while continuing to use your existing BigQuery environment.

Next steps

After you complete the BigQuery MCP Server integration, you can extend your solution by integrating additional Google Cloud MCP servers and data sources.

  • Integrate additional data sources through MCP servers: MCP servers provide a secure and standardized interface for connecting AI agents to enterprise data sources.
  • Integrate cloud database systems: Connect BigQuery to Cloud SQL, PostgreSQL, MySQL, SQL Server, AlloyDB, Cloud Spanner, and Cloud Bigtable for data access and data movement.
  • Integrate cloud storage systems: Connect BigQuery to Google Drive, Google Cloud Storage, Amazon S3, and Azure Blob Storage to access and analyze external data.
  • Implement security and governance controls: Use Google Cloud IAM and policy controls to manage access, auditing, and compliance across MCP integrations.
  • Integrate additional Google Cloud services: Connect IBM watsonx Orchestrate to other Google and Google Cloud services through Google-managed MCP servers. Refer to the list of supported Google Cloud MCP servers.

Acknowledgments

This tutorial was produced as part of the IBM Open Innovation Community initiative: Agentic AI (AI for Developers and Ecosystem).

The author deeply appreciates the support of Ela Dixit and Bindu Umesh for the guidance on reviewing and contributing to this tutorial.