How to Configure OpenHands Bigquery MCP Server

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up an openhands bigquery mcp server, link your agent workspace to Google Cloud. You must pass a service account key or local login to the server process. Teams often assign broad project roles during setup so queries run without permission errors. Those wide roles let an autonomous coding agent read private tables or run expensive scans. How the openhands bigquery mcp server setup works OpenHands runs coding agents inside an isolated workspace or container on your machine. The Model Co

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

To set up an openhands bigquery mcp server, link your agent workspace to Google Cloud. You must pass a service account key or local login to the server process. Teams often assign broad project roles during setup so queries run without permission errors. Those wide roles let an autonomous coding agent read private tables or run expensive scans.

How the openhands bigquery mcp server setup works

OpenHands runs coding agents inside an isolated workspace or container on your machine. The Model Context Protocol lets the agent call external data tools through standard messages. When you add the BigQuery server, OpenHands starts that tool as a child process. The agent then lists datasets, checks table schemas, and sends SQL queries for analysis.

Google Cloud IAM controls what the server process can do inside your data warehouse. You create a service account or use local developer credentials to log in. Next, you grant roles that allow job execution and table data reads across projects. You also point the server to a target project ID and dataset location. Once linked, the agent translates natural language prompts into standard SQL statements and runs them.

What native IAM roles solve and what they miss

Cloud IAM roles decide which principal can log in and which datasets it can see. You can limit a service account to read-only roles on one specific dataset. This setup stops the agent from dropping tables or reading unrelated project folders. Native project quotas can also cap the total bytes billed per day for that account.

Still, static cloud roles only check permissions at login and dataset boundaries. They do not inspect individual SQL statements before the database runs them in flight. If a permitted table holds emails, phone numbers, or card numbers, the query returns them. Data masking must rewrite matched fields in results before the agent context reads them. Static keys stored in agent workspace files also create a risk of credential leaks.

Managing agent queries and sensitive data

Autonomous agents often explore schemas by running wide select queries across many large tables. A single bad prompt can trigger full table scans that drive up cloud bills. Teams need a way to check each query string before it reaches the warehouse. Blocking destructive statements or unapproved joins keeps the data warehouse safe during automated runs.

BigQuery IAM + Kubernetes API Server Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Audit logs are also hard to trace when ten developers share one service account. Cloud logs show the shared service account name instead of the person running the agent. Tying each query to an individual user identity fixes this tracking gap during reviews. Clear per-query logs and field masking let teams run data agents with much lower risk.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

What permissions does an OpenHands agent need for BigQuery?

The agent needs a role that can create query jobs and read table metadata. Granting viewer access on specific datasets is safer than giving project-wide editor roles.

How do you stop agents from reading sensitive columns in BigQuery?

You can use column-level security in Google Cloud or apply dynamic data masking. Masking rewrites matched fields like emails and phone numbers in query results.

Why should teams avoid putting service account keys in agent containers?

Long-lived JSON keys inside containers can leak through logs, prompts, or shared workspace files. Short-lived tokens or external credential handling keep raw secrets out of the agent workspace.

Short role checks help teams work fast. Simple rules make each review clear. Good logs keep every team safe. Scoped keys stop bad changes early.

The query runs. The emails stay hidden.