# orionbelt-semantic-layer

MCP server that compiles YAML models into SQL for BigQuery, Snowflake, DuckDB and five more dialects. An agent defines metrics and dimensions once, then asks questions in plain language.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 101
- Author: ralforion
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ralforion/orionbelt-semantic-layer
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/orionbelt-semantic-layer

## What it does

You define dimensions, measures and metrics in YAML. OrionBelt translates them into dialect-specific SQL through an AST. Supports BigQuery, ClickHouse, Databricks, Dremio, DuckDB, MotherDuck, MySQL, PostgreSQL and Snowflake. An agent can send a throwaway model and multiple queries in one `/v1/oneshot/batch` call: the server validates the YAML, runs the queries and returns results with explanations and warnings.

The server exposes PostgreSQL wire, Arrow Flight SQL, REST and MCP interfaces. Fixed grain (`grain: {mode: FIXED}`) pins a measure's aggregation level independently of the query grain — it becomes `OVER (PARTITION BY ...)` in the compiled SQL.

Requires Python 3.12 or later and `uvx` for installation. Licensed under BUSL-1.1.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Works with: Snowflake

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add orionbelt-semantic-layer -- uvx orionbelt-semantic-layer
```
uvx runs the command named after the package; if the README names another one, use uvx --from orionbelt-semantic-layer <command>

### Codex

**Platform CLI**
```bash
codex mcp add orionbelt-semantic-layer -- uvx orionbelt-semantic-layer
```
uvx runs the command named after the package; if the README names another one, use uvx --from orionbelt-semantic-layer <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "orionbelt-semantic-layer": {
            "command": "uvx",
            "args": [
                "orionbelt-semantic-layer"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from orionbelt-semantic-layer <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "orionbelt-semantic-layer": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "orionbelt-semantic-layer"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from orionbelt-semantic-layer <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add orionbelt-semantic-layer uvx orionbelt-semantic-layer
```
uvx runs the command named after the package; if the README names another one, use uvx --from orionbelt-semantic-layer <command>

## When to use it
- Compile a YAML model into SQL for nine dialects
- Set fixed aggregation grain for a metric
- Send multiple queries with a temporary model in one call
- Connect a BI tool via PostgreSQL wire or Arrow Flight SQL

## Example prompts
- Compile YAML model `tpcds.obml.yml` and query `Q98.yml` to DuckDB SQL
- Run a query: revenue by country and average order value for February
- Load model `sales_model.obml.yml` and list all measures

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
