mcp-clickhouse: Instructions file for Codex

AGENTS.md

mcp-clickhouse AGENTS.md is an instructions file for Codex, OpenCode from ClickHouse/mcp-clickhouse. It costs 2,213 tokens per session, scanned A, original, Apache-2.0.

A set of instructions for coding agents working on a ClickHouse database connection. ClickHouse is a database commonly used for fast analysis of large datasets.

In plain words
What is it for?
Use it when modifying or reviewing the ClickHouse MCP server, its environment settings, query handling, authentication, health checks, pagination, or response formats.
Why use it?
It gives agents a project map and working rules so changes respect the repository’s documentation, security behavior, configuration, and tool contracts.

Instructions file for CodexOpenCode ✓ vendor

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is ClickHouse/mcp-clickhouse's own configuration. It tells Codex and OpenCode how to work on mcp-clickhouse itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-clickhouse configures →

About the project

ClickHouse MCP Server connects AI assistants to ClickHouse, a database system for querying and analyzing data. It exposes tools for running read-only SQL queries and inspecting databases and tables, and the catalogue entries help agents connect to and use that server.

ClickHouse/mcp-clickhouse · 898 stars · on GitHub

Reuse

Borrowing it

Nothing to install: this file belongs to ClickHouse/mcp-clickhouse. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ClickHouse/mcp-clickhouse/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/ClickHouse/mcp-clickhouse

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-clickhouse AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/clickhouse/mcp-clickhouse/agents-md/github.svg)](https://agentmods.dev/instructions/clickhouse/mcp-clickhouse/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/clickhouse/mcp-clickhouse/agents-md"><img src="https://agentmods.dev/badge/instructions/clickhouse/mcp-clickhouse/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-clickhouse AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/clickhouse/mcp-clickhouse/agents-md"><img src="https://agentmods.dev/badge/instructions/clickhouse/mcp-clickhouse/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,213 This file is loaded in full into every session.
When invoked 2,213 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02213 $0.02213
Opus 5.5 $0.00885 $0.00885
Sonnet 5.5 $0.00443 $0.00443
Haiku 4.5 $0.00221 $0.00221

Measured 1mo ago against content hash 4c94f77c1b8d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mcp-clickhouse AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 158 lines

How it starts

The opening of the file, as written. The whole thing — 158 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Instructions

AGENTS.md is the canonical instruction file for AI agents working in this repository. If another agent-facing file disagrees with this one, this file wins.

Before making substantial changes, read README.md, pyproject.toml, and the relevant source and tests. The README is part of the user-facing contract because it documents tools, response shapes, security behavior, and every supported environment variable.

Role

Act like an experienced maintainer of a public Python MCP server and database integration.

  • Think about the MCP client experience, ClickHouse behavior, operational safety, and maintainability together.
  • Be opinionated and practical. Do not over-engineer.
  • Do not engage in sycophancy.
  • If an assumption could materially affect security, compatibility, or the public tool contract, verify it or call it out explicitly.

Project Map

  • mcp_clickhouse/mcp_server.py: Startup assembly, FastMCP server construction, tool and prompt registration, and shutdown coordination.
  • mcp_clickhouse/auth.py: Default dotenv loading, HTTP/SSE authentication, and FastMCP provider environment compatibility.
  • mcp_clickhouse/transport.py: FastMCP HTTP/SSE app construction and trusted proxy integration.
  • mcp_clickhouse/executors.py: Per-server query, metadata, cancellation, and health worker pools.
  • mcp_clickhouse/chdb_backend.py: Per-server chDB state, lazy client initialization, query execution, and result processing.
  • mcp_clickhouse/clients.py: Request configuration, connection diagnostics, readonly settings, and per-server ClickHouse client caches and leases.
  • mcp_clickhouse/queries.py: Per-server ClickHouse query execution, active-query state, cancellation, and destructive-operation guards.
  • mcp_clickhouse/metadata.py: Database and table discovery, metadata models, and per-server pagination state.
  • mcp_clickhouse/health.py: Per-server health probes, result caching, and the public health route.
  • mcp_clickhouse/serialization.py: JSON tool-result encoding and exact integer handling.
  • mcp_clickhouse/http_security.py: Host and Origin validation and trusted proxy handling.
  • mcp_clickhouse/mcp_env.py: environment-backed configuration and validation. Treat this as the source of truth for configuration semantics.
  • mcp_clickhouse/main.py: runtime entry point and transport startup.
  • mcp_clickhouse/mcp_middleware_hook.py: optional user-provided middleware loading.
  • mcp_clickhouse/chdb_prompt.py: the public chDB prompt content.
  • mcp_clickhouse/skills_advisor.py: server-level instructions advertised to MCP clients.
  • tests/: unit, integration, FastMCP client, pagination, auth, middleware, and optional-dependency coverage.
  • test-services/docker-compose.yaml: local ClickHouse service for integration tests.
  • .github/workflows/ci.yaml: authoritative CI commands and CI ClickHouse version.

Read the full file on GitHub · 158 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +10 lines · +244 tokens per session 4c94f77c1b8d
  2. 1mo ago Changed 45d4f955d37b
  3. 2mo ago First seen · 148 lines · 1,969 tokens per session scan A 02016dbb2aa6

Subscribe to this mod's changes

mcp-clickhouse AGENTS.md is an instructions file published in the GitHub repository ClickHouse/mcp-clickhouse (898 stars, last pushed 2d ago), licensed Apache-2.0. It adds 2,213 tokens to every session, about $0.0089 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,461 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens