1. Conduid
  2. Data
  3. Clickhousemcp
MCP server · Data

Clickhousemcp

Clickhouse mcp server & pydantic ai agent integration

Unclaimed MIT data
51Fair

Scored 9 days ago · breakdown

About Clickhousemcp

Clickhousemcp is an MCP server published by AranNomante in the Data category: clickhouse mcp server & pydantic ai agent integration.

Recent commit activity is the strongest signal that reported issues will get attention.

Install

From source
git clone https://github.com/AranNomante/clickhousemcp

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Clickhousemcp

Powered by Claude · Grounded in docs

I know everything about Clickhousemcp. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

3 checks have not been run yet.

Releases

v0.12.0Stable api · 7 Jun 2026What's Changed 0.12.0 stable by @AranNomante in https://github.com/AranNomante/clickhousemcp/pull/31 Full Changelog: https://github.com/AranNomante/clickhousemcp/compare/v0.11.2...v0.12.0
v0.11.2Agent API expansion · 7 Jun 2026What's Changed feat: 0.11.2 — batch queries, reset, cache, SQL isolation, bug fixes by @AranNomante in https://github.com/AranNomante/clickhousemcp/pull/30 Full Changelog:…
v0.10.0Production Readiness & Fixes · 25 May 2026What's Changed 0.10 by @AranNomante in https://github.com/AranNomante/clickhousemcp/pull/29 Full Changelog: https://github.com/AranNomante/clickhousemcp/compare/v0.9.0...v0.10.0
v0.9.0Foundations · 24 May 2026What's Changed 0.9.0 ammend fix lint issues by @AranNomante in https://github.com/AranNomante/clickhousemcp/pull/28 fixes changes and more, please see full changelog as this is a foundation update including fixes, changes and roadmap…
v0.8.0Stream support · 5 Sep 2025What's Changed minor changes on doc by @AranNomante in https://github.com/AranNomante/clickhousemcp/pull/24 closes #25 #26 by @AranNomante in https://github.com/AranNomante/clickhousemcp/pull/27 Full Changelog:…

README

ClickHouse MCP Agent

version

AI agent for ClickHouse database analysis via MCP (Model Context Protocol).

This release reflects a simplified architecture: a single MCP server (mcp-clickhouse) driven by a single agent instance. Access restriction is performed via explicit allow-lists you pass per call (databases/tables), rather than managing multiple keys or fan-out across multiple agents.

Features

  • Query ClickHouse databases using AI models
  • Structured output: analysis, SQL used, confidence
  • Easy connection management (predefined or custom)
  • Conversational context with message-history pruning/summarization
  • No CLI or external .env required; configure at runtime
  • Single MCP server, single agent lifecycle (no multi-key fan-out)
  • Access restriction via per-call allow-lists (allowed_tables)
  • Streamable results

Supported Providers

  • OpenAI
  • Anthropic
  • Google Gemini
  • Groq
  • Mistral
  • Cohere

Quickstart

  • Set model/provider and API key using the runtime config
  • Instantiate ClickHouseAgent and call run() or run_stream()

Example mirrors examples/example_minimal.py:

import asyncio
from agent.clickhouse_agent import ClickHouseAgent
from agent.config import config

config.set_log_level("DEBUG")
config.set_ai_model("gemini-2.0-flash")
config.set_model_api_key("google", "your_api_key_here")

async def main():
    agent = ClickHouseAgent()
    # Single MCP server (mcp-clickhouse). Limit scope via allow-lists (recommended)
    result = await agent.run(
        allowed_tables=["top_repos_mv"],
        query="SHOW_TABLES",
    )
    print("Analysis:", result.analysis)
    print("SQL Used:", result.sql_used)
    print("Confidence:", result.confidence)

asyncio.run(main())
  • For multi-turn conversations, pass message_history between calls. If token usage grows, the agent can summarize history (see below).

Message History & Summarization

  • History processing is handled in agent/history_processor.py.
  • Summarization behavior is controlled via agent.config.summarize_config (model, provider, token limit).
  • When token usage exceeds the configured limit, older messages are summarized into a compact form.

Output

Each call to ClickHouseAgent.run() returns a RunResult with:

  • messages: Full (possibly pruned/summarized) message history.
  • new_messages: Only messages created in the latest turn.
  • last_message: The last message in the conversation.
  • usage: Token/usage statistics for the run.
  • analysis: Natural-language result text from the model.
  • sql_used: SQL used (if applicable) from the model output.
  • confidence: Confidence level (1-10).

Requirements

  • Python 3.10+
  • AI API key for your provider (OpenAI, Anthropic, Google/Gemini, Groq, Mistral, Cohere)

All dependencies are managed via pyproject.toml.

Roadmap

✅ Completed

  • MCP integration via pydantic_ai.mcp.MCPServerStdio
  • SQL generation/execution via MCP tools
  • Schema inspection (databases/tables/columns)
  • Config-driven connections (playground/local/custom)
  • Access restriction via per-call allow-lists (allowed_tables)
  • Runtime provider/model selection and API key management
  • Structured outputs (ClickHouseOutput) and RunResult
  • Message history pruning/summarization
  • Type annotations and basic linting
  • Streaming results via run_stream()

🚧 Planned

  • Improved error handling and diagnostics
  • Advanced output formatting for downstream apps

Contributing

Open an issue or pull request for features or fixes.

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About Clickhousemcp

How do I install Clickhousemcp?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Clickhousemcp safe to use with an AI agent?

Its trust score is 51 out of 100 (fair). It passes 2 of the 3 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Clickhousemcp still maintained?

Yes — the latest release is v0.12.0 (7 Jun 2026), and the last commit was 4 months ago. The repository has 0 stars.