gemini-cli-with-mcp-toolbox-for-databases
This repository demonstrates how to query and analyze Google BigQuery data using natural language. It provides a step-by-step example of integrating the Gemini CLI with the MCP Toolbox for Databases.
GitHubスター
1
ユーザー評価
未評価
お気に入り
0
閲覧数
4
フォーク
0
イシュー
0
Natural Language BigQuery Data Analysis with Gemini CLI and MCP Toolbox for Databases
This document guides you on how to connect Gemini CLI with MCP Toolbox for Databases
to easily query and analyze data in Google Cloud BigQuery using natural language. Through this example, you can explore the powerful capabilities of handling various Google Cloud databases with natural language.
Prerequisites
- Google Cloud account and project
gcloud
CLI installed and configured
1. Install MCP Toolbox for Databases
MCP Toolbox for Databases
is a suite of tools that allows interaction with Google Cloud databases. Refer to the link below to download and install the correct binary for your operating system (OS) and CPU architecture.
- Installation Guide: Install MCP Toolbox for Databases
[NOTE] It is crucial to select the correct binary for your OS and CPU architecture.
For more detailed instructions on getting started with a local BigQuery integration, you can refer to the quickstart document below.
- Reference: Quickstart (Local with BigQuery)
2. Register the MCP Server in Gemini CLI
To allow Gemini CLI to recognize and use the MCP Toolbox, you need to register the server information in the configuration file. Add the following mcpServers
configuration to your Gemini CLI settings file.
{
"mcpServers": {
"bigquery": {
"command": "toolbox",
"args": ["--prebuilt", "bigquery", "--stdio"],
"env": {
"BIGQUERY_PROJECT": "[YOUR_PROJECT_ID]",
"BIGQUERY_LOCATION": "[YOUR_REGION]"
}
}
}
}
[YOUR_PROJECT_ID]
: Replace with your Google Cloud project ID.[YOUR_REGION]
: Replace with the region where your BigQuery dataset is located (e.g.,us-central1
).
3. Google Cloud Authentication and Configuration
The MCP Toolbox requires Google Cloud authentication to access BigQuery.
Authenticate with Google Cloud (Application Default Credentials):
Set your default Google Cloud project (replace
PROJECT_ID
with your actual project ID):Set your default Google Cloud region (replace
us-central1
with your actual region):List the configured MCP servers and tools:
4. Usage Examples
Now you can explore your BigQuery data using natural language prompts.
List datasets in the project: "List the available datasets in the project."
Get metadata for the dataset: "Get the metadata for
products
dataset."
List tables in the dataset: "List tables in
products
dataset."
Get metadata for the table: "Get the metadata for
products
table."
Execute SQL: "Execute a sql (e.g.,
Retrieve 10 rows from products table
)"