Orionbelt Analytics

io.github.ralfbecher由 GitHub 帳號 ralfbecher 發布v0.5.0更新於 Oct 24, 2026

Ontology-based MCP server for database schema analysis and RDF/OWL ontology generation

概覽

AI 產生的概覽

以本體為基礎的 MCP 伺服器,可分析關聯式資料庫結構、產生 RDF/OWL 本體,並執行經檢核的 Text-to-SQL 與圖表輸出。

可以做什麼
  • 連線與檢視資料庫:連線資料庫、列出資料庫與 schema、探索結構、取得資料表細節、清除快取與工作區
  • 建立與管理本體:產生含 SQL 對應的 RDF/OWL 本體、建議並套用語意命名、載入自訂 Turtle 檔、驗證關聯、下載本體或 R2RML 檔
  • 查詢與視覺化:取樣資料表資料、執行含確定性本體檢核與扇出陷阱偵測的 SQL、產生 Plotly 圖表
  • 以 GraphRAG 探索結構:語意搜尋、精簡的 SQL 上下文、聯結路徑探索、可達性與量值規劃
  • 處理 RDF:將本體存入 Oxigraph、執行 SPARQL 查詢、加入中繼資料三元組
  • 管理語意模型:依連線儲存、讀取與列出語意模型
適用情境
適合需要讓助理探索不熟悉的關聯式資料庫、產出可重用的本體或語意模型,或產生在執行前先依結構檢核的 SQL 的情境。也適合希望在 MCP 用戶端內取得防扇出聚合與圖表輸出的團隊。
執行需求
以本機 Python 套件執行(README 要求 Python 3.13+ 與 uv)。資料庫憑證透過 .env 檔提供,例如 POSTGRES_HOST、POSTGRES_PORT、POSTGRES_DATABASE、POSTGRES_USERNAME、POSTGRES_PASSWORD。伺服器在本機 HTTP 埠(MCP_SERVER_PORT)監聽供用戶端連線,並需能連上目標資料庫。
安裝前請注意
伺服器保存 .env 中的資料庫憑證,並可對已連線的資料庫執行 SQL,建議使用唯讀帳號。相關工具會寫入工作區檔案、在本機 RDF 儲存中保存本體,並可透過 cleanup_workspace 刪除工作區資料。結構中繼資料與取樣資料會傳送給所連線的 AI 用戶端,選用的 MCP sampling 會把識別字命名建議交給宿主模型處理。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Orionbelt Analytics,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[OrionBelt Logo]

OrionBelt® Analytics

The Ontology-based MCP server for your Text-2-SQL convenience.

[Version 2.2.2] [Python 3.13+] [License: BUSL-1.1] [FastMCP 4.0.5+] [RDF/OWL]

[BigQuery] [PostgreSQL] [Snowflake] [ClickHouse] [Dremio] [Databricks] [DuckDB] [MySQL]

[Docker Hub] [Docker pulls] [Image size]

OrionBelt Analytics is an MCP server that analyzes relational database schemas and generates RDF/OWL ontologies with embedded SQL mappings. It provides relationship-aware Text-to-SQL with automatic fan-trap prevention, GraphRAG for intelligent schema discovery, and interactive charting -- all accessible through any MCP-compatible AI client.

The OrionBelt Ecosystem

ProjectPurpose
OrionBelt Analytics (this)Schema analysis, ontology generation, GraphRAG, Text-to-SQL
OrionBelt Semantic LayerDeclarative YAML models compiled into dialect-specific, fan-trap-free SQL
OrionBelt Ontology BuilderVisual OWL ontology editor with reasoning and graph visualization (live demo)
OrionBelt ChatAI chat UI for Analytics + Semantic Layer (Chainlit, multiple LLM providers)

Run Analytics and Semantic Layer side-by-side in Claude Desktop for schema-aware ontology generation and guaranteed-correct SQL compilation.

Architecture

[OrionBelt Analytics Architecture]

  • 8 database connectors -- PostgreSQL, MySQL, Snowflake, ClickHouse, Dremio, BigQuery, DuckDB/MotherDuck, Databricks SQL
  • RDF/OWL ontology generation with oba: namespace SQL annotations and W3C R2RML mappings
  • GraphRAG -- graph traversal (up to 12 hops) + ChromaDB vector embeddings for semantic schema discovery, run locally; a multilingual option lets questions in other languages find the schema (German "Umsatz" finds a column named "Net revenue")
  • SPARQL 1.1 query interface via persistent Oxigraph RDF store
  • OBQC validation -- deterministic SQL checks against the ontology (table/column existence, join validity, type mismatches, fan-traps)
  • Interactive charting -- Plotly charts with MCP-UI rendering in Claude Desktop
  • Multi-schema support -- analyze multiple schemas simultaneously; ontology and GraphRAG state are isolated per schema
  • Workspace persistence -- reconnect to the same database and restore your previous session
  • MCP sampling -- when the connected client supports sampling (e.g. OrionBelt Chat), suggest_semantic_names asks the host LLM to pre-fill rename suggestions for cryptic identifiers via sampling/createMessage, collapsing the previous review-then-apply flow into a single tool call. Clients without sampling support (e.g. Claude Desktop) silently fall back to the manual review path

OBQC -- Ontology-Based Query Check

A key differentiator of OrionBelt is OBQC (Ontology-Based Query Check), a deterministic, rule-based SQL validator that catches errors before queries reach the database. Unlike LLM-only approaches that rely on the model "getting it right," OBQC cross-references every generated SQL statement against the loaded RDF/OWL ontology to enforce structural correctness.

What OBQC validates:

CheckWhat it catches
Table existenceReferences to tables that don't exist in the schema
Column existenceReferences to columns not present in their table, ambiguous unqualified columns
Join validityMissing join conditions (Cartesian products), join columns that don't match declared foreign keys
Type compatibilityWHERE/ON comparisons between incompatible types (e.g. string vs. integer)
Aggregation correctnessSELECT columns missing from GROUP BY when aggregates are used
Fan-trap detectionAggregations across multiple one-to-many joins that silently multiply results

How it works:

  1. generate_ontology or load_my_ontology creates/loads an ontology with oba: namespace annotations that map OWL classes and properties to actual database tables, columns, types, and foreign keys.
  2. When execute_sql_query is called, OBQC parses the SQL with sqlglot and validates every table, column, join, and aggregation against the ontology's schema model.
  3. Issues are returned with severity levels (error, warning, info) alongside the query results, so the LLM can self-correct before the user sees wrong data.

OBQC is fully deterministic -- no LLM calls, no probabilistic reasoning. It acts as a safety net that complements the LLM's SQL generation with hard structural guarantees. Errors block query execution; warnings are attached to the response for the LLM to act on. See OBQC documentation for the full rule reference, severity behavior, and annotation requirements.

Quick Start

1. Install

bash
git clone https://github.com/ralforion/orionbelt-analyticscd orionbelt-analyticsuv sync

Requires Python 3.13+ and uv.

2. Configure

bash
cp .env.template .env

Edit .env with your database credentials. At minimum, set the variables for one database (e.g. POSTGRES_HOST, POSTGRES_PORT, POSTGRES_DATABASE, POSTGRES_USERNAME, POSTGRES_PASSWORD).

See docs/configuration.md for all environment variables, transport options, and troubleshooting.

3. Run

bash
uv run server.py

The server starts on http://localhost:9000 (HTTP transport, configurable via MCP_SERVER_PORT).

Connect Your AI Client

Claude Desktop

Start the server, then add to your claude_desktop_config.json:

json
{  "mcpServers": {    "OrionBelt-Analytics": {      "command": "npx",      "args": [        "mcp-remote",        "http://localhost:9000/mcp",        "--transport",        "http-only"      ]    }  }}

Claude Code

bash
claude mcp add orionbelt-analytics http://localhost:9000/mcp

LibreChat

Add to librechat.yaml:

yaml
mcpServers:  OrionBelt-Analytics:    type: streamable-http    url: "http://host.docker.internal:9000/mcp"    timeout: 60000    startup: true

Other Frameworks

OrionBelt works with LangChain, OpenAI Agents SDK, CrewAI, Google ADK, Vercel AI SDK, n8n, and ChatGPT Custom GPTs. See docs/integrations.md for setup examples.

Tools

OrionBelt exposes 26 MCP tools. Here is a summary by category:

Connection & Schema

ToolDescription
connect_databaseConnect to any supported database using .env credentials
list_databasesList the databases configured on the server, by name and description
list_schemasList available schemas in the connected database
reset_cacheClear cached schema and ontology data for the current session
discover_schemaAnalyze schema structure with automatic GraphRAG + ontology generation
get_table_detailsGet detailed column, key, and constraint info for a specific table
cleanup_workspaceDelete all workspace files for the current connection and start fresh

Ontology & Semantic

ToolDescription
generate_ontologyGenerate RDF/OWL ontology from schema with SQL mapping annotations
suggest_semantic_namesDetect abbreviations and cryptic names for business-friendly renaming
apply_semantic_namesApply LLM-suggested semantic names and descriptions to ontology
load_my_ontologyLoad a custom .ttl ontology file from an import folder
validate_relationshipCheck a relationship against the data and record the verdict in the ontology
download_artifactDownload ontology or R2RML mapping as a Turtle file

Query & Visualization

ToolDescription
sample_table_dataPreview table data with row limit and injection protection
execute_sql_queryExecute SQL with OBQC validation, security checks, and fan-trap detection
generate_chartGenerate Plotly charts (bar, line, scatter, heatmap) with MCP-UI rendering

GraphRAG

ToolDescription
graphrag_searchSemantic search + schema overview (auto-initialized by discover_schema)
graphrag_query_contextGet optimized context for SQL generation (85-95% token reduction)
graphrag_find_join_pathDiscover join paths between tables via graph traversal
reachable_fromDimension-capable tables for an anchor grain (many-to-one closure)
measurable_fromMeasure-capable tables for an anchor grain (one-to-many closure)
plan_composite_queryAdvise a fan-trap-safe Composite Fact Layer (UNION ALL) decomposition

SPARQL & RDF

ToolDescription
store_ontology_in_rdfPersist ontology in Oxigraph for SPARQL access
query_sparqlExecute SPARQL queries (SELECT, ASK, CONSTRUCT — auto-detected)
add_rdf_knowledgeAdd custom metadata triples to the RDF store

Semantic Models

ToolDescription
save_semantic_modelSave a semantic model (e.g., OBML YAML) to the workspace
get_semantic_modelRetrieve a stored semantic model by name
list_semantic_modelsList all stored semantic models for the current connection

For full parameter details, return values, and examples, see docs/tools-reference.md.

Typical Workflows

Full analysis session:

connect_database("postgresql") -> discover_schema("public") -> generate_ontology() -> execute_sql_query(...)

Quick data exploration:

connect_database("duckdb") -> list_schemas() -> sample_table_data("events")

Query with visualization:

execute_sql_query(query) -> generate_chart(data, "bar", ...)

execute_sql_query runs OBQC validation, security checks, and fan-trap detection before executing — no separate validation step is needed.

Resume a previous session (auto-restores workspace):

connect_database("postgresql") -> execute_sql_query(...)

Development

uv sync installs everything; uv run pytest, black/isort/ruff and strict mypy are the gates. The Development guide has the full setup, project layout, and contribution checklist.

One thing worth knowing before you open a workflow file: every GitHub Action is pinned to a 40-character commit SHA carrying a # vX.Y.Z comment, which is why they are full of hex. A git tag is a movable label, so actions/checkout@v7 runs whatever commit that label points at when the job starts; a SHA cannot move. The comments name exact patch releases rather than # v7, because a major tag moves with every upstream release. ./scripts/check-action-pins.sh resolves each tag upstream and fails when the commit it names is not the one pinned -- which is the only thing that distinguishes a real bump from a hash quietly swapped for one taken from a fork. It runs as the pins job on every pull request and as the first step of both publishing workflows; --offline skips the upstream lookups and checks only the SHA and comment format.

Documentation

DocumentContents
Tools ReferenceFull parameter docs, return values, and usage examples
ConfigurationEnvironment variables, transport setup, troubleshooting
GraphRAGGraph-based schema intelligence and OBML workflow
OBQC OverviewShort explanation of how OBQC works inside OrionBelt Analytics
OBQCValidation rules, severity levels, blocking behavior, annotation requirements
Fan-Trap PreventionThe fan-trap problem, detection, and safe SQL patterns
IntegrationsLangChain, OpenAI, CrewAI, Google ADK, Vercel, n8n, ChatGPT
DevelopmentProject structure, testing, contributing

License

Copyright 2025-2026 RALFORION d.o.o.

Licensed under the Business Source License 1.1. The Licensed Work will convert to Apache License 2.0 on 2030-03-16.

By contributing to this project, you agree to the Contributor License Agreement.

For commercial licensing inquiries, contact: [email protected]

Third-party software

OrionBelt Analytics builds on open source. THIRD_PARTY_NOTICES.md lists every bundled dependency with its licence, and calls out the few that carry obligations beyond attribution (psycopg2's LGPL, wordfreq's CC-BY-SA data, the MPL-2.0 components).

The Docker image redistributes those packages, so it ships their verbatim licence texts at /app/licenses/THIRD_PARTY_LICENSES.txt, alongside the Debian copyright files under /usr/share/doc/. The PyPI wheel bundles nothing third-party — it declares its dependencies and the installer fetches them from PyPI.


[RALFORION d.o.o.]

Copyright © 2026 RALFORION d.o.o.
OrionBelt® is a registered trademark of RALFORION d.o.o.

來源:README.md,提交 bf65b12

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.5.0最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。