Skip to content
MCP server

semlayer

Infers a semantic layer from your data warehouse and serves it to agents

Runs locallyStatus and history
Pricing
Free
Platforms
CLI, self-hosted
Runs
Locally
Version
0.7.0b6
Listing updated
3 days ago

About semlayer

semlayer is a free MCP server for databases. It runs locally on your machine and is started by your AI client.

semlayer reads a warehouse and writes down what AI agents are usually missing: what tables and columns mean, undeclared foreign keys, the filters summary tables silently apply, and metric definitions. The result is one open file served over MCP.

It infers all this from the data, with no hand-written model. Statistics-only inference works without any key, while column descriptions and LLM-validated joins use an optional Anthropic API key. On the authors' messy-warehouse benchmark, text-to-SQL accuracy rose from 42% to 82%; treat that as the vendor's own measurement.

It is a Python package at a beta version, licensed Fair Source and free for internal use.

Install

Run in a terminal

claude mcp add mcp --env ANTHROPIC_API_KEY='<ANTHROPIC_API_KEY>' -- uvx semlayer

Add to claude_desktop_config.json

{
  "mcpServers": {
    "mcp": {
      "command": "uvx",
      "args": [
        "semlayer"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "mcp": {
      "command": "uvx",
      "args": [
        "semlayer"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "semlayer"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "mcp": {
      "command": "uvx",
      "args": [
        "semlayer"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "mcp": {
      "command": "uvx",
      "args": [
        "semlayer"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
      }
    }
  }
}

Configuration

  • ANTHROPIC_API_KEYOptional. Descriptions and LLM-validated joins need it; statistics-only inference works without it.

What it does

Undeclared joins
Finds foreign keys nobody declared.
Hidden filters
Recovers filters baked into summary tables.
Metric definitions
Captures how measures like average order value are computed.
Open file output
One file readable by any agent.
Optional LLM step
Descriptions and join validation use an API key.

Good for

  • Give a text-to-SQL agent warehouse context
  • Document an undocumented schema
  • Standardize metric definitions
  • Reduce wrong answers from AI analytics

Pricing

Free

Fair Source; free for internal use

Prices change. Check semlayer.dev before you buy.

semlayer FAQ

Does it need an API key?

Only optionally, for descriptions and LLM-validated joins.

What is the license?

Fair Source, free for any internal use.

Where does it run?

As a CLI in your own environment with your own keys.

Is semlayer free?

Yes. semlayer is free to use.

How do I add semlayer to Claude Code?

Run this command in your terminal: claude mcp add mcp --env ANTHROPIC_API_KEY='<ANTHROPIC_API_KEY>' -- uvx semlayer

What are the best alternatives to semlayer?

The closest alternatives to semlayer are Agent-Native Analytics, Google Ads + Meta Ads + SEO/GEO MCP, Tapetide - Indian Stock Market MCP, Midplane and World Monitor.

Alternatives to semlayer

  1. Open-source analytics app where an AI agent builds charts and dashboards from your data

    • Remote
    • Open source
    • 7.7K GitHub stars
    • Analytics and data
  2. Hosted MCP connector for managing Google Ads, Meta Ads, GA4 and Search Console from chat

    • 8 tools
    • Remote
    • Freemium
    • 8.1K GitHub stars
    • Marketing and SEO
  3. Indian NSE and BSE stock market data for AI assistants through 48 MCP tools

    • 17 tools
    • Remote
    • Freemium
    • 150 GitHub stars
    • Finance and payments
  4. Midplane

    MCP server

    Postgres gateway for AI agents with table grants, column masking and approval for writes

    Runs locally
    • Open source
    • 5 GitHub stars
    • Databases
  5. World Monitor

    MCP server

    Live geopolitical intelligence dashboard with an API and MCP server for agents

    • Remote
    • Freemium
    • Analytics and data
  6. CompanyData

    MCP server

    Search and enrich company records from official registers via the CompanyData API

    • 3 tools
    • Remote
    • Paid
    • 3 GitHub stars
    • Analytics and data