loading…
Search for a command to run...
loading…
MCP server for the OrionBelt Semantic Layer. Enables LLMs to explore governed semantic models, compile YAML metric definitions into optimized SQL across 8 engin
MCP server for the OrionBelt Semantic Layer. Enables LLMs to explore governed semantic models, compile YAML metric definitions into optimized SQL across 8 engines (BigQuery, ClickHouse, Databricks, Dremio, DuckDB, MySQL, PostgreSQL, Snowflake), and execute analytics queries via natural language. Works with Claude, Cursor, Windsurf, and Copilot.
Thin MCP server that delegates to the OrionBelt Semantic Layer REST API
Version 2.7.2 OrionBelt Semantic Layer 2.7 Python 3.12+ License: Apache 2.0 FastMCP Pydantic v2 Ruff
BigQuery PostgreSQL Snowflake ClickHouse Dremio Databricks DuckDB MySQL
A thin MCP server that delegates all business logic to the OrionBelt Semantic Layer REST API via HTTP. No embedded engine — pure API pass-through.
The OrionBelt Semantic Layer platform has two deployment modes. This MCP server supports both:
API_BASE_URL.┌────────────┐ ┌──────────────────────────────────────────────────────┐
│ LLM Client │ │ OrionBelt Platform │
│ │ │ │
│ Claude, │──MCP──│──> server.py ──HTTP /v1──> Semantic Layer REST API │
│ Cursor, │ │ (FastMCP (FastAPI: parse OBML, │
│ any MCP │ │ + httpx) validate, compile │
│ client │ │ to SQL) │
└────────────┘ └──────────────────────────────────────────────────────┘
QUERY_EXECUTE=true)
A public demo of the OrionBelt Semantic Layer API is available at:
API endpoint:
https://orionbelt.ralforion.com— Swagger UI | ReDoc | Gradio UI
Set API_BASE_URL=https://orionbelt.ralforion.com in your .env file to use it (see .env.example).
uv sync
For development (includes pytest, respx, ruff):
uv sync --all-groups
uv run server.py
MCP_TRANSPORT=http uv run python server.py
Add to your MCP client config (e.g. claude_desktop_config.json):
{
"mcpServers": {
"orionbelt": {
"command": "uv",
"args": ["run", "python", "server.py"],
"cwd": "/path/to/orionbelt-semantic-layer-mcp"
}
}
}
Environment variables or .env file (pydantic-settings). See .env.example for defaults.
| Variable | Default | Description |
|---|---|---|
API_BASE_URL |
— (required) | OrionBelt Semantic Layer REST API URL |
MCP_TRANSPORT |
stdio |
stdio, http, or sse |
MCP_SERVER_HOST |
localhost |
Bind host for HTTP/SSE |
MCP_SERVER_PORT |
9000 |
Bind port for HTTP/SSE |
LOG_LEVEL |
INFO |
Logging level |
API_TIMEOUT |
30 |
HTTP timeout in seconds |
HEARTBEAT_AUTH_TOKEN |
— | Bearer token forwarded to POST /v1/heartbeat (must match the API's value) |
| MCP Tool | Description |
|---|---|
get_obml_reference() |
Returns the full OBML format specification |
load_model(model, dedup=True) |
Parse, validate, and store a model (returns health + model_load) |
describe_model(model_id) |
Inspect data objects, dimensions, measures, metrics |
remove_model(model_id) |
Remove a model from the current session |
list_models() |
List all models loaded in the current session |
| MCP Tool | Description |
|---|---|
get_model_schema(model_id) |
Full model structure as JSON (detailed) |
list_dimensions(model_id) |
List all dimensions in a model |
get_dimension(model_id, name) |
Get a single dimension by name |
list_measures(model_id) |
List all measures in a model |
get_measure(model_id, name) |
Get a single measure by name |
list_metrics(model_id) |
List all metrics in a model |
get_metric(model_id, name) |
Get a single metric by name |
explain_artefact(model_id, name) |
Explain lineage of a dimension, measure, or metric |
find_artefacts(model_id, query) |
Search artefacts (exact / synonym / fuzzy buckets) |
list_examples(model_id, intent?) |
List authored example queries (filterable by intent tag) |
get_example(model_id, name) |
Get one example with query + compiled SQL preview |
get_join_graph(model_id) |
Return the join graph as an adjacency list |
| MCP Tool | Description |
|---|---|
compile_query(...) |
Compile a semantic query (QueryObject) to SQL |
execute_query(...) |
Compile and execute a QueryObject, returning SQL + rows |
compile_obsql(model_id, sql, ...) |
Compile an OBSQL (natural SQL) query to SQL |
execute_obsql(model_id, sql, ...) |
Compile and execute an OBSQL query, returning SQL + rows |
plan_query(model_id, ...) |
Planner view (no SQL); optional warehouse EXPLAIN |
run_batch(queries, ...) |
One-shot: load a model + run N queries in parallel |
get_model_diagram(model_id) |
Generate a Mermaid ER diagram for a loaded model |
| MCP Tool | Description |
|---|---|
get_graph(model_id) |
Return the model as OBSL-Core RDF (Turtle) |
sparql_query(model_id, query) |
Run a read-only SPARQL query (SELECT / ASK) |
| MCP Tool | Description |
|---|---|
get_cache_stats() |
Cache backend, entry count, hit rate, sweep time |
heartbeat(database, schema, table, ts?) |
Notify the API a table refreshed (invalidates cache) |
| MCP Tool | Description |
|---|---|
get_obml_reference() |
OBML (model authoring) grammar reference |
get_obsql_reference() |
OBSQL (natural SQL surface) grammar reference |
list_references() |
Index of all references published by the API |
get_json_schema(name) |
JSON Schema for obml (model) or query (QueryObject) |
| MCP Tool | Description |
|---|---|
list_dialects() |
List available SQL dialects and capabilities |
get_settings() |
Get API config (modes, TTL, oneshot batch limits) |
convert_osi_to_obml(input_yaml) |
Convert OSI YAML to OBML format |
convert_obml_to_osi(input_yaml) |
Convert OBML YAML to OSI format |
postgres, snowflake, clickhouse, databricks, dremio, bigquery, duckdb
get_obml_reference() to learn OBML syntaxload_model(model_yaml) to get a model_iddescribe_model(model_id) or use discovery tools (list_dimensions, find_artefacts, explain_artefact, etc.)compile_query(model_id, dimensions=[...], measures=[...]) to generate SQLexecute_query(model_id, dimensions=[...], measures=[...]) to run SQL and get results (requires QUERY_EXECUTE=true on the API)Use the OrionBelt Semantic Layer MCP server with popular AI agent frameworks and automation platforms:
| Framework | Transport | Guide |
|---|---|---|
| OpenAI Agents SDK | stdio, HTTP, SSE | docs/integrations/openai-agents-sdk.md |
| LangChain | stdio, HTTP | docs/integrations/langchain.md |
| Google ADK | stdio, HTTP, SSE | docs/integrations/google-adk.md |
| n8n | HTTP, SSE | docs/integrations/n8n.md |
| CrewAI | stdio, HTTP | docs/integrations/crewai.md |
Each guide includes quick-start examples, multi-agent patterns, and connection options for both the hosted demo and self-hosted deployments.
# Run tests
uv run pytest
# Lint
uv run ruff check server.py
uv run ruff format server.py tests/
A public hosted instance of this MCP server runs on Google Cloud Run, connected to the live OrionBelt Semantic Layer demo API. No local install, no API key.
https://orionbelt.ralforion.com/mcp
Streamable HTTP (MCP spec 2025-03-26). Stateful — clients should send the
initialize handshake and reuse the returned Mcp-Session-Id header.
Claude Desktop's config schema accepts only stdio launchers — for a remote
MCP server, use the mcp-remote
stdio↔HTTP bridge (auto-fetched by npx, no manual install).
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
or %APPDATA%\Claude\claude_desktop_config.json (Windows) and add:
{
"mcpServers": {
"orionbelt": {
"command": "npx",
"args": [
"mcp-remote",
"https://orionbelt.ralforion.com/mcp",
"--transport",
"http"
]
}
}
}
Fully quit Claude Desktop (⌘Q on macOS — closing the window isn't enough) and reopen. The OrionBelt tools then appear in the tools menu.
Alternatively, in newer Claude Desktop builds: Settings → Connectors → Add
custom connector, paste the URL above. No file editing or npx required.
Why
mcp-remote? Claude Desktop'sclaude_desktop_config.jsonschema currently only validates stdio entries (command+args). A bare{"url": "…"}entry is rejected with "not valid MCP server configurations and were skipped".mcp-remoteruns a local stdio bridge that forwards to the HTTPS endpoint, so Claude Desktop sees a normal stdio server. Claude Code does support{"type": "url", "url": "…"}natively — see below.
Add to .mcp.json in any repo (or ~/.config/claude-code/.mcp.json globally):
{
"mcpServers": {
"orionbelt": {
"type": "url",
"url": "https://orionbelt.ralforion.com/mcp"
}
}
}
Any client that supports Streamable HTTP transport (MCP spec 2025-03-26) can
point at the URL above. The endpoint accepts POST /mcp with
Accept: application/json, text/event-stream. See
tests/cloudrun/test_mcp_cloudrun.sh
for a stdlib-only Python smoke test that walks the full handshake.
https://orionbelt.ralforion.com — same data,
same dialects, no authentication. Don't load production data through it.Copyright 2025 RALFORION d.o.o.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Выполни в терминале:
claude mcp add orionbelt-semantic-layer-mcp -- npx Query your database in natural language
автор: AnthropicRead-only database access with schema inspection.
автор: modelcontextprotocolInteract with Redis key-value stores.
автор: modelcontextprotocolDatabase interaction and business intelligence capabilities.
автор: modelcontextprotocolНе уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории data