semlayer MCP server
Enables export of the inferred semantic layer to dbt YAML format for integration into dbt projects.
Allows the server to connect to DuckDB warehouses (including Iceberg on S3) for schema inference and semantic layer generation.
Allows the server to connect to Snowflake warehouses, infer schema, foreign keys, business rules, and generate a semantic layer.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@semlayer MCP serverWhat was our revenue last month, excluding cancelled orders?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
semlayer
The semantic layer that infers itself — skip the quarter of hand-writing dbt YAML. Fair Source (FSL-1.1-ALv2); the format and its schemas are Apache-2.0.
Point it at your warehouse. It profiles every column, discovers the foreign keys nobody declared, decodes the status columns, finds the business rules hiding in your aggregate tables, and writes the whole thing down as a portable semantic layer in an openly licensed format — with confidence, provenance, and lifecycle on every single claim — ready for any AI agent to consume over MCP.
pip install -e ".[warehouses]"
semlayer init snowflake # generates the minimal-grant setup script
semlayer infer snowflake -o layer.yaml \
--context ./docs/ --context ./etl-repo/CLAUDE.md # optional: your wikis/dictionaries as priors
semlayer review layer.yaml # accept/reject what the engine inferred
semlayer mcp layer.yaml # serve it to Claude, Cursor, or any MCP client
semlayer lint layer.yaml query.sql # check any SQL (yours or an agent's) against the layer
semlayer drift layer.yaml snowflake # catch schema changes (cron- and CI-friendly)Why
AI agents fail on real warehouses: frontier models solved just 21.3% of Spider 2.0's enterprise-warehouse tasks at publication (vs ~91% on the earlier academic Spider 1.0) — and even today's best agentic scaffolds only reach ~30%. The fix is a semantic layer — but every existing tool (dbt, LookML, Cube, Snowflake semantic views) makes humans write it by hand, and it goes stale the day someone runs an ALTER TABLE.
On our messy-warehouse benchmark (cryptic names, zero declared constraints, hidden business rules), an agent using the inferred layer answers 87% of business questions correctly vs 42% from the raw schema (+107% relative), 89% when it also runs the layer's SQL linter — and the errors it fixes are the silent kind: raw-schema "total revenue" happily sums cancelled orders; a fan-out join quietly triples a total. Full benchmark, methodology changes included, and where we DON'T help →
Related MCP server: Alma Atlas
What gets inferred
Examples from the test suite | |
Semantic types + roles |
|
Keys & joins | 104/104 undeclared FKs on TPC-DS-style naming, F1 = 1.0 on our messy fixture — with zero of the seeded false-FK traps accepted (statistics alone never auto-include; naming + LLM must corroborate) |
Enum decodes |
|
Business rules | "these aggregate tables reconcile only when |
Grain, SCD2, ratios | "one row per ord_id"; |
SQL linting |
|
Metrics, routing, deprecation | revenue/count metrics with contract-legal filters; "use |
Descriptions | every table + column, LLM-written from evidence via join-graph context propagation, judged 0.82–0.89 correct+useful by an independent model |
Your docs as priors |
|
Everything lands with confidence (calibrated, with the misses published), provenance (which signals produced it), and lifecycle (inferred → reviewed → certified, plus deprecated/orphaned), governed by a normative consumer contract that makes silent misuse — summing across a fan-out, joining SCD2 at current-row, filtering on guessed decodes — non-conforming, not merely unwise.
Cost & privacy
~$0.70 per 100 tables end-to-end on the cheap model tier, with your own API key (measured cost model). LLM calls are escalation-only; ~80% of columns resolve from statistics alone.
--no-llm: fully deterministic mode, zero API calls, still useful (0.780 typing / 0.834 role across 7 fixtures, against 0.809 / 0.838 with the model) — for orgs where LLM access needs procurement.--no-sample-egress: no value read from a warehouse cell is sent to the LLM, at no net accuracy cost across our 7 fixtures (0.809 typing / 0.842 role, versus 0.809 / 0.838 with samples). Per warehouse it trades rather than being uniformly free — up to a point better or worse. Re-measured 2026-10-03; see docs/cost-model.md.Read-only, minimal-grant:
semlayer initgenerates the grant script; the reader persona is proved unable to write — on PostgreSQL by a test that runs in ordinary CI against a real server (tests/test_postgres.py, no credentials needed), and on Snowflake by a live suite runnable against your own account (tests/test_snowflake_live.py).Telemetry: anonymous usage statistics — command, duration, outcome, warehouse type, bucketed table/column counts, version, OS. Never names, SQL, or data. See exactly what is sent with
semlayer telemetry --show; opt out withsemlayer telemetry --off, or per-shell withSEMLAYER_TELEMETRY=off. (what and why)
Honest scope (beta)
Best on messy warehouses. On clean, well-named schemas our benchmark shows raw DDL is already sufficient — we publish that negative result rather than hide it. If your warehouse is tidy TPC-DS, you may not need us.
ETL input: dbt (
--manifest target/manifest.json) -- reads the model DAG to settle join targets statistics cannot. Catalog comments and--contextdocs are read as priors on every run.Verify it yourself, free:
ANTHROPIC_API_KEY= pytest -qreplays recorded model responses, so every accuracy floor and benchmark number above is checkable with no API key and no spend — including from a fork, where CI has no secrets (what those recordings are, and what is still untidy about them). The warehouses behind the numbers, with sources, pinned versions and licences, are listed in docs/warehouses.md.Scale: tested to 2,000 tables / 30,000 columns; the run says so when a warehouse is past that. Data VOLUME is not the limit -- 4TB and 45TB are the same architecture. How to make it fast.
Warehouses: Snowflake, BigQuery, PostgreSQL, DuckDB (+ Iceberg on S3 via the DuckDB bridge). PostgreSQL also reaches Redshift and other Postgres-protocol engines, whose catalogs differ in places and are untested. Exporter: dbt (losses reported, never silent). LLM: Anthropic API (Bedrock/Vertex routing is next).
Not included: hosted service, ontology enrichment (it failed our own ablation gate — receipts), LookML/RDF exporters.
The eval harness ships in this repo — fixtures, gold layers, competency questions, benchmark runner. Run our numbers yourself:
python fixtures/build.py && pytest tests/ -q.
Beta feedback
Running the beta? File the Beta feedback form (attach the *.report.json the CLI writes next to your output — timings and counts only, never your schema or data), or email hello@semlayer.dev for anything sensitive.
Layout
spec/ format schema + consumer contract · src/semlayer/ the engine · fixtures/ 9 eval warehouses + golds + CQ suites · docs/ benchmark, cost model, spike reports · ARCHITECTURE.md how it works
Licence
Fair Source, not open source. The engine and CLI are FSL-1.1-ALv2: free for any internal use, including in production and CI, with no fee or key; the one prohibition is offering semlayer to third parties as a competing product or service. Every release converts to Apache-2.0 two years after it is published.
The format specification, its JSON Schemas and the exporters are Apache-2.0 — a semantic layer nobody else can read is worth nothing.
Releases 0.1.0b1 through 0.4.0b5 were published under Apache-2.0 and remain so permanently. LICENSING.md has the paths table, the conversion dates, and policy text for security teams.
This server cannot be deployed
Maintenance
Related MCP Connectors
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
- SchemaOAuthai.schemalabs
The AI that understands raw data: Schema over your tables and databases, as MCP tools.
Let AI agents query data and act across all your business apps via MCP.
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA semantic layer query engine with MCP support, enabling AI assistants to query structured data through natural language and declarative interfaces.4Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to query live schema, lineage, and query-context across data warehouses, dbt projects, orchestration systems, and BI tools via MCP tools.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceTurns warehouse/lakehouse tables into a governed entity-relationship knowledge graph exposed through MCP, enabling AI agents to answer multi-table business questions without hard-coded SQL or large schema prompts.Apache 2.0

Atlas MCPofficial
AlicenseNot gradedqualityAmaintenanceEnables natural language querying of SQL databases and REST APIs through the MCP protocol, grounded in a semantic layer.553 npm1AGPL 3.0