sqlmesh-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
sqlmesh-mcp
MCP server for SQLMesh — exposes data transformation operations as tools for AI agents (Claude, GPT-4, and any MCP-compatible client).
What is this?
sqlmesh-mcp lets an AI agent interact with a SQLMesh project through the Model Context Protocol (MCP). The agent can inspect models, generate and apply plans, run tests and audits, explore column-level lineage, manage environments, and execute SQL — all without leaving the AI chat interface.
This is particularly powerful because SQLMesh's column-level lineage (a key advantage over dbt) becomes directly queryable: ask an AI "where does the revenue column in finance.daily_summary come from?" and get a traced answer across the full DAG.
Related MCP server: mendix-mcp-server
Tools
Tool | Description |
| List all models with kind, cron, grain, tags |
| Detailed metadata for a single model (columns, audits, query preview) |
| Render fully-expanded SQL for a model |
| Read-only — preview what would change in an environment |
| Apply a plan to an environment (plan + auto-apply) |
| Execute scheduled models whose cron interval is due |
| Run SQLMesh unit tests (fixture-based, no warehouse) |
| Run data quality audits against the warehouse |
| Traverse the model DAG (upstream/downstream) |
| Column-level lineage — trace column provenance across hops |
| List all environments and their state |
| Diff an environment against prod |
| Row-level data diff between two environments |
| Execute SQL and return results as JSON |
| Expire a dev/feature environment |
Installation
From source (recommended during development)
git clone https://github.com/arthursherman/sqlmesh-mcp
cd sqlmesh-mcp
pip install -e ".[dev]"From PyPI (once published)
pip install sqlmesh-mcpConfiguration
The server is configured through environment variables:
Variable | Description | Default |
| Absolute path to your SQLMesh project | Current working directory |
| Named gateway defined in | Default gateway |
Usage
With Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"sqlmesh": {
"command": "python",
"args": ["-m", "sqlmesh_mcp.server"],
"env": {
"SQLMESH_PROJECT_PATH": "/path/to/your/sqlmesh/project"
}
}
}
}With Claude Code
claude mcp add sqlmesh -- python -m sqlmesh_mcp.serverSet the project path via:
export SQLMESH_PROJECT_PATH=/path/to/your/projectWith MCP Inspector (recommended for development)
SQLMESH_PROJECT_PATH=/path/to/project \
npx @modelcontextprotocol/inspector python -m sqlmesh_mcp.serverOpen http://localhost:6274 in your browser to interactively test every tool.
Example interactions
Once connected to Claude or another MCP client, you can ask:
"List all models in my SQLMesh project"
"What columns does db.orders have and what are their types?"
"Show me a plan for the dev environment"
"Where does the revenue column in finance.daily_summary come from?"
"Run tests for the orders model"
"What's the difference between prod and dev right now?"
"Execute: SELECT COUNT(*) FROM db.orders WHERE status = 'complete'"Development
Running tests
pytest tests/Linting
ruff check src/Testing against a real SQLMesh project
The fastest way to get started is with SQLMesh's built-in DuckDB quickstart:
mkdir sqlmesh-demo && cd sqlmesh-demo
pip install sqlmesh
sqlmesh init duckdb
# Then point this server at it:
SQLMESH_PROJECT_PATH=$(pwd) npx @modelcontextprotocol/inspector python -m sqlmesh_mcp.serverSecurity considerations
This server executes SQLMesh operations with the permissions of the process user.
The
sqlmesh_applyandsqlmesh_runtools modify data — consider wrapping with a governance layer (see Castellan) if deploying in a shared or production context.The
sqlmesh_fetchdftool executes arbitrary SQL — restrict access accordingly.Bind the MCP Inspector proxy only to localhost; do not expose it publicly.
Roadmap
dbt-to-SQLMesh migration assistant tool
Semantic model / metric exposure via MCP resources
CI/CD integration (GitHub Actions plan summary)
Multi-project support (monorepo)
MCP sampling for agentic backfill decision-making
Related projects
castellan-governance-mcp — governance and security wrapper for MCP servers
SQLMesh — the underlying data transformation framework
License
MIT — see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Build and run AI workflows, agents, data tables and 1000+ API integrations from any MCP client.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables 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 gradedqualityDmaintenanceEnables AI agents to read and modify Mendix application models through MCP tools for creating modules, entities, pages, microflows, deploying, and querying runtime data.1ISC
- AlicenseBqualityBmaintenanceEnables MCP hosts like ChatGPT and Claude to query data platform metadata, explore schemas and tables, inspect SQL explain plans, and monitor DAG and ETL status through standardized tools.21MIT
- AlicenseBqualityBmaintenanceEnables LLM agents to interact with a SQLMesh project, providing model metadata, column-level lineage, plan previews, audits/tests, and environment diffs, with optional apply/run actions.272MIT