MCP-native · Open Source

Deterministic data access for AI agents.

Use AI for reasoning, not for querying your warehouse. Your data team defines metrics. Your agents just select them. No SQL generation. No hallucinations.

For data teams shipping AI-powered products on Snowflake, Postgres, and ClickHouse.

query_metric("total_revenue")
Validated SELECT only, read-only
PII Masked email → a****@a****.com
Limited LIMIT 100 injected
revenue_usd $4,298.00
2ms 1 row 0 PII exposed

Two ways to give AI agents access to data

What everyone else is doing

Probabilistic data access

User / Agent
LLM
Inject Context
  • schemas
  • docs
  • lineage
  • embeddings
Generates SQL guess
Database
Result maybe correct

More context = better guesses

Still guessing.

OnlyMetrix

Deterministic data access

User / Agent
Selects Metric
Pre-defined Metric
  • SQL written by data team
  • tested
  • versioned
Database
Deterministic Result

No SQL generation

No ambiguity

Same input. Same output. Every time.

Don't help AI guess your data. Remove the guess.

AI agents shouldn't be writing SQL

Every team building AI agents hits the same wall:

  • How do you let agents query production data safely?
  • How do you prevent bad joins or wrong metrics?
  • How do you audit what actually ran?

Today's solutions rely on:

  • prompt engineering
  • schema injection
  • "context layers"

They make guessing better. They don't remove the risk.

3 agents, 1 question
Agent A "Revenue is $1.2M"
Agent B "Revenue is $1.4M"
Agent C "Revenue is $980K"

Metrics, not queries

OnlyMetrix replaces query generation with metric selection. Define metrics once. Agents can only run what's approved.

01

Define metrics

YAML or Python. Versioned and tested. Written by your data team, not generated by an LLM.

02

Connect your warehouse

Snowflake, Postgres, ClickHouse. One command. Tested before saved.

03

Let agents query safely

3 lines of code. No raw SQL access. Same input, same output, every time.

Deterministic

Same metric, same filters, same result. Every time.

Auditable

Know exactly what ran and why. Every query logged.

Safe by default

Agents cannot access undefined data. PII masking on every query.

Built for production

No prompt hacks. No hidden behavior. Rust core, sub-millisecond overhead.

Works With Your Stack

Connect your warehouse, install the SDK, or deploy as an MCP server. OnlyMetrix fits where you already are.

Snowflake

live

Native Snowflake connector with session management and token refresh

PostgreSQL

live

Connection pooling, read-only enforcement, statement timeouts

ClickHouse

live

HTTP API integration with secure and standard modes

Python SDK

live

pip install onlymetrix - query metrics from any Python app

MCP Protocol

live

Connect any MCP-compatible agent - Claude, GPT, custom agents

dbt

live

Sync metric definitions and column descriptions from dbt manifests

Use AI where it works.
Not where it breaks.

LLMs are great at
  • Reasoning
  • Planning
  • Summarizing
  • Natural language understanding
They are not reliable at
  • Writing correct SQL
  • Understanding your schema
  • Enforcing business definitions
  • Producing consistent results

OnlyMetrix keeps AI in the loop. Just not in control of your data layer.

A Peek at How Agents See Your Data

You define the metric. Agents query it. They never see the SQL.

config/metrics.yaml
metrics:
  - name: total_revenue
    description: "Total paid revenue in USD"
    sql: |
      SELECT SUM(total_cents) / 100.0
        AS revenue_usd
      FROM orders
      WHERE status = 2
    filters:
      - column: month
        type: date
      - column: region
        type: text
    tags: [finance, revenue]

  # Agents call query_metric("total_revenue")
  # and get back: revenue_usd = 4298.00

Agents never see the raw SQL

They only query the metrics you define. Filter values are type-checked and injected safely. No SQL injection, no schema leaks.

Agent Response
Metric total_revenue
Revenue (USD) $4,298.00
Filters Applied none
Execution 2ms
PII Columns Masked 0

Stop letting AI guess your data.

Define your first metric. Connect your warehouse. Let agents query safely.