Give AI agents your Python ClickHouse datasets, not a SQL console

Define datasets in Python and run hypequery mcp app:api. Agents get exactly the endpoints the caller may call, so Claude and Cursor query governed measures while SQL, credentials, and the tenant stay in your Python process.

Agent surface

Authorized endpoints only

SQL and credentials

Stay in Python

Works with

Claude, Cursor, MCP clients

A SQL tool hands the model your database

Generic ClickHouse MCP servers let the agent pick tables, joins, and result sizes. A prompt is not a permission system.

Agents invent their own revenue

When the agent writes its own query, its number disagrees with your dashboard. The definition has to be shared, not re-derived.

Python teams were left out

Most semantic-layer MCP servers expect a Node or YAML project. Your analytics already live in a Python service.

Client contract

Publish what agents may call

Install dataset endpoints with a client profile and add the client-contract route. The contract lists each endpoint’s fields, operators, and limits for the calling principal, and nothing else.

  • Agents see only endpoints the API key’s principal is allowed to call
  • The tenant comes from that principal on the Python side; the agent cannot choose it
  • Fields, filters, and limits are validated by Python before any SQL runs
  • Every tool call runs through Api.handle, so auth, endpoint policy and rate limits apply exactly as they do over HTTP

api.py

Dataset endpoints plus live discovery

analytics/api.py
from hypequery.serve import (
    EndpointPolicy, add_client_contract_endpoint, add_dataset_endpoint,
    create_api,
)

policy = EndpointPolicy(
    tenant="required", required_scopes=frozenset({"analytics:read"})
)
api = create_api(auth=authenticate)

add_dataset_endpoint(
    api,
    "/v1/orders",
    dataset=orders,
    client=client,
    policy=policy,
    client_profile=profile,
)
# The authorized catalog hypequery mcp serves to agents
add_client_contract_endpoint(api, "/v1/client-contract", policy=policy)

The same endpoints your React app calls. No separate agent backend.

MCP server

Run hypequery mcp on your API

The Python CLI serves your API's authorized client contract to agents, over stdio or, with --http, at a URL. No Node process and no separate agent backend.

app:api is the Api from create_api. Each tool call goes through it in the same process, so authentication, endpoint policy, rate limits and tenant resolution are the ones an HTTP caller meets.

API already deployed? hypequery mcp --client-contract-url bridges it over HTTPS instead, with the same tools. Agents get list_datasets, get_dataset_schema, and query_dataset, and never write or receive SQL.

terminal

Serve it to an agent

terminal
pip install "hypequery[mcp]"

# The credential the server calls your API with: one principal, one tenant
export HYPEQUERY_API_KEY=…

# Check the setup without calling any query tool
hypequery mcp app:api --self-test

# Print the entry for Claude Desktop or Cursor
hypequery mcp app:api --print-config

# Or serve it at a URL for your team, behind a shared key.
# Keep the key: clients send it as "Authorization: Bearer <key>".
export HYPEQUERY_MCP_KEY=$(openssl rand -hex 32)
hypequery mcp app:api --http

Paste the printed entry into Claude Desktop or Cursor, or connect a client to the --http URL.

Where teams usually get stuck

Questions teams ask

ClickHouse MCP server for Python

Use your existing Python service as the MCP backend instead of exposing ClickHouse directly.

Semantic layer for AI agents in Python

Agents query named measures and dimensions from your datasets, so their numbers match your product.

Multi-tenant MCP

Over stdio the server acts as one principal and its tenant. Over HTTP with your app’s auth or OAuth, each caller’s tenant comes from their own credential.

Native Python MCP server

Yes: hypequery mcp app:api runs in your Python process. Python keeps ownership of SQL, auth, and tenancy.

Next step

Connect one dataset to your first agent

Add a client contract route to your API, then run hypequery mcp app:api --self-test.

Open source, and it runs in your own backend. Want it hosted?

Get early access to hypequery cloud.

Cloud hosts the same model you run in your backend, with a managed API and MCP server, versions, and rollback. We're letting teams in a few at a time. Join the waitlist and we'll reach out when your project can go live.

How do you want to build your analytics layer? (Optional)
What features do you most need? (Optional)

Pick as many as you like.

Only your email is required. All other questions are optional.