# orionbelt-analytics [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/ralfbecher/orionbelt-analytics  
**GitHub Stars:** 60  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/orionbelt-analytics

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

## Tools
Capabilities this server exposes over MCP:

- **connect_database** — Connect to any supported database using `.env` credentials
- **list_databases** — List the databases configured on the server, by name and description
- **list_schemas** — List available schemas in the connected database
- **reset_cache** — Clear cached schema and ontology data for the current session
- **discover_schema** — Analyze schema structure with automatic GraphRAG + ontology generation
- **get_table_details** — Get detailed column, key, and constraint info for a specific table
- **cleanup_workspace** — Delete all workspace files for the current connection and start fresh
- **generate_ontology** — Generate RDF/OWL ontology from schema with SQL mapping annotations
- **suggest_semantic_names** — Detect abbreviations and cryptic names for business-friendly renaming
- **apply_semantic_names** — Apply LLM-suggested semantic names and descriptions to ontology
- **load_my_ontology** — Load a custom `.ttl` ontology file from an import folder
- **validate_relationship** — Check a relationship against the data and record the verdict in the ontology
- **confirm_join** — Link a column to another table's key once the data confirms it on all rows
- **review_ontology** — Mark tables, columns and relationships reviewed or rejected by a person
- **download_artifact** — Download ontology or R2RML mapping as a Turtle file
- **sample_table_data** — Preview table data with row limit and injection protection
- **execute_sql_query** — Execute SQL with OBQC validation, security checks, and fan-trap detection
- **generate_chart** — Generate Plotly charts (bar, line, scatter, heatmap) with MCP-UI rendering
- **graphrag_search** — Semantic search + schema overview (auto-initialized by `discover_schema`)
- **graphrag_query_context** — Get optimized context for SQL generation (85-95% token reduction)
- **graphrag_find_join_path** — Discover join paths between tables via graph traversal
- **reachable_from** — Dimension-capable tables for an anchor grain (many-to-one closure)
- **measurable_from** — Measure-capable tables for an anchor grain (one-to-many closure)
- **plan_composite_query** — Advise a fan-trap-safe Composite Fact Layer (UNION ALL) decomposition
- **store_ontology_in_rdf** — Persist ontology in Oxigraph for SPARQL access
- **query_sparql** — Execute SPARQL queries (SELECT, ASK, CONSTRUCT — auto-detected)
- **add_rdf_knowledge** — Add custom metadata triples to the RDF store
- **save_semantic_model** — Save a semantic model (e.g., OBML YAML) to the workspace
- **get_semantic_model** — Retrieve a stored semantic model by name
- **list_semantic_models** — List all stored semantic models for the current connection

## Claude Desktop Quick Installation
No confirmed install details yet, so no config is published. Follow the setup steps in the repository above.

## Documentation

## What orionbelt-analytics does

orionbelt-analytics connects MCP-compatible AI clients to relational database systems and turns database structure into queryable semantic context. It can inspect schemas, tables, columns, keys, and constraints; generate RDF/OWL ontologies with SQL mapping annotations; and preserve ontology, GraphRAG, and workspace state for a database connection.

The server supports PostgreSQL, MySQL, Snowflake, ClickHouse, Dremio, BigQuery, DuckDB/MotherDuck, and Databricks SQL. Multiple schemas can be analyzed together while keeping ontology and GraphRAG state isolated per schema. Custom Turtle ontologies can also be loaded from the import workspace.

## How it works

Database credentials are read from `.env` configuration, after which `connect_database` establishes a connection and the discovery tools inspect its schemas. `discover_schema` builds schema context using graph traversal and local ChromaDB vector embeddings, while `generate_ontology` produces RDF/OWL representations with `oba:` SQL annotations and R2RML mappings.

GraphRAG tools support semantic schema search, optimized context retrieval for SQL generation, and join-path discovery. The graph traversal can span up to 12 hops. `reachable_from`, `measurable_from`, and `plan_composite_query` help reason about table grain, measures, dimensions, and fan-trap-safe query decomposition.

Before `execute_sql_query` sends a statement to the database, OBQC parses it with sqlglot and checks it against the ontology. Validation covers table and column references, joins, data types, aggregation rules, and fan-trap conditions. Errors prevent execution; warnings and informational findings accompany successful results.

The RDF state can be persisted in Oxigraph and queried with SPARQL. Semantic models can be saved and retrieved in the workspace, while ontology and R2RML artifacts can be downloaded as Turtle files. Chart requests produce Plotly visualizations with MCP-UI rendering in Claude Desktop.

## Setup and configuration

The repository requires Python 3.13 or newer and `uv`. A typical local setup clones the repository, enters its directory, and runs `uv sync`. Copy `.env.template` to `.env`, then add credentials for at least one supported database. PostgreSQL configuration uses host, port, database, username, and password variables; other database connectors have their own environment settings.

Run the server through an MCP-compatible client after configuring the connection. Workspace persistence allows a later connection to restore the prior session. Transport options and connector-specific settings are configured through the project’s environment configuration.

## Tools and capabilities

- Connect to configured databases and list available databases or schemas.
- Inspect table definitions, sample protected data, and cached discovery state.
- Generate, load, update, validate, store, query, and download RDF/OWL ontology artifacts.
- Search schema context semantically and find table relationships through graph traversal.
- Execute SQL with deterministic structural checks and fan-trap detection.
- Generate bar, line, scatter, and heatmap charts through Plotly.
- Save, retrieve, and list semantic models for the active connection.

Semantic-name suggestions can identify abbreviations and cryptic identifiers. When the host supports MCP sampling, the server can ask the host LLM to pre-fill rename suggestions; clients without sampling use the manual review path.

## Limitations and notes

OBQC validates SQL structure against the loaded ontology, so ontology generation or loading is part of the safe query workflow. It is a deterministic rule system rather than an LLM reasoning layer. Database access still depends on valid credentials and connector configuration.

MCP sampling is optional and client-dependent. Interactive chart rendering through MCP-UI is described for Claude Desktop. The GraphRAG embeddings run locally, and a multilingual embedding option supports questions in languages other than the schema’s language.

_Full upstream README: https://allmcps.com/mcp/orionbelt-analytics/readme_

