semlayer MCP server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
semlayer models a data warehouse into a semantic layer and serves it to you. CALL status BEFORE YOU ANSWER ANY QUESTION ABOUT THE USER'S DATA. It is one call, it is instant, and it is the only thing that knows whether a layer is loaded -- do not conclude from these instructions that there is none. This server is most often started WITH a layer, and status says so: state is ready and layer names it. Telling a user you have no data, without having called status, is the one failure that wastes everything the layer was built for. If status reports a layer, go straight to context_for_question. Only if it reports none does the rest of this paragraph apply: a semantic layer has to be BUILT from a warehouse, and until it is there is nothing to search or query. status then tells you which warehouse connections were found on this machine, which layers were found already built, and how to start inference -- every other tool answers with that same object when no layer is loaded, so read next and act on it rather than retrying. Never ask the user for a password or a key in chat. Credentials live in their environment, their .env file, their dbt profile, or their warehouse's connections file; you only ever pass names or URIs. Redshift, Supabase, Neon, and anything speaking the Postgres protocol use the postgres connection. If the user names a warehouse that is not listed as supported, say so plainly, pass the name to discover_connections as requested, and offer the nearest route it returns. infer builds the layer: it reads their warehouse, takes minutes on a real one, and spends their own LLM budget, so ASK THEM FIRST and say which warehouse you are about to model. Pass their question to it; when the layer is ready, status reminds you to answer it. Once a layer is loaded, start every question with context_for_question, apply required filters, never use UNUSABLE objects, and run check_sql before any SQL runs -- including SQL you mean to run with a tool that is not semlayer's. It is the gate, and a statement it has not seen can return a confidently wrong NUMBER instead of an error. status and context_for_question both carry an execution block naming which executor to use: when it says run_sql, use it -- it applies the gate before the statement reaches the warehouse and reports the limits that applied. When it says otherwise, semlayer cannot execute here: run exactly what check_sql approves, VERBATIM and never re-drafted, with the SQL tool the user has connected, and confirm that tool is pointed at the target the block names. Answer in words first, then state the assumptions the answer rests on, and caveat answers built on lifecycle=inferred elements.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| statusA | What this server has, what it can see, and what to do next. |
| discover_connectionsA | Which warehouses are reachable from this machine, by name. |
| load_layerA | Load one of the layers |
| inferA | Build the semantic layer for a warehouse. Ask the user first. |
| cancel_inferA | Stop the inference that is running. Takes effect at the next stage. |
| context_for_questionA | START EVERY QUESTION ABOUT THE USER'S DATA HERE. |
| run_sqlA | Run ONE read-only SELECT against the session's warehouse. |
| review_questionsA | List the open review questions in the loaded layer. |
| review_questionA | Fetch one open review question in full, by its key. |
| review_answerA | Record a verdict. Takes effect immediately, and says who decided. |
| review_decisionsA | List every verdict recorded in the loaded layer, and who made it. |
| save_layerA | Write the layer into the user's project so their team has it. |
| export_layerA | Write a snapshot of the layer in another tool's format. |
| semantic_searchB | Search tables, columns, and metrics by keywords. The starting point. |
| get_domainsA | List warehouse domains (table groupings) for navigation. |
| get_tablesA | List table summaries, optionally within a domain. |
| table_detailA | Full detail for one table: columns, keys, relationships, REQUIRED FILTERS. |
| get_metricsB | List defined metrics (name, measure, aggregation, filter). |
| route_intentC | Which tables to use (and avoid) for an analytical intent. |
| check_sqlA | Lint SQL against the semantic layer BEFORE it runs ANYWHERE. |
| compile_metricA | Compile a metric to correct SQL (joins, filters, time bucketing). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| setup | Walk me through setting up semlayer |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 21 tools
Most tools have clear distinct roles, but the entry-point tools overlap heavily: context_for_question ('START EVERY QUESTION HERE'), semantic_search ('The starting point'), route_intent, and get_domains/get_tables all compete for the same navigation job with conflicting guidance. An agent could reasonably misselect among them when beginning a question. The review_* family and the inference lifecycle tools (infer/cancel_infer/status) are cleanly separated.
Nearly everything is consistent snake_case verb_noun (get_domains, load_layer, run_sql, check_sql, review_questions, save_layer). The only deviations are the noun-only 'status' and 'table_detail', which break the verb_noun pattern but remain readable and predictable.
21 tools is at the heavy end, and while the server genuinely spans several sub-domains (connection discovery, inference lifecycle, navigation, querying/linting, review workflow, export), the navigation surface could likely be consolidated into fewer entry points. Each tool does something, but the count sits in the borderline 16-25 band.
Coverage is strong: discovery, inference with cancellation, navigation, SQL execution plus linting, metric compilation, a full review lifecycle (list/fetch/answer/decisions), and save/export. Minor gaps remain—no way to edit or delete individual layer objects or refresh a saved layer—but agents can work around these.