Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Conecta tu IDE a BigQuery con MCP Toolbox
En esta guía, se muestra cómo usar MCP Toolbox for Databases para conectar tu instancia de BigQuery a una variedad de entornos de desarrollo integrados (IDE) y herramientas para desarrolladores. Utiliza el Protocolo de contexto del modelo (MCP), un protocolo abierto para conectar modelos de lenguaje grandes (LLM) a fuentes de datos como BigQuery, lo que te permite ejecutar consultas de SQL y, también, interactuar con tu proyecto directamente desde tus herramientas existentes.
En esta guía, se muestra el proceso de conexión para los siguientes IDEs:
Configura los roles y permisos necesarios para completar esta tarea. Necesitarás el rol de Usuario de BigQuery (roles/bigquery.user), el rol de Visualizador de datos de BigQuery (roles/bigquery.dataViewer) o permisos de IAM equivalentes para conectarte a la instancia.
Descarga la versión más reciente de MCP Toolbox como un archivo binario. Selecciona el objeto binario correspondiente a tu sistema operativo (SO) y a la arquitectura de CPU. Debes usar la versión V0.7.0 o posterior de MCP Toolbox:
Nota: La variable de entorno BIGQUERY_PROJECT especifica el ID del proyecto Google Cloud predeterminado que debe usar la caja de herramientas de MCP. Todas las operaciones de BigQuery, como la ejecución de consultas, se realizan dentro de este proyecto.
Usa las herramientas
Tu herramienta de IA ahora está conectada a BigQuery a través de MCP. Intenta pedirle a tu asistente de IA que cree una lista de tablas, cree una tabla o defina y ejecute otras instrucciones de SQL.
Las siguientes herramientas están disponibles para el LLM:
ask_data_insights: Realiza análisis de datos, obtiene estadísticas o responde preguntas complejas sobre el contenido de las tablas de BigQuery.
execute_sql: Ejecuta la instrucción de SQL.
forecast: Prevé datos de series temporales.
get_dataset_info: Obtiene metadatos del conjunto de datos
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (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."]]