How to Configure OpenHands Snowflake MCP Server

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up an openhands snowflake mcp server by linking the agent to your warehouse. You pass a database role and login key to the local server tool. Most teams start with a shared admin account to test fast. That broad role lets the AI agent read every table and change live data. One bad prompt can drop a table or pull private records into the chat. How the openhands snowflake mcp server workflow operates OpenHands runs as an autonomous coding agent inside its own workspace. It uses the Mode

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.

You set up an openhands snowflake mcp server by linking the agent to your warehouse. You pass a database role and login key to the local server tool. Most teams start with a shared admin account to test fast. That broad role lets the AI agent read every table and change live data. One bad prompt can drop a table or pull private records into the chat.

How the openhands snowflake mcp server workflow operates

OpenHands runs as an autonomous coding agent inside its own workspace. It uses the Model Context Protocol to talk to outside data tools. The server tool sits between the agent workspace and your cloud warehouse. When the agent needs schema details or sample rows, it sends a tool call. The server tool translates that call into a standard database query.

The cloud warehouse checks the role and credentials attached to that active session. You can log in using a dedicated service user and a private key. The warehouse then runs the SQL statement under that assigned database role. Results travel back through the local server tool to the agent context window. The agent reads those rows to write code, build reports, or fix bugs.

Good setups give the service user a tight read-only role. You grant select rights on specific schemas and hide billing or user tables. You also pick a small compute warehouse so heavy queries do not spike costs. The warehouse enforces these object permissions every time the agent starts a session.

What native warehouse roles solve and what they miss

Native warehouse roles control which schemas and tables a service user can read. They block the agent from reading restricted databases or running admin commands. You can also set warehouse timeouts to stop runaway queries from burning credits. These built-in controls handle basic login checks and table-level permissions well.

Still, static database roles only decide who logs in and which tables open. They do not inspect what individual statements do in flight during a session. If a developer shares a workspace, every prompt uses the same static service identity. Audit logs show the shared service account rather than the human who ran OpenHands.

Snowflake Access Control + Kubernetes API Server Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Table grants also return full columns whenever a query runs. If a permitted table holds customer emails or phone numbers, the agent gets them. Data masking inside the warehouse requires manual policy creation across every single column. Teams often skip this step on staging schemas, which exposes raw card numbers. Static keys stored in agent config files also create a leak risk on laptops.

Scoping agent permissions for safer database queries

Before you let an agent query live data, trim its database role down. Create a fresh role made just for the coding agent tool. Grant read permissions only on the views needed for the current task. Never reuse a human engineer account or a broad analytics role.

Next, separate your test data from production customer records when possible. If the agent only needs table structures, grant metadata view rights without row permissions. When row reads are needed, apply masking rules to rewrite national IDs and emails. Check your warehouse query history often to see what SQL the agent writes. Rotate the service key on a set schedule and clear old agent logs.

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

How does OpenHands talk to a cloud data warehouse?

OpenHands sends structured tool calls to a local Model Context Protocol server. That server authenticates with the warehouse, runs the SQL query, and returns the rows.

Should I give the coding agent a read-write database role?

No, you should assign a strict read-only role to the agent service user. Write permissions let autonomous agents alter schemas or delete rows by mistake.

What sensitive fields should we mask from AI agent queries?

You should mask emails, phone numbers, card numbers, and national IDs in query results. Masking rewrites matched fields in results before the agent reads the output.

The query runs. The emails stay hidden.