How to Configure Devin ClickHouse MCP Server

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a devin clickhouse mcp server by creating a restricted database user. Then you link that user role to your AI agent workspace. Most teams start by sharing a broad admin user to test fast. This shortcut creates high risk because the agent can alter tables or read secret rows. A safe setup requires strict database roles and clear query rules from day one. How to set up a devin clickhouse mcp server with native roles ClickHouse manages users, roles, row policies, settings profiles, an

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 a devin clickhouse mcp server by creating a restricted database user. Then you link that user role to your AI agent workspace. Most teams start by sharing a broad admin user to test fast. This shortcut creates high risk because the agent can alter tables or read secret rows. A safe setup requires strict database roles and clear query rules from day one.

How to set up a devin clickhouse mcp server with native roles

ClickHouse manages users, roles, row policies, settings profiles, and quotas with SQL statements. Before you create an agent role, you must turn on SQL-driven access control. This step needs a storage path on the server. It also requires one admin user with access management turned on. Once active, that admin can create a dedicated user for the AI agent.

Note that a user can only grant privileges that they hold themselves. Making the agent account also requires the create user privilege. During setup, you pick how the user logs in and set default roles. You can also restrict which hosts the agent user may connect from. Finally, you attach per-user settings to cap memory use or block data edits.

After creating the user, you should lock down what tables it can read. ClickHouse lets you grant select rights on single columns instead of full tables. If you grant access to two columns, the agent can query only those two. If the agent tries to query a third column, the database blocks the run. A wildcard select across all columns will also fail and return no data. The wildcard query only works if the table holds just the allowed columns. In newer database builds, a trailing asterisk can grant rights by table name prefix.

What native database roles solve and what they miss

Native roles and column grants solve the first part of agent security. They decide who can log in and which columns are off limits. Host rules also stop outside machines from using the agent login key. If a table holds emails or card numbers, you can block those columns.

Still, static grants leave an operational gap during live agent work. Native setup decides who logs in, not what individual statements do in flight. Sometimes an agent needs to read a mixed text column to fix a bug. That column might hold phone numbers or national IDs mixed with app logs. A column grant is all or nothing, so you must allow or block it. Static roles cannot rewrite matched fields in results while letting safe text pass through. They also require you to store static keys inside the agent workspace settings.

ClickHouse Access Management + Kubernetes API Server Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Why query habits break strict column rules

AI coding agents often explore schemas by running broad sample queries first. A common habit is selecting every column on a table to check data types. As noted earlier, ClickHouse refuses wildcard selects when column grants are in place. The query returns zero rows, which confuses the agent and stalls the task.

To avoid this error, teams often grant full table read rights again. That choice brings back the risk of exposing emails, phone numbers, or card numbers. Teams need a way to allow broad select queries while still protecting sensitive fields. Rewriting matched fields in results solves this problem without breaking standard select queries.

Add runtime guardrails and masking beside ClickHouse

Database grants and network rules control who can reach ClickHouse. Even so, an allowed client or agent can send an alter mutation that deletes rows or read raw personal data. In practice, hoop.dev runs beside the server as a sidecar for your ClickHouse and checks native TCP queries with no change to your drivers.

With hoop.dev ClickHouse support, guardrails refuse banned queries before they run, and data masking rewrites matched string columns in results. The audit trail logs which entity types were masked and how many without storing raw values. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Why do wildcard queries fail on my devin clickhouse mcp server?

ClickHouse blocks wildcard select queries when a user only has partial column grants. The query only works if the user has rights to every column in that table by default.

How do I limit where the ClickHouse agent user logs in from?

When you run the create user statement, you can define allowed client hosts. This rule stops the login from working outside your approved network IP list.

Can a ClickHouse user grant extra table access to the AI agent?

A database user can only grant privileges that they already hold themselves. They also need explicit access management rights turned on by a server admin.

The query runs. The emails stay hidden.