Skip to main content

A Model Context Protocol (MCP) server that provides access to BigQuery.

Project description

Snow Leopard BigQuery MCP

Test Coverage PyPI - Version Discord


Snow Leopard BigQuery MCP Logo


A Model Context Protocol (MCP) server for Google BigQuery that enables AI agents to interact with BigQuery databases through natural language queries and schema exploration.

This project was developed by Snow Leopard AI as a benchmarking tool for our platform, and we're making it publicly available for the community to use and build upon.

What is MCP?

The Model Context Protocol (MCP) is an open standard that allows AI applications to securely connect to external data sources and tools. This BigQuery MCP server acts as a bridge between AI agents and your BigQuery datasets.

Snow Leopard BigQuery MCP Server Features

Resources

Resource URI Description
bigquery://tables List all tables available to the agent
bigquery://tables/{table}/schema Get the schema of a specific table

Tools

Tool Description
list_tables(table: str) (optional) List available tables
get_schema(table: str) (optional) Get the schema of a given table
query(sql: str) Execute BigQuery SQL and return results

Quick Start: Claude Desktop

Prerequisites

Before getting started, ensure you have:

1. Setup Google Cloud

First, we need to authenticate with Google.

gcloud auth application-default login

This opens your browser to authenticate your local machine with Google Cloud.

2. Configure Claude Desktop

Edit your claude_desktop_config.json file to add the BigQuery MCP server.

Application: Claude > Settings > Developer > Edit Config
Mac: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\\Claude\\claude_desktop_config.json

You will need to set your project to a Google Cloud project with permissions to submit bigquery jobs. If you do not have a project that you can run bigquery jobs on, create and test one by following Google's BigQuery Quickstart Guide Create a project and follow the instructions to query a public dataset.

{
  "mcpServers": {
    "bigquery": {
      "command": "uvx",
      "args": [
        "sl-bigquery-mcp", 
        "--dataset",
        "bigquery-public-data.usa_names",
        "--project",
        "๐Ÿšจ <projectName> ๐Ÿšจ"
      ]
    }
  }
}

3. Close Claude Desktop and Launch it from the terminal

Depending on how you have installed uv, the uvx executable may not be in Claude Desktop's PATH if it is launched from the GUI. To be sure uvx is accessible from Claude Desktop, let's run it in the terminal.

open -a claude

After saving the configuration, restart Claude Desktop. You should now be able to ask Claude questions about your BigQuery data!

Example Query

What are the top 10 most popular names in 2020?

Configuration Options

To see a complete list of parameters:

uvx sl-bigquery-mcp --help
Usage: sl-bigquery-mcp [OPTIONS]

โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ --mode                       [stdio|sse|streamable-http]  MCP transport protocol [default: stdio]                                                     โ”‚
โ”‚ --dataset                    TEXT                         Dataset(s) for mcp resources. Will create resources for all tables.                         โ”‚
โ”‚ --table                      TEXT                         Table(s) for mcp resources. Can be specified as project.dataset.table or dataset.table      โ”‚
โ”‚ --enable-list-tables-tool    --no-enable-list-tables-tool Registers list_resources tool [default: enable-list-tables-tool]                            โ”‚
โ”‚ --enable-schema-tool         --no-enable-schema-tool      Registers get_schema tool [default: enable-schema-tool]                                     โ”‚
โ”‚ --project                    TEXT                         BigQuery project [env var: BQ_PROJECT] [default: None]                                      โ”‚
โ”‚ --api-method                 [INSERT|QUERY]               BigQuery client api_method [default: QUERY]                                                 โ”‚
โ”‚ --port                       INTEGER                      [default: 8000]                                                                             โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Troubleshooting / FAQ

An MCP Error has occurred

First, check out your Claude Desktop app logs (in the same directory as the config file) for more verbose errors / logging

On Startup

This usually means Claude is having issues starting the mcp server. Frequently this is due to uvx being inaccessible from the application. In this case, use the full path to your uvx executable instead of just uvx in claude_desktop_config.json.

To find your uv executable, run

which uvx

Otherwise, this may be caused by bad arguments, dependency version incompatibilities, or bugs. If you run into the last two, please file an issue describing the problem.

On Resource / Tool Usage

This may be a misconfiguration mcp server, authentication issues, the llm getting too much data, or of course, product bugs. After checking the logs, consider using the MCP Inspector to debug your issue. And of course, file any bugs you find on our issue board.

Local Development & Testing

Setup Development Environment

  1. Clone the repository
  2. Setup virtual environment and install dependencies
  3. Verify installation
git clone https://github.com/SnowLeopard-AI/bigquery-mcp.git
cd bigquery-mcp

uv sync
source .venv/bin/activate

sl-bigquery-mcp --help

Authenticate with Google Cloud

The following command will launch a browser for you to login to your google cloud account. You must have a Google Cloud project with BigQuery enabled. If you don't, see Google's bigquery setup guide.

gcloud auth application-default login
gcloud config set project <projectName>
gcloud auth application-default set-quota-project <projectName>

Running Tests

Run the tests to make sure your dev environment is properly configured.

pytest tests

Note: the tests run actual BigQuery queries against public datasets and require authentication.

Local MCP Inspector

For hands-on testing and development, use the MCP Inspector tool:

npx @modelcontextprotocol/inspector uv run sl-bigquery-mcp --dataset bigquery-public-data.usa_names

Contributing

We welcome contributions! Please coordinate with us on discord to ensure your changes can quicly make it into the repo. Communicating before coding always saves time.

For logistics of contributing to an open source project, see the first contributions repository.

Support

Issues: GitHub Issues
Documentation: BigQuery Documentation
MCP Protocol: Model Context Protocol
Contact: Discord Server

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sl_bigquery_mcp-0.1.9.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sl_bigquery_mcp-0.1.9-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file sl_bigquery_mcp-0.1.9.tar.gz.

File metadata

  • Download URL: sl_bigquery_mcp-0.1.9.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for sl_bigquery_mcp-0.1.9.tar.gz
Algorithm Hash digest
SHA256 fab1906bc81a3161ce9e080b93cca39ad10a36c4b8bea3b20c822d4e506c7d57
MD5 42419f3fb0c656082ffb88562bb2eb2b
BLAKE2b-256 e75d69edd730911e6f4f91a490ea2648bcd99dffca16accc2d8279ab56757079

See more details on using hashes here.

File details

Details for the file sl_bigquery_mcp-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: sl_bigquery_mcp-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for sl_bigquery_mcp-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 2a3ca858af9c5da03e66e31f8b3b8304d8bf66a35cd02f48af6c7ff077d814b9
MD5 b63f8d2cff4154becca8fbde80c68659
BLAKE2b-256 54e6c1ea357e70ce14d172686adf0ed5008a76a9be0eae49305985bb6a7ea8e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page