How to Configure Semantic Kernel ClickHouse MCP Server

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up a semantic kernel clickhouse mcp server, register the server as a plugin. Then bind it to a restricted database role with strict read privileges. Many teams start by giving the agent a broad admin account for quick testing. This choice exposes every table and allows accidental data changes during automated runs. A safe setup pairs the agent plugin with native SQL rules inside the database. How a semantic kernel clickhouse mcp server works Semantic Kernel runs AI agents that call ext

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 a semantic kernel clickhouse mcp server, register the server as a plugin. Then bind it to a restricted database role with strict read privileges. Many teams start by giving the agent a broad admin account for quick testing. This choice exposes every table and allows accidental data changes during automated runs. A safe setup pairs the agent plugin with native SQL rules inside the database.

How a semantic kernel clickhouse mcp server works

Semantic Kernel runs AI agents that call external tools to fetch data and answer prompts. The Model Context Protocol server acts as a bridge between the agent and ClickHouse. When the agent needs data, it asks the tool to run a query. The server logs in to the database using a set user account. It runs the SQL statement and sends the rows back to the agent.

Inside ClickHouse, admins control this account through SQL-driven access rules. You first turn on SQL access control by setting a storage path on the server. At least one admin account needs access management rights turned on to build roles. That admin can then create a dedicated user for the MCP tool. Note that a user can only grant rights that they already hold themselves.

When creating the agent user, you define how it logs in. You also restrict which hosts can connect to the database. You can attach default roles, row policies, settings profiles, and usage quotas. These entities keep the AI agent inside clear boundaries when it connects.

Locking down tables and columns for AI agents

An AI agent should only read the exact data it needs for its task. ClickHouse lets you grant read rights on specific columns in a table. If you grant read access on two columns, the agent can query only those two. Any query that asks for a third column will fail right away.

This column rule also blocks broad wildcard queries on partial tables. If the agent runs a select-all query, the database refuses it and returns nothing. Select-all only works when the user holds rights on every column in that table by default. Since version 24.10, admins can also grant rights across tables that share a name prefix. This helps teams group safe analytics tables for the agent under one naming pattern.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native database roles leave open

Native roles and column grants decide who can log in and which columns are readable. They do not inspect what individual queries do in flight once a session starts. If an allowed column holds emails, phone numbers, or card numbers, the query returns them. The database sends those raw values straight into the agent prompt context.

Static credentials stored in the MCP server config also create a key management task. Every agent worker that shares that config uses the same database identity in the logs. When an agent runs a bad query, you see the shared user name. You do not see which user prompt or app workflow triggered that specific database call. You also cannot pause a risky query for human review before it runs.

Check ClickHouse queries and results before execution

Access control in ClickHouse is essential setup. Setup alone does not check single queries for risk or rewrite sensitive strings in returned rows. By design, hoop.dev sits beside the server as a sidecar for your ClickHouse and parses every statement before execution.

First, hoop.dev guardrails block disallowed deletes, drops, and alter mutations. Then hoop.dev data masking rewrites sensitive string columns in responses and logs each decision per resource. Read the docs and source on GitHub.

Frequently asked questions

Why do select-all queries fail on our semantic kernel clickhouse mcp server?

ClickHouse blocks select-all queries when a user only has rights on certain columns. Update the agent instructions to request only the specific allowed column names in every query.

How do we enable SQL roles and users in ClickHouse?

You must set the access control storage path in your server settings first. You also need an admin user with access management rights enabled to create new users.

Can we restrict which machines use the MCP database account?

Yes, the user creation statement lets you specify which hosts can log in. You can lock the account so it only accepts connections from your MCP server host.

The query runs. The emails stay hidden.