This guide shows you how to use the MCP Toolbox for Databases to connect your BigQuery instance to a variety of Integrated Development Environments (IDEs) and developer tools. It uses the Model Context Protocol (MCP), an open protocol for connecting large language models (LLMs) to data sources like BigQuery, allowing you to run SQL queries and interact with your project directly from your existing tools.
This guide demonstrates the connection process for the following IDEs:
Configure the required roles and permissions to complete this task. You will need the BigQuery User role (roles/bigquery.user), the BigQuery Data Viewer role (roles/bigquery.dataViewer), or equivalent IAM permissions to connect to the instance.
Download the latest version of the MCP Toolbox as a binary. Select the binary corresponding to your operating system (OS) and CPU architecture. You must use MCP Toolbox version V0.7.0 or later:
Note: The BIGQUERY_PROJECT environment variable specifies the default Trusted Cloud Project ID for the MCP Toolbox to use. All BigQuery operations, such as executing queries, are run within this project.
Use the tools
Your AI tool is now connected to BigQuery using MCP. Try asking your AI assistant to list tables, create a table, or define and execute other SQL statements.
The following tools are available to the LLM:
ask_data_insights: perform data analysis, get insights, or answer complex questions about the contents of BigQuery tables.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Connect your IDE to BigQuery using MCP Toolbox\n==============================================\n\nThis guide shows you how to use the [MCP Toolbox for Databases](https://github.com/googleapis/genai-toolbox) to connect your BigQuery instance to a variety of Integrated Development Environments (IDEs) and developer tools. It uses the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction), an open protocol for connecting large language models (LLMs) to data sources like BigQuery, allowing you to run SQL queries and interact with your project directly from your existing tools.\n\nThis guide demonstrates the connection process for the following IDEs:\n\n- [Cursor](#configure-your-mcp-client)\n- [Windsurf](#configure-your-mcp-client) (formerly Codeium)\n- [Visual Studio Code](#configure-your-mcp-client) (Copilot)\n- [Cline](#configure-your-mcp-client) (VS Code extension)\n- [Claude desktop](#configure-your-mcp-client)\n- [Claude code](#configure-your-mcp-client)\n\nBefore you begin\n----------------\n\n1. In the Google Cloud console, on the [project selector page](https://console.cloud.google.com/projectselector2/home/dashboard), select or create a Google Cloud project.\n\n2. [Make sure that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n3. [Enable the BigQuery API in the Google Cloud project](https://console.cloud.google.com/flows/enableapi?apiid=bigquery.googleapis.com&redirect=https://console.cloud.google.com).\n\n4. Configure the required roles and permissions to complete this task. You will need the [BigQuery User](/bigquery/docs/access-control) role (`roles/bigquery.user`), the BigQuery Data Viewer role (`roles/bigquery.dataViewer`), or equivalent IAM permissions to connect to the instance.\n\n5. Configure [Application Default Credentials (ADC)](/docs/authentication/set-up-adc-local-dev-environment) for your environment.\n\nInstall the MCP Toolbox\n-----------------------\n\n1. Download the latest version of the MCP Toolbox as a binary. Select the [binary](https://github.com/googleapis/genai-toolbox/releases) corresponding to your operating system (OS) and CPU architecture. You must use MCP Toolbox version V0.7.0 or later:\n\n ### linux/amd64\n\n ```\n curl -O https://storage.googleapis.com/genai-toolbox/VERSION/linux/amd64/toolbox\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e with the MCP Toolbox\n version---for example `v0.7.0`.\n\n ### macOS darwin/arm64\n\n ```\n curl -O https://storage.googleapis.com/genai-toolbox/VERSION/darwin/arm64/toolbox\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e with the MCP Toolbox\n version---for example `v0.7.0`.\n\n ### macOS darwin/amd64\n\n ```\n curl -O https://storage.googleapis.com/genai-toolbox/VERSION/darwin/amd64/toolbox\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e with the MCP Toolbox\n version---for example `v0.7.0`.\n\n ### windows/amd64\n\n ```\n curl -O https://storage.googleapis.com/genai-toolbox/VERSION/windows/amd64/toolbox\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e with the MCP Toolbox\n version---for example `v0.7.0`.\n2. Make the binary executable:\n\n chmod +x toolbox\n\n3. Verify the installation:\n\n ./toolbox --version\n\nConfigure the MCP client\n------------------------\n\n### Claude code\n\n\u003cbr /\u003e\n\n1. Install [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview). \n2. Create `.mcp.json` file in your project root, if it doesn't exist. \n3. Add the configuration, replace the environment variables with your values, and save: \n\n```\n{\n \"mcpServers\": {\n \"bigquery\": {\n \"command\": \"./PATH/TO/toolbox\",\n \"args\": [\"--prebuilt\",\"bigquery\",\"--stdio\"],\n \"env\": {\n \"BIGQUERY_PROJECT\": \"PROJECT_ID\"\n }\n }\n }\n}\n```\n\n### Claude desktop\n\n\u003cbr /\u003e\n\n1. Open [Claude Desktop](https://claude.ai/download) and navigate to **Settings** . \n2. In the **Developer** tab, click **Edit Config** to open the configuration file. \n3. Add the configuration, replace the environment variables with your values, and save: \n\n```\n{\n \"mcpServers\": {\n \"bigquery\": {\n \"command\": \"./PATH/TO/toolbox\",\n \"args\": [\"--prebuilt\",\"bigquery\",\"--stdio\"],\n \"env\": {\n \"BIGQUERY_PROJECT\": \"PROJECT_ID\"\n }\n }\n }\n}\n```\n\n4. Restart Claude Desktop. \n5. The new chat screen displays a hammer (MCP) icon with the new MCP server. \n\n\u003cbr /\u003e\n\n### Cline\n\n\u003cbr /\u003e\n\n1. Open [Cline](https://github.com/cline/cline) extension in VS Code and tap **MCP Servers** icon. \n2. Tap Configure MCP Servers to open the configuration file. \n3. Add the following configuration, replace the environment variables with your values, and save: \n\n```\n{\n \"mcpServers\": {\n \"bigquery\": {\n \"command\": \"./PATH/TO/toolbox\",\n \"args\": [\"--prebuilt\",\"bigquery\",\"--stdio\"],\n \"env\": {\n \"BIGQUERY_PROJECT\": \"PROJECT_ID\"\n }\n }\n }\n}\n```\n\nA green active status appears after the server connects successfully. \n\n### Cursor\n\n\u003cbr /\u003e\n\n1. Create the `.cursor` directory in your project root if it doesn't exist. \n2. Create the `.cursor/mcp.json` file if it doesn't exist and open it. \n3. Add the following configuration, replace the environment variables with your values, and save: \n\n```\n{\n \"mcpServers\": {\n \"bigquery\": {\n \"command\": \"./PATH/TO/toolbox\",\n \"args\": [\"--prebuilt\",\"bigquery\",\"--stdio\"],\n \"env\": {\n \"BIGQUERY_PROJECT\": \"PROJECT_ID\"\n }\n }\n }\n}\n```\n\n4. Open [Cursor](https://www.cursor.com/) and navigate to **Settings \\\u003e Cursor Settings \\\u003e MCP** . A green active status appears when the server connects. \n\n### Visual Studio Code (Copilot)\n\n\u003cbr /\u003e\n\n1. Open [VS Code](https://code.visualstudio.com/docs/copilot/overview) and create `.vscode` directory in your project root if it does not exist. \n2. Create the `.vscode/mcp.json` file if it doesn't exist, and open it. \n3. Add the following configuration, replace the environment variables with your values, and save: \n\n```\n{\n \"servers\": {\n \"bigquery\": {\n \"command\": \"./PATH/TO/toolbox\",\n \"args\": [\"--prebuilt\",\"bigquery\",\"--stdio\"],\n \"env\": {\n \"BIGQUERY_PROJECT\": \"PROJECT_ID\"\n }\n }\n }\n}\n```\n\n### Windsurf\n\n\u003cbr /\u003e\n\n1. Open [Windsurf](https://docs.codeium.com/windsurf) and navigate to Cascade assistant. \n2. Click the MCP icon, then click **Configure** to open the configuration file. \n3. Add the following configuration, replace the environment variables with your values, and save: \n\n```\n{\n \"mcpServers\": {\n \"bigquery\": {\n \"command\": \"./PATH/TO/toolbox\",\n \"args\": [\"--prebuilt\",\"bigquery\",\"--stdio\"],\n \"env\": {\n \"BIGQUERY_PROJECT\": \"PROJECT_ID\"\n }\n }\n }\n}\n```\n\nUse the tools\n-------------\n\nYour AI tool is now connected to BigQuery using MCP. Try asking your AI assistant to list tables, create a table, or define and execute other SQL statements.\n\nThe following tools are available to the LLM:\n\n- **execute_sql**: execute SQL statement\n- **get_dataset_info**: get dataset metadata\n- **get_table_info**: get table metadata\n- **list_dataset_ids**: list datasets\n- **list_table_ids**: list tables\n\n| **Note:** Prebuilt tools are pre-1.0, so expect some tool changes between versions. LLMs will adapt to the tools available, so this shouldn't affect most users."]]