Skip to content

Foggy Data MCPAI-Native Semantic Layer Framework

Enable AI assistants to query business data safely and accurately through MCP protocol — without exposing database schemas

54+Built-in Functions
20+Query Operators
5Database Dialects
2Language SDKs

Why a Semantic Layer?

Letting AI write SQL directly against your database is risky and unreliable

❌ AI Writes SQL Directly

  • AI may generate DELETE / UPDATE statements
  • Must expose full database schema to AI
  • What does order_status=3 mean? AI doesn't know
  • Multi-table JOINs are fragile and error-prone
  • Different databases require different SQL dialects

✅ Semantic Layer + DSL Query

  • Read-only DSL design eliminates dangerous operations
  • AI only sees business semantics, not table structures
  • Semantic layer defines field meanings and relationships
  • Engine auto-handles JOINs and aggregations
  • One DSL works across all database dialects
            AI Assistant (Claude / Cursor / Trae)

                   MCP Protocol


┌─────────────────────────────────────────────┐
│            Foggy MCP Server                 │
│  ┌───────────┐  ┌──────────┐  ┌──────────┐ │
│  │  Metadata  │  │  Query   │  │  Chart   │ │
│  │   Tool     │  │  Tool    │  │  Tool    │ │
│  └───────────┘  └──────────┘  └──────────┘ │
└─────────────────────┬───────────────────────┘


┌─────────────────────────────────────────────┐
│         Semantic Layer Engine                │
│                                             │
│  TM Model ──→ Dims/Measures ──→ QM Model    │
│                                             │
│  ┌──────────┐ ┌──────────┐ ┌─────────────┐ │
│  │DSL Parser │ │  Access  │ │ Dialect SQL │ │
│  │          │ │  Control │ │ Generator   │ │
│  └──────────┘ └──────────┘ └─────────────┘ │
└─────────────────────┬───────────────────────┘

         ┌────────────┼────────────┐
         ▼            ▼            ▼
      MySQL      PostgreSQL    SQL Server ...

Three Core Capabilities

SEMANTIC LAYER

🧠 Semantic Modeling

QUERY DSL

🔍 DSL Query

MCP TOOLS

🤖 MCP Tools

DSL Query Example

AI sends JSON DSL → Semantic layer translates to safe SQL

JSON DSL Input
json
{
  "model": "FactSalesQueryModel",
  "columns": [
    "customer$name",
    "product$categoryName",
    "sum(totalAmount)"
  ],
  "filters": [
    { "field": "orderDate", "op": ">=",
      "value": "2024-01-01" },
    { "field": "product$categoryName",
      "op": "in",
      "value": ["Electronics", "Books"] }
  ],
  "orderBy": [
    { "field": "totalAmount", "dir": "DESC" }
  ],
  "limit": 10
}
Generated SQL (MySQL Dialect)
sql
SELECT
  c.name         AS `customer$name`,
  p.category_name AS `product$categoryName`,
  SUM(f.total_amount) AS `totalAmount`
FROM fact_sales f
  JOIN dim_customer c
    ON f.customer_id = c.id
  JOIN dim_product p
    ON f.product_id = p.id
WHERE f.order_date >= '2024-01-01'
  AND p.category_name IN
      ('Electronics', 'Books')
GROUP BY c.name, p.category_name
ORDER BY SUM(f.total_amount) DESC
LIMIT 10

Get Started in 3 Steps

1

Start the Server

docker compose up -d
One-click launch with MySQL + Foggy MCP Server + demo data

2

Configure AI Tool

Add MCP Server URL in Claude Desktop / Cursor:
http://localhost:7108/mcp/analyst/rpc

3

Start Querying

Ask in natural language:
"Show me sales trends by brand for last week"

Multi-Language Implementations

Java and Python dual engines, same semantic layer standard

Start Building AI Data Queries

Deploy a semantic layer in 5 minutes. Let AI query your business data safely.