semlayer — Claude Code MCP server: features and setup
The semlayer MCP server for Claude Code derives a semantic layer from a data warehouse. Agents can use it to check SQL against the warehouse’s structure and rules.
no license ★ 5 updated 2026-11-14
claude mcp add mcp -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -- uvx semlayerWhat semlayer does
semlayer examines a warehouse and produces a portable semantic layer with table and column descriptions, relationships, decoded status values, and business rules. Each inferred claim carries its confidence, source, and review state.
An agent accesses the layer over MCP. The semlayer lint command checks SQL for issues such as missing filters and unsafe joins; semlayer drift detects schema changes. Claude Code setup requires ANTHROPIC_API_KEY, and inference needs access to a data warehouse.
What it helps with
- describe warehouse tables and columns
- discover relationships without declared keys
- check SQL for missing filters and faulty joins
- detect changes to a warehouse schema
Example prompts for the agent
- Infer a semantic layer from my Snowflake warehouse.
- Check
query.sqlagainst the semantic layer. - Compare the layer with the current Snowflake schema and find changes.
How to install semlayer
Platform CLI
claude mcp add mcp -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -- uvx semlayerReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from semlayer <command>
Platform CLI
codex mcp add semlayer --env ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -- uvx semlayerReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from semlayer <command>
Config file
{
"mcpServers": {
"semlayer": {
"command": "uvx",
"args": [
"semlayer"
],
"env": {
"ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from semlayer <command>
Config file
{
"servers": {
"semlayer": {
"type": "stdio",
"command": "uvx",
"args": [
"semlayer"
],
"env": {
"ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from semlayer <command>
Platform CLI
gemini mcp add -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> semlayer uvx semlayerReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from semlayer <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about semlayer
How do I install semlayer in Claude Code?
Run claude mcp add mcp -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -- uvx semlayer. This registers the MCP server with the API key.
What does semlayer do?
It examines a warehouse schema and builds a semantic layer containing table descriptions, relationships, and business rules. Agents access the layer over MCP, while semlayer lint and semlayer drift check SQL and schema changes.
What does semlayer need to run?
Claude Code setup needs ANTHROPIC_API_KEY, and inference needs access to a data warehouse. The API key is used for language-model calls during inference.