databricks-sql-mcp
Provides tools for executing SQL queries, listing databases, tables, and describing table schemas against a Databricks SQL Warehouse, with support for Unity Catalog.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@databricks-sql-mcplist all tables in the analytics catalog"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Databricks SQL MCP Server
A Model Context Protocol (MCP) server that lets AI assistants like Claude execute SQL queries on Databricks. Claude launches the server as a Docker container and communicates over stdin/stdout using the MCP stdio transport.
Features
Core Tools:
execute_sql- Run any SQL query against a Databricks SQL Warehouselist_databases- List databases/schemas in the default cataloglist_tables- List tables in a specific databasedescribe_table- Show column names, types, and comments for a table
Unity Catalog Tools:
list_catalogs- List all catalogs in the Unity Catalog metastorelist_schemas- List schemas within a specific cataloglist_tables_full- List tables using full 3-part naming (catalog.schema.table)describe_table_full- Describe a table using its full catalog path
Unity Catalog Hierarchy
CATALOG (e.g., analytics)
└── SCHEMA/DATABASE (e.g., silver)
└── TABLE (e.g., customers)Fully qualified name: catalog.schema.table (e.g., analytics.silver.customers)
Prerequisites
Docker installed and running
Databricks workspace access with a SQL Warehouse
Databricks personal access token
Claude Desktop or Claude Code (CLI)
Getting Your Databricks Credentials
1. Databricks Host URL
Your workspace URL. The format depends on your cloud provider:
Cloud | Example URL |
Azure |
|
AWS |
|
GCP |
|
2. Personal Access Token
Open your Databricks workspace
Click your username (top-right)
Go to User Settings > Developer > Access tokens
Click Generate new token
Copy the token (starts with
dapi...)
3. SQL Warehouse ID
Go to SQL Warehouses in Databricks
Click on a warehouse
Copy the warehouse ID from the URL:
/sql/warehouses/<this-id>
Quick Install (Recommended)
The install scripts pull the Docker image, prompt for your Databricks credentials, and register the MCP server with Claude using the Claude Code CLI.
Mac / Linux
curl -fsSL https://raw.githubusercontent.com/benguy1000/databricks-sql-mcp/master/install.sh | bashOr clone the repo first:
git clone https://github.com/benguy1000/databricks-sql-mcp.git
cd databricks-sql-mcp
chmod +x install.sh
./install.shWindows (PowerShell)
git clone https://github.com/benguy1000/databricks-sql-mcp.git
cd databricks-sql-mcp
.\install.batAfter running the installer, restart Claude Desktop (or start a new Claude Code session) and you're ready to go.
Manual Installation
If you prefer to set things up manually, or if the quick install doesn't work for your setup, follow the steps below.
Running with Docker
Pull the Image from Docker Hub
docker pull bkeeleygib/databricks-sql-mcp:latestOr build it yourself:
docker build -t bkeeleygib/databricks-sql-mcp .Run with Environment Variables
The -i flag is required -- MCP uses stdin/stdout for communication between Claude and the server.
docker run -i --rm \
-e DATABRICKS_HOST="https://your-workspace.azuredatabricks.net" \
-e DATABRICKS_TOKEN="dapi1234567890abcdef" \
-e DATABRICKS_WAREHOUSE_ID="abc123def456" \
bkeeleygib/databricks-sql-mcp:latestRun with .env File
Create a .env file with your credentials (see .env.example):
DATABRICKS_HOST=https://your-workspace.azuredatabricks.net
DATABRICKS_TOKEN=dapi1234567890abcdef
DATABRICKS_WAREHOUSE_ID=abc123def456Then run:
docker run -i --rm --env-file .env bkeeleygib/databricks-sql-mcp:latestConfiguring Claude Desktop
Add the server to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"databricks-sql": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e", "DATABRICKS_HOST=https://your-workspace.azuredatabricks.net",
"-e", "DATABRICKS_TOKEN=dapi1234567890abcdef",
"-e", "DATABRICKS_WAREHOUSE_ID=abc123def456",
"bkeeleygib/databricks-sql-mcp:latest"
]
}
}
}Important: Replace the placeholder values with your actual credentials, then restart Claude Desktop.
Configuring Claude Code (CLI)
Use the Claude Code CLI to register the server directly:
claude mcp add-json databricks-sql '{
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "DATABRICKS_HOST=https://your-workspace.azuredatabricks.net",
"-e", "DATABRICKS_TOKEN=dapi1234567890abcdef",
"-e", "DATABRICKS_WAREHOUSE_ID=abc123def456",
"bkeeleygib/databricks-sql-mcp:latest"
]
}'Example Queries
Once connected, you can ask Claude:
Browsing:
"List all catalogs in my Unity Catalog"
"Show me the schemas in the
analyticscatalog""What tables are in
analytics.silver?""Describe the schema of
analytics.silver.customers"
Querying:
"Run:
SELECT * FROM analytics.silver.customers LIMIT 10""Show me the top 5 most expensive items"
"What's the total revenue by category?"
Security Notes
Never commit your .env file or credentials to Git!
The
.envfile is listed in.gitignoreEach user needs their own Databricks personal access token
The Docker image does not contain any credentials
Credentials are passed at runtime via environment variables
Development
Local Development (without Docker)
Requires Python 3.11+.
# Install dependencies
pip install -r requirements.txt
# Create .env file with your credentials
cp .env.example .env
# Edit .env with your values
# Run the server
python server.pyProject Structure
server.py # MCP server implementation (FastMCP + Databricks SDK)
requirements.txt # Python dependencies (pinned to major versions)
Dockerfile # Docker image definition
install.sh # Quick installer for Mac/Linux
install.bat # Quick installer for Windows
.env.example # Template for environment variablesTroubleshooting
"Error: DATABRICKS_WAREHOUSE_ID not set"
Make sure you passed all three environment variables
Check that your
.envfile has values forDATABRICKS_HOST,DATABRICKS_TOKEN, andDATABRICKS_WAREHOUSE_ID
"Query failed: ..."
Verify your credentials are correct
Check that the SQL Warehouse is running (it may be auto-suspended)
Ensure you have permissions to access the requested data
"Server disconnected"
Restart Claude Desktop or start a new Claude Code session
Verify Docker is running:
docker infoCheck that the container starts successfully:
docker run -i --rm --env-file .env bkeeleygib/databricks-sql-mcp:latest
"Tables show as false"
This bug has been fixed in the latest version
Pull the latest image:
docker pull bkeeleygib/databricks-sql-mcp:latest
License
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/benkeeley9/databricks-sql-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server