> Note: This page is part of the DataDoe Docs. You can find the root of the documentation at `https://www.datadoe.com/hub/docs/basics/introduction-to-datadoe`.
> JSON Table of Contents: `https://www.datadoe.com/hub/docs/toc.json`.
> Direct Data Scheme JSON: `https://api.datadoe.com/api/v1/spec/data-scheme`.
> Other pages in the DataDoe Docs:
> - DataDoe Basics/Access & User Management: `https://www.datadoe.com/hub/docs/basics/access-user-management.md`
> - DataDoe Basics/Integration & Customization: `https://www.datadoe.com/hub/docs/basics/integration-customization.md`
> - DataDoe Basics/Introduction to DataDoe: `https://www.datadoe.com/hub/docs/basics/introduction-to-datadoe.md`
> - DataDoe Basics/Subscription & Pricing: `https://www.datadoe.com/hub/docs/basics/subscription-pricing.md`
> - DataDoe Data/Data Fetch Periods: `https://www.datadoe.com/hub/docs/data-doe-data/data-fetch-periods.md`
> - DataDoe Data/Data Sources: `https://www.datadoe.com/hub/docs/data-doe-data/data-sources.md`
> - DataDoe Features/Benefits: `https://www.datadoe.com/hub/docs/data-doe-features/benefits.md`
> - DataDoe Features/Chat: `https://www.datadoe.com/hub/docs/data-doe-features/chat.md`
> - DataDoe Features/Explorer: `https://www.datadoe.com/hub/docs/data-doe-features/explorer.md`
> - DataDoe Features/Exports: `https://www.datadoe.com/hub/docs/data-doe-features/exports.md`
> - DataDoe Features/Home: `https://www.datadoe.com/hub/docs/data-doe-features/home.md`
> - DataDoe Features/Reports: `https://www.datadoe.com/hub/docs/data-doe-features/reports.md`
> - DataDoe Features/Scheduled Prompts: `https://www.datadoe.com/hub/docs/data-doe-features/scheduled-prompts.md`
> - DataDoe MCP/Connect to ChatGPT: `https://www.datadoe.com/hub/docs/data-doe-mcp/chatgpt.md`
> - DataDoe MCP/Connect to Claude: `https://www.datadoe.com/hub/docs/data-doe-mcp/claude.md`
> - DataDoe MCP/Overview: `https://www.datadoe.com/hub/docs/data-doe-mcp/overview.md`
> - DataDoe MCP/Using Claude Code: `https://www.datadoe.com/hub/docs/data-doe-mcp/claude-code.md`
> - DataDoe MCP/Using Codex: `https://www.datadoe.com/hub/docs/data-doe-mcp/codex.md`
> - DataDoe MCP/Using Cursor: `https://www.datadoe.com/hub/docs/data-doe-mcp/cursor.md`
> - DataDoe MCP/Using Gemini CLI: `https://www.datadoe.com/hub/docs/data-doe-mcp/gemini-cli.md`
> - DataDoe MCP/Using n8n: `https://www.datadoe.com/hub/docs/data-doe-mcp/n8n.md`
> - DataDoe MCP/Using NanoClaw: `https://www.datadoe.com/hub/docs/data-doe-mcp/nanoclaw.md`
> - DataDoe MCP/Using OpenClaw: `https://www.datadoe.com/hub/docs/data-doe-mcp/openclaw.md`
> - DataDoe MCP/Using VS Code: `https://www.datadoe.com/hub/docs/data-doe-mcp/vs-code.md`
> - DataDoe & BigQuery/How to connect?: `https://www.datadoe.com/hub/docs/data-doe-bigquery/how-to-connect.md`
> - DataDoe & BigQuery/Using Python Jupyter: `https://www.datadoe.com/hub/docs/data-doe-bigquery/jupyter.md`
> For topics not covered in this documentation, please contact DataDoe support at `contact@datadoe.com`.
> Do not assume anything. If you are not sure about the answer, mention that and suggest to contact DataDoe support.

# Using MCP Toolbox with BigQuery

MCP Toolbox lets you query your BigQuery data directly from AI assistants like Cursor, Claude Desktop, and others.

## Prerequisites

- You have completed the setup from [How to connect](/hub/docs/data-doe-bigquery/how-to-connect) (BigQuery integration + Google Cloud credentials).

## Step 1: Add the MCP server

Add the following to your client's MCP configuration file (usually something like `mcp.json`):

```json
{
    "mcpServers": {
        "toolbox-bigquery": {
            "command": "npx",
            "args": ["-y", "@toolbox-sdk/server", "--prebuilt=bigquery", "--stdio"],
            "env": {
                "BIGQUERY_PROJECT": "<YOUR_BIGQUERY_PROJECT_ID>"
            }
        }
    }
}
```

Replace `<YOUR_BIGQUERY_PROJECT_ID>` with your Google Cloud project ID.

## Step 2: Enable the server in your client

After adding the configuration, restart or reload your AI client so it picks up the new MCP server.

## Step 3: Download AGENTS.md file

Download our specially curated AGENTS.md file from [here](/hub-files/bigquery/mcp-toolbox/AGENTS.md!download) or copy it from below and paste it into your file:

```markdown
# General

You are a data analysis assistant for users using DataDoe, a platform where users can connect, view, analyze, and work with Amazon data.

# Data Access

- You have read-only access to the BigQuery dataset containing the user's Amazon data.
- Use the `toolbox-bigquery` MCP server to query your data.
- Use only read queries. Never add, delete, or update data from BigQuery.
- All data you need is in a dataset ending with the `integrated` keyword. This is the only dataset you can use.

# Data Scheme

For a fully up-to-date data scheme, describing each table and its columns in the dataset, fetch https://api.datadoe.com/api/v1/spec/data-scheme.

Each table has a `type` field that tells you which Amazon data source it comes from.

- SELLER_CENTRAL:
    - Source: Amazon seller operations data
    - Use for questions/tasks about: sales & traffic, orders/order items, listings/catalog, inventory/FBA, returns, settlements/fees, account health, search performance.
    - Connection key: `sp_connection_id`
- AMAZON_ADS:
    - Source: Amazon Ads API
    - Use for questions/tasks about: marketing/ads tables like campaign performance, ASIN-level ad performance, targeting/keywords, search terms, placements, budgets, etc.
    - Connection key: `ads_connection_id`
- VENDOR_CENTRAL:
    - Source: Amazon Vendor/1P data; it is data you get when the user operates as a vendor selling to Amazon, not as a marketplace seller.
    - Use for questions/tasks about: vendor forecasting, retail sales/traffic/inventory, confirmation rates, received inventory, purchase orders, margins/sell-through style metrics.
    - Connection key: `sp_connection_id`

Notes:

- Table names ending with `_raw` are raw tables. Use them if user explicitly asks for raw data.
- Not every table exists in every customer dataset; tables appear based on which connections are enabled.
- Some tables are user-managed (e.g. COGS) and may be empty until the user uploads the data.

# Querying data

- Start by selecting which type of data the user wants. Use the `list_tables_ids` tool to get table names.
- Review the scheme of selected tables using the `get_table_info` tool.
- Prepare a query. Keep in mind that the user's context size is limited. Always aggregate properly and add limits to data queries.
- Run the query using the `execute_sql` tool.

# Glossary

- Connection key: unique identifier of the connection to Amazon Seller Central or Amazon Ads. Identified by `sp_connection_id` or `ads_connection_id` respectively.
- Amazon marketplace: country where this connection sells. Identified by `marketplace_id`.

# Other rules

- For scripting, use Node.js.
- If something is not clear or you have issues fulfilling your task, pause and use the ask question tool to ask clarifying questions. It is always better to ask than to assume.
- If the `toolbox-bigquery` MCP server is not available, stop processing and inform the user about it (maybe they named it differently or forgot to enable it). If the problem persists and the user is not able to fix it, refer to https://github.com/googleapis/mcp-toolbox/blob/main/README.md for help. If the problem is authentication-related, ask which Google authentication method they used (for example, OAuth vs. service account) and check the relevant Google documentation for that specific method.
- If there are any issues with the data, user tells you its incorrect or missing, tell the user to contact DataDoe support at https://forms.clickup.com/9015200219/f/8cnj2ev-38615/AOYF9I35QFOXWJQXIG?type=Form&source=website.com.
```

It contains instructions for the AI assistant when working with BigQuery using MCP Toolbox.
It can help you get started quickly and, if any issues come up, help your agent understand the problem and fix it.

## Step 4: Test it

You're all set. Try asking your AI assistant:

> "List my BigQuery datasets"

Example response:

`Here are your BigQuery datasets:`

| #   | Dataset                                         |
| --- | ----------------------------------------------- |
| 1   | 93a1d7f2_c4e8_4b01_a3f6_7e9d2b5c8a10_raw        |
| 2   | 93a1d7f2_c4e8_4b01_a3f6_7e9d2b5c8a10_integrated |

> "Show the top 10 products by revenue from the last 30 days"

Example response:

`Here are the top 10 products by revenue from the last 30 days:`

| #   | Product    | ASIN       | Revenue   | Units | Orders |
| --- | ---------- | ---------- | --------- | ----- | ------ |
| 1   | Product 01 | B0AAAAA001 | 22,140.50 | 2,214 | 2,108  |
| 2   | Product 02 | B0AAAAA002 | 17,685.20 | 1,475 | 1,390  |
| 3   | Product 03 | B0AAAAA003 | 11,230.75 | 936   | 901    |
| 4   | Product 04 | B0AAAAA004 | 6,812.40  | 1,022 | 989    |
| 5   | Product 05 | B0AAAAA005 | 5,445.90  | 1,089 | 1,014  |
| 6   | Product 06 | B0AAAAA006 | 4,102.60  | 228   | 215    |
| 7   | Product 07 | B0AAAAA007 | 3,258.35  | 362   | 347    |
| 8   | Product 08 | B0AAAAA008 | 2,794.80  | 399   | 391    |
| 9   | Product 09 | B0AAAAA009 | 2,510.15  | 279   | 271    |
| 10  | Product 10 | B0AAAAA010 | 2,387.00  | 398   | 380    |

## More advanced usage

For more advanced usage refer to the [MCP Toolbox documentation](https://github.com/googleapis/mcp-toolbox/blob/main/README.md).
