Imagine asking your BigQuery data questions like “Which products sold the most last month?” in plain English—and getting an immediate, accurate answer. This is now possible using the Model Context Protocol (MCP), which lets Claude Desktop securely connect to a BigQuery MCP server and turn natural language into actionable SQL queries.

In this article, you’ll learn:

  • What MCP is and why it matters
  • How to install and configure a BigQuery MCP server
  • How to connect Claude Desktop to BigQuery
  • How to test natural language queries
  • Security best practices
  • A full sample implementation with code

Understanding MCP and Its Benefits

The Model Context Protocol (MCP) is an open standard designed to unify how large language models (LLMs) communicate with external systems. Instead of creating custom connectors for every app, MCP standardizes integration using JSON-RPC 2.0 over stdio or HTTP. MCP servers expose “tools” (functions) such as:

  • list-tables
  • describe-table
  • execute-query

Claude Desktop acts as an MCP client, automatically recognizing these tools and using them to answer questions in context—without you writing SQL.

Selecting a BigQuery MCP Server

There are two main paths:

1. Open-source community server (ergut/mcp-bigquery-server)

  • Free and customizable
  • Supports both default Google Cloud authentication and service account keys
  • Can be installed manually or via Smithery
  • Requires roles/bigquery.user or dataViewer + jobUser

Enterprise solution (CData Connect Cloud MCP)

  • Commercial product with UI setup
  • OAuth or service account authentication
  • Automatic Claude Desktop integration

We’ll focus on the open-source approach for full transparency and control.

Prerequisites

Before starting, ensure you have:

  • BigQuery enabled in your Google Cloud project
  • A service account key or gcloud auth application-default login
  • Claude Desktop installed on macOS or Windows
  • Node.js installed (for the MCP server runtime)
  • Appropriate IAM permissions: roles/bigquery.user or similar

Installing via Smithery (Fastest Way)

npx @smithery/cli install @ergut/mcp-bigquery-server –client claude

You’ll be prompted to:

  • Enter your Google Cloud project ID
  • Specify BigQuery location (e.g., us-central1)

Smithery automatically updates Claude’s config and starts the server. Restart Claude Desktop, and you’re ready to query.

Manual Configuration (More Control)

  1. Authenticate with Google Cloud:
    gcloud auth application-default login

    Or use a service account key JSON for production environments.

  2. Update Claude Desktop configuration:Locate claude_desktop_config.json:
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json

    Add:

    {
    “mcpServers”: {
    “bigquery”: {
    “command”: “npx”,
    “args”: [
    “-y”,
    “@ergut/mcp-bigquery-server”,
    “–project-id”, “your-project-id”,
    “–location”, “your-location”,
    “–key-file”, “/path/to/key.json” // optional
    ]
    }
    }
    }
  3. Restart Claude Desktop.

Building Your Own MCP Server in Python

If you’d rather implement your own, here’s a minimal example using fastmcp:

import asyncio, argparse
from google.cloud import bigquery
from google.oauth2 import service_account
from mcp.server.fastmcp import FastMCP
async def list_tables(client, dataset_id):
return [t.table_id for t in client.list_tables(dataset_id)]
async def describe_table(client, dataset_id, table_id):
table = client.get_table(f”{dataset_id}.{table_id})
return [{“name”: f.name, “type”: f.field_type} for f in table.schema]
async def execute_query(client, sql):
results = client.query(sql).result()
return [dict(row) for row in results]
def main():
p = argparse.ArgumentParser()
p.add_argument(“–project”, required=True)
p.add_argument(“–location”, default=“US”)
p.add_argument(“–key-file”, default=None)
args = p.parse_args()
creds = (service_account.Credentials.from_service_account_file(args.key_file)
if args.key_file else None)
client = bigquery.Client(project=args.project, location=args.location, credentials=creds)
mcp = FastMCP()
mcp.register_tool(“list-tables”, lambda p: list_tables(client, p[“dataset”]))
mcp.register_tool(“describe-table”, lambda p: describe_table(client, p[“dataset”], p[“table”]))
mcp.register_tool(“execute-query”, lambda p: execute_query(client, p[“sql”]))
asyncio.run(mcp.serve())
if __name__ == “__main__”:
main()

Then configure Claude:

{
“mcpServers”: {
“bigquery”: {
“command”: “python3”,
“args”: [“path/to/server.py”, “–project”, “your-project”, “–location”, “your-location”]
}
}
}

Querying Data in Natural Language

Once connected, you can type into Claude:

  • “List all tables in dataset analytics
  • “What columns are in users?”
  • “Show top 5 customers by revenue last quarter”

Claude automatically uses the MCP tools to generate SQL, execute it, and format results.

Security and Best Practices

  • Use read-only roles: roles/bigquery.user or dataViewer + jobUser
  • Prefer local servers: Keeps data and credentials under your control
  • Enforce query limits: Prevent runaway costs by capping query sizes
  • Audit tools: Only use trusted MCP servers to avoid malicious behavior

Conclusion

Combining Claude Desktop, MCP, and BigQuery lets you move from rigid SQL commands to simple English questions. Whether you choose Smithery for quick setup, build your own Python MCP server, or use an enterprise connector, the result is the same:

  • Faster insights: No SQL expertise required
  • Secure integration: Credentials never leave your environment
  • Extensibility: Add more tools or databases using the same protocol

In short, MCP unlocks conversational access to your most valuable data—helping you make decisions faster, collaborate better, and focus on strategy rather than syntax. Set up your server today, connect Claude, and start talking to BigQuery.