Databricks MCP Server
Allows querying Databricks datasets using natural language, executing read-only SQL queries on Databricks SQL warehouses.
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 MCP ServerWhat were the busiest pickup zones last month?"
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 MCP Server — Natural-Language Analytics POC
A small Model Context Protocol server that lets an LLM client (e.g. Claude Desktop) answer business questions in natural language over a Databricks dataset — without writing SQL by hand.
It runs against the public samples.nyctaxi.trips dataset that ships with every
Databricks workspace, so it's reproducible by anyone.
What it exposes (the three MCP primitives)
Primitive | Name | Purpose |
Tool |
| Executes a read-only SQL query against |
Resource |
| Curated schema + metric definitions and gotchas — the context layer that makes the generated SQL correct. |
Prompts |
| Ready-made business questions. |
Related MCP server: MCP Iceberg Catalog
Safety / governance
Two layers, on purpose:
App-level guard (
is_read_only): only a singleSELECT/WITHstatement is accepted; any write/DDL keyword (INSERT,UPDATE,DROP, ...) is rejected, and aLIMIT 1000is appended when missing.The real guarantee: connect with a Databricks token whose grants are read-only on the catalog. App guards reduce footguns; permissions are what actually protect the data. Never give an LLM a write-capable credential.
Architecture
Claude Desktop ──stdio──► MCP server (this repo) ──Databricks SQL connector──► samples.nyctaxi.trips
(client) tool · resource · prompts (read-only)run_query doesn't open the connection in-process — it shells out to
query_runner.py (subprocess.run(..., stdin=subprocess.DEVNULL, capture_output=True)).
See the note below for why.
Implementation note: why run_query uses a subprocess
Both points were reproduced and verified on Windows + the FastMCP stdio
transport (Claude Desktop and the MCP Inspector). Symptom in both: the tool call
hangs and the client returns MCP error -32001: Request timed out at ~60s, even
though the same query runs in ~4s with the connector directly.
sql.connect()stalls ~60s when called inside the server process. From a clean child process it connects in ~2s; inside the FastMCP process it blocks until the client's request times out. It stalls on the event-loop thread and on a worker thread, so it's a process-level interaction with the connector — not just the event loop being blocked. Running the query in a child process avoids it. (Disabling telemetry /use_cloud_fetchdoes not help.)stdin=subprocess.DEVNULLis required on the child. A stdio MCP server's own stdin is the JSON-RPC pipe from the client. A child started with the defaultstdin=Noneinherits that pipe handle and hangs until the client gives up (~60s). Detaching stdin makes it return at query speed.capture_output=Truealready detaches stdout/stderr — stdin is the one that's easy to miss, so piping the query out to a subprocess without it does not fix the hang.
Gotcha — don't launch the Inspector from Git Bash on Windows. MSYS2 rewrites the POSIX-looking
DATABRICKS_HTTP_PATH(/sql/1.0/warehouses/…→C:/Program Files/Git/sql/1.0/warehouses/…), so the server gets a 404, not a timeout. Use PowerShell orcmd. Claude Desktop passes env vars directly and is unaffected.
Run it
Prereqs: Python 3.11+, uv, a Databricks workspace
with a running SQL Warehouse and the samples catalog.
Windows / PowerShell (recommended on Windows — see the Git Bash gotcha above):
cd "C:\path\to\databricks-mcp"
uv sync # first time only
# from SQL Warehouses -> Connection details, plus a personal access token.
# These live only in THIS PowerShell window (nothing is written to disk):
$env:DATABRICKS_HOST = "dbc-xxxxxxxx-xxxx.cloud.databricks.com"
$env:DATABRICKS_HTTP_PATH = "/sql/1.0/warehouses/xxxxxxxxxxxxxxxx"
$env:DATABRICKS_TOKEN = "dapixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# launch the browser inspector, then run a query from its UI:
npx @modelcontextprotocol/inspector uv run server.pyuv sync
export DATABRICKS_HOST="adb-....azuredatabricks.net"
export DATABRICKS_HTTP_PATH="/sql/1.0/warehouses/...."
export DATABRICKS_TOKEN="dapi...."
npx @modelcontextprotocol/inspector uv run server.pyConnect to Claude Desktop
You can reach the config file in two ways:
Via the UI (recommended): in Claude Desktop go to Settings → Developer → Edit Config. This opens (and creates, if missing)
claude_desktop_config.jsonin the right folder.By path: edit it directly at
%APPDATA%\Claude\claude_desktop_config.json(Windows) or~/Library/Application Support/Claude/claude_desktop_config.json(macOS).
Copy the contents of claude_desktop_config.example.json into that file,
fill in your real values, and restart Claude Desktop. Then ask things like:
"What were the busiest pickup zones, and how does monthly revenue trend?"
Notes
samples.nyctaxi.tripsis a public Databricks dataset; no private data is used.Secrets live in env vars / the Claude Desktop config, both git-ignored.
Available Tools
1 toolrun_queryA
Run a READ-ONLY SQL query against samples.nyctaxi.trips and return rows. Only a single SELECT/WITH is allowed; LIMIT 1000 is appended if missing.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Given no annotations, the description reveals read-only behavior, query type restrictions, and automatic LIMIT. It does not cover error handling or response format, but core behaviors are disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences: first states purpose, second adds constraints. No superfluous words, front-loaded structure.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With low complexity (1 param) and an output schema present, the description covers essential context: target table, read-only, and query limitations. Minor gaps like error handling are acceptable.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so description must compensate. It adds context by specifying the target table and query constraints, which adds meaning beyond the bare parameter name.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Run a READ-ONLY SQL query' and the specific resource 'samples.nyctaxi.trips', with explicit read-only nature and allowed query types. This fully defines the tool's purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides constraints like 'Only a single SELECT/WITH is allowed' and 'LIMIT 1000 is appended if missing', guiding usage. No alternatives are discussed, but no siblings exist, so it's adequate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no risk of confusion between tools. The tool's purpose is clearly defined as running a read-only SQL query on a specific table.
With a single tool, naming consistency is not a concern. The tool name 'run_query' follows a common verb_noun pattern.
The server is named 'Databricks MCP Server', implying access to a wide range of Databricks functionality, but only one tool for a single query on a fixed table is provided. This is an extreme mismatch in scope.
The tool set is severely incomplete for a Databricks server. It lacks operations for managing databases, tables, clusters, or running arbitrary SQL beyond the fixed sample table.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
The grounded data layer for any LLM: governed SQL, metrics, lineage and catalog over your data.
Your Databricks Lakehouse in natural language: run SQL on your SQL warehouses, track long-running qu
A Model Context Protocol server for Wix AI tools
The BigQuery remote MCP server is a fully managed service that uses the Model Context Protocol to connect AI applications and LLMs to BigQuery data sources. It provides secure, standardized tools for AI agents to list datasets and tables, retrieve schemas, generate and execute SQL queries through natural language, and analyze data—enabling direct access to enterprise analytics data without requiring manual SQL coding.
Related MCP Servers
- FlicenseNot gradedqualityFmaintenanceA Model Context Protocol server that enables LLMs to interact with Databricks workspaces through natural language, allowing SQL query execution and job management operations.50
- FlicenseBqualityDmaintenanceA Model Context Protocol server that provides a SQL interface for querying and managing Apache Iceberg tables through Claude desktop, allowing natural language interaction with Iceberg data lakes.18
- AlicenseAqualityBmaintenanceA Model Context Protocol server that enables large language models to access database metadata and perform cross-engine data querying across diverse database ecosystems.1652Apache 2.0
- AlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that enables AI assistants to interact with Databricks workspaces, allowing them to browse Unity Catalog, query metadata, sample data, and execute SQL queries.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/OliveriGuido/databricks-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server