Altinity MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add altinity-mcp -- docker run -it --rm ghcr.io/altinity/altinity-mcp:latest --clickhouse-host clickhouse
README.md

Interact with ClickHouse databases through the Model Context Protocol

Altinity MCP Server

A Model Context Protocol (MCP) server that provides tools for interacting with ClickHouse® databases. This server enables AI assistants and other MCP clients to query, analyze, and interact with ClickHouse® databases through a standardized protocol.

Features

  • Multiple Transport Options: Support for STDIO, HTTP, and Server-Sent Events (SSE) transports
  • OAuth 2.0 Authorization: Forward Bearer tokens to ClickHouse for token-based authentication via OIDC providers (see OAuth 2.0 Documentation)
  • JWE Authentication: Optional JWE-based authentication with encryption for secure database access
  • TLS Support: Full TLS encryption support for both ClickHouse® connections and MCP server endpoints
  • Comprehensive Tools: Built-in tools for listing tables, describing schemas, and executing queries
  • Dynamic Tools: Automatically generate MCP tools from ClickHouse® views (see Dynamic Tools Documentation)
  • Resource Templates: Dynamic resource discovery for database schemas and table information
  • Query Prompts: AI-assisted query building and optimization prompts
  • Configuration Management: Flexible configuration via files, environment variables, or CLI flags
  • Hot Reload: Dynamic configuration reloading without server restart

Quick Start

Using STDIO Transport (Default)

# Basic usage with default settings
./altinity-mcp --clickhouse-host localhost --clickhouse-port 8123

# With custom database and credentials
./altinity-mcp \
  --clickhouse-host clickhouse.example.com \
  --clickhouse-port 9000 \
  --clickhouse-protocol tcp \
  --clickhouse-database analytics \
  --clickhouse-username reader \
  --clickhouse-password secret123 \
  --clickhouse-limit 5000

Using HTTP Transport with OpenAPI

./altinity-mcp \
  --transport http \
  --address 0.0.0.0 \
  --port 8080 \
  --clickhouse-host localhost \
  --openapi http

Using SSE Transport with JWE Authentication and OpenAPI

./altinity-mcp \
  --transport sse \
  --port 8080 \
  --allow-jwe-auth \
  --jwe-secret-key "your-jwe-encryption-secret" \
  --jwt-secret-key "your-jwt-signing-secret" \
  --clickhouse-host localhost \
  --openapi http

Integration Guide

For detailed instructions on integrating Altinity MCP with various AI tools and platforms, see our Integration Guide.

Installation & Deployment

Using Docker

docker run -it --rm ghcr.io/altinity/altinity-mcp:latest --clickhouse-host clickhouse

Kubernetes with Helm

From OCI helm registry (recommended)

# Install from OCI registry
helm install altinity-mcp oci://ghcr.io/altinity/altinity-mcp/helm/altinity-mcp \
  --set config.clickhouse.host=clickhouse.example.com \
  --set config.clickhouse.database=default \
  --set config.clickhouse.limit=5000

From local helm chart

git clone https://github.com/Altinity/altinity-mcp
cd altinity-mcp
helm install altinity-mcp ./helm/altinity-mcp \
  --set config.clickhouse.host=clickhouse-service \
  --set config.clickhouse.database=analytics \
  --set config.server.transport=http \
  --set config.server.port=8080

For detailed Helm chart configuration options, see Helm Chart README.

Docker Compose

version: '3.8'
services:
  altinity-mcp:
    build: .
    ports:
      - "8080:8080"
    environment:
      - CLICKHOUSE_HOST=clickhouse
      - MCP_TRANSPORT=http
      - MCP_PORT=8080
    depends_on:
      - clickhouse
    entrypoint: ["/bin/sh", "-c", "/bin/altinity-mcp"]
  
  clickhouse:
    image: clickhouse/clickhouse-server:latest
    ports:
      - "8123:8123"

From Source

git clone https://github.com/altinity/altinity-mcp.git
cd altinity-mcp
go build -o altinity-mcp ./cmd/altinity-mcp

Configuration

Configuration File

Create a YAML or JSON configuration file:

# config.yaml
clickhouse:
  host: "localhost"
  port: 8123
  database: "default"
  username: "default"
  password: ""
  protocol: "http"
  read_only: false
  max_execution_time: 600
  tls:
    enabled: fa

Tools (3)

list_tablesList all tables available in the ClickHouse database
describe_schemaRetrieve the schema definition for a specific table
execute_queryExecute a SQL query against the ClickHouse database

Environment Variables

CLICKHOUSE_HOSTThe hostname of the ClickHouse server
MCP_TRANSPORTTransport protocol to use (stdio, http, sse)
MCP_PORTPort for HTTP or SSE transport

Configuration

claude_desktop_config.json
{"mcpServers": {"altinity-mcp": {"command": "./altinity-mcp", "args": ["--clickhouse-host", "localhost", "--clickhouse-port", "8123"]}}}

Try it

List all the tables currently available in my ClickHouse database.
Describe the schema for the 'events' table so I can understand its columns.
Run a query to count the number of rows in the 'logs' table for the last 24 hours.
Find the top 10 most active users from the 'user_activity' table using a SQL query.

Frequently Asked Questions

What are the key features of Altinity MCP?

Support for STDIO, HTTP, and SSE transport protocols. OAuth 2.0 and JWE-based authentication support. Automatic generation of MCP tools from ClickHouse views. Dynamic resource discovery for database schemas. TLS encryption for secure database and server connections.

What can I use Altinity MCP for?

Enabling AI agents to perform ad-hoc data analysis on production ClickHouse clusters. Automating schema documentation and exploration for data engineering teams. Building natural language interfaces for internal analytics dashboards. Securely exposing database query capabilities to LLM-powered applications.

How do I install Altinity MCP?

Install Altinity MCP by running: docker run -it --rm ghcr.io/altinity/altinity-mcp:latest --clickhouse-host clickhouse

What MCP clients work with Altinity MCP?

Altinity MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Altinity MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare