execute_sql_queryLABSCO SUMMARY
Metadata-first: the agent reads catalog descriptions and lineage before it writes a query.
The point of the describe_uc_* tools is to make the documentation you already put into Unity Catalog usable by the model, so its SQL is informed rather than guessed. Lineage goes past table-to-table — it surfaces the notebooks that produce a table, letting the agent read the actual transformation logic. Grant the token narrowly, because execute_sql_query runs whatever it is given.
What it is
A server that exposes Databricks Unity Catalog metadata and SQL execution, so an agent can navigate catalogs, read table structure and lineage, and query — returning descriptive output as Markdown.
What you get
- list_uc_catalogs lists catalogs with names, descriptions and types
- describe_uc_catalog lists a catalog's schemas; describe_uc_schema lists a schema's tables, with include_columns for column detail
- describe_uc_table gives a table's structure, and with include_lineage adds upstream and downstream tables plus the notebooks and jobs that read or write it
- execute_sql_query runs a SQL statement via the Databricks SDK and returns formatted results
- Lineage returns notebook paths, so the agent can go read the transformation code behind a table
Requirements
Python 3.10+, and three environment variables — DATABRICKS_HOST, DATABRICKS_TOKEN and DATABRICKS_SQL_WAREHOUSE_ID (the warehouse ID is used for lineage and SQL execution). Install with pip or uv against requirements.txt. The token's identity needs USE CATALOG, USE SCHEMA and SELECT on what it touches, plus CAN_USE on the warehouse; a service principal with narrow permissions is the recommended setup.
Setup effort
Build from source — git clone https://github.com/RafaelCartenet/mcp-databricks-server
USE CASES
Answering a data question against a warehouse you did not build
List catalogs, describe the schema and table, then run the query the metadata pointed you to.
Understanding a table before you query it
Describe the table for its columns and types, turning on lineage to see what feeds it.
Doing impact analysis on a change
Read a table's downstream lineage — the tables, notebooks and jobs that depend on it.
Reading the code that produced a number
Follow the notebook paths in the lineage to the transformation logic behind the table.
5 tools
Listed in project docs. Your client may show a different list.
list_uc_catalogsdescribe_uc_catalogdescribe_uc_schemadescribe_uc_tableBEFORE YOU INSTALL
What to know first
Tools you get
5 tools named in the project's documentation.
Requires
- Python 3.10+
- uv, for the uv configuration
- DATABRICKS_TOKEN in your environment
- DATABRICKS_HOST in your environment
- DATABRICKS_SQL_WAREHOUSE_ID in your environment
Where it runs
Both documented setups run the server on your machine.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/RafaelCartenet/mcp-databricks-server
cd mcp-databricks-server
pip install -r requirements.txtCreate a .env file in the repository root with DATABRICKS_HOST, DATABRICKS_TOKEN and DATABRICKS_SQL_WAREHOUSE_ID (the warehouse ID is under SQL Warehouses in the Databricks UI)
MCP Clients
Cursor
{
"mcpServers": {
"databricks": {
"command": "uv",
"args": [
"--directory",
"<YOUR_PATH_TO_MCP_DATABRICKS_SERVER>",
"run",
"main.py"
]
}
}
}<YOUR_PATH_TO_MCP_DATABRICKS_SERVER> is the full path of your clone.
Cursor — Python
{
"mcpServers": {
"databricks": {
"command": "python",
"args": [
"<YOUR_PATH_TO_MCP_DATABRICKS_SERVER>/main.py"
]
}
}
}<YOUR_PATH_TO_MCP_DATABRICKS_SERVER> is the full path of your clone.