1. Conduid
  2. Developer Tools
  3. Bq MCP Server
MCP server · Developer Tools

Bq MCP Server

Python-based MCP (Model Context Protocol) server that retrieves dataset, table, and schema information from Google Cloud BigQuery

Unclaimed MIT last commit a year ago devtools
45Fair

Scored 3 days ago · breakdown

About Bq MCP Server

Bq MCP Server is an MCP server published by takada-at in the Developer Tools category: python-based MCP (Model Context Protocol) server that retrieves dataset, table, and schema information from Google Cloud BigQuery. It has been installed 0 times through Conduid.

Six months or more without a commit doesn't mean the server is broken, but check the open issues (0) before depending on it in production.

Install

Install
npx bq-mcp-server

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

Ask AI about Bq MCP Server

Powered by Claude · Grounded in docs

I know everything about Bq MCP Server. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ·README presentNot checked yet.
  • ·License declaredNot checked yet.
  • ·Tests presentNot checked yet.
  • ·Dependencies pinnedNot checked yet.
  • ·No dynamic code executionNot checked yet.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v0.2.2Version 0.2.2 · 12 Aug 20250.2.2 - 2025-08-12 Changed Fixed to provide appropriate warnings when automatically inserting LIMIT.
v0.2.1Version 0.2.1 · 11 Aug 20250.2.1 - 2025-08-11 Changed Change the default DEFAULT_QUERY_LIMIT value(10 -> 100).
v0.2Version 0.2.0 · 11 Aug 20250.2.0 - 2025-08-11 Added New MCP tool: `save_query_result`** - Execute BigQuery SQL queries and save results to local files Support for CSV and JSONL output formats No automatic LIMIT clause insertion (unlike `execute_query`) Path…
v0.1.4Version 0.1.4 · 9 Aug 2025Fix Supports mcp library version 1.12.3 and above. Removes the description parameter.

README

BigQuery MCP Server

Python Version Framework

This is a Python-based MCP (Model Context Protocol) server that retrieves dataset, table, and schema information from Google Cloud BigQuery, caches it locally, and serves it via MCP. Its primary purpose is to enable generative AI systems to quickly understand BigQuery's structure and execute queries securely.

Key Features

  • Metadata Management: Retrieves and caches information about BigQuery datasets, tables, and columns
  • Keyword Search: Supports keyword search of cached metadata
  • Secure Query Execution: Provides SQL execution capabilities with automatic LIMIT clause insertion and cost control
  • File Export: Execute queries and save results to local files in CSV or JSONL format
  • MCP Compliance: Offers tools via the Model Context Protocol

MCP Server Tools

Available tools:

  1. get_datasets - Retrieves a list of all datasets
  2. get_tables - Retrieves all tables within a specified dataset (requires dataset_id, optionally accepts project_id)
  3. search_metadata - Searches metadata for datasets, tables, and columns
  4. execute_query - Safely executes BigQuery SQL queries with automatic LIMIT clause insertion and cost control
  5. check_query_scan_amount - Retrieves the scan amount for BigQuery SQL queries
  6. save_query_result - Executes BigQuery SQL queries and saves results to local files (CSV or JSONL format)

Tool Details

save_query_result

The save_query_result tool provides advanced query execution with file export capabilities:

Parameters:

  • sql (required): SQL query to execute
  • output_path (required): Local file path to save results
  • format (optional): Output format - "csv" (default) or "jsonl"
  • project_id (optional): Target GCP project ID
  • include_header (optional): Include header row in CSV output (default: true)

Key Features:

  • No Automatic LIMIT: Unlike execute_query, this tool does not automatically add LIMIT clauses to your SQL queries
  • Cost Control: Maintains scan amount limits (default: 1GB) and safety checks to prevent expensive queries
  • Security: Path validation prevents directory traversal attacks
  • Flexible Formats: Supports both CSV and JSONL output formats
  • Large Dataset Support: Handles large query results efficiently within scan limits

Example Usage:

-- Export all rows without LIMIT restriction (subject to scan amount limits)
SELECT customer_id, order_date, total_amount 
FROM `project.dataset.orders` 
WHERE order_date >= '2024-01-01'

Important Note: While this tool doesn't add LIMIT clauses, it still enforces scan amount limits for cost protection. Queries that would scan more than the configured limit (default: 1GB) will be rejected.

Installation and Environment Setup

Prerequisites

  • Python 3.11 or later
  • Google Cloud Platform account
  • GCP project with BigQuery API enabled

Install

uv

uv add bq_mcp_server

pip

pip install bq_mcp_server

Installing Dependencies

This project uses uv for package management:

# Install uv if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install dependencies
uv sync

Configuring Option

For a list of configuration values, see:

docs/settings.md

MCP Setting

Claude Code

claude mcp add bq_mcp_server -- uvx --from git+https://github.com/takada-at/bq_mcp_server bq_mcp_server --project-ids <your project ids>

JSON

{
    "mcpServers": {
        "bq_mcp_server": {
            "command": "uvx",
            "args": [
                "--from",
                "git+https://github.com/takada-at/bq_mcp_server",
                "bq_mcp_server",
                "--project-ids",
                "<your project ids>"
            ]
        }
    }
}

Running Tests

Running All Tests

pytest

Running Specific Test Files

pytest tests/test_logic.py

Running Specific Test Functions

pytest -k test_function_name

Checking Test Coverage

pytest --cov=bq_mcp_server

Local Development

Starting the MCP Server

uv run bq_mcp_server

Starting the FastAPI REST API Server

uvicorn bq_mcp_server.adapters.web:app --reload

Development Commands

Code Formatting and Linting

# Code formatting
ruff format

# Linting checks
ruff check

# Automatic fixes
ruff check --fix

Dependency Management

# Adding new dependencies
uv add <package>

# Adding development dependencies
uv add --dev <package>

# Updating dependencies
uv sync

README mirrored from the source repository 3 days ago. The original is authoritative.

Questions

About Bq MCP Server

How do I install Bq MCP Server?

Run npx bq-mcp-server, then add the server to your MCP client's configuration. Conduid has recorded 0 installs, so the command is known to work with current clients.

Is Bq MCP Server safe to use with an AI agent?

Its trust score is 45 out of 100 (fair). It passes 0 of 1 static security checks; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Bq MCP Server still maintained?

The last commit was a year ago, with 0 open issues. That's long enough that you should check whether the maintainer is responding to issues before depending on it.