mcpField
πŸš€
πŸš€ MCP Databricks

πŸš€ MCP Databricks

Local
github.com/leminkhoaDatabases1Updated 77w ago

About πŸš€ MCP Databricks

MCP Databricks is a Python MCP server for AI assistants working with Databricks workspaces. It covers clusters, SQL warehouses, command execution, and workspace objects, and can be installed with Docker or uv.

Key features

  1. 01List, create, and manage clusters
  2. 02Install cluster libraries and run commands
  3. 03Manage SQL warehouses
  4. 04Import and manage workspace objects

Use cases

  1. 01Inspect or start Databricks clusters
  2. 02Run Python, Scala, or SQL on a cluster
  3. 03Manage notebooks and files in a workspace
  4. 04Work with queries through SQL warehouses

MCP support

The server connects to Claude Desktop and other MCP clients over stdio. It exposes tools for Databricks cluster management, command execution, SQL warehouses, and workspace objects.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json Β· Universal config
{
"mcpServers": {
"databricks": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"build"
]
}
}
}
Run commanddocker run -i --rm build

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
ocibuild

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

πŸš€ MCP Databricks

Python 3.11+ Databricks MCP Protocol

A powerful Databricks integration for AI assistants via Model Context Protocol

πŸ“– Introduction

MCP Databricks seamlessly connects AI assistants to your Databricks workspaces through the Model Context Protocol (MCP). Built with Python, it provides a rich collection of tools for managing virtually every aspect of your Databricks environment.

With this server, AI assistants like Claude can:

  • πŸ”§ Manage compute resources with precision
  • πŸ“Š Execute SQL queries and analyze results
  • πŸ“ Organize and manipulate workspace objects
  • ✨ And much more!

πŸ” Prerequisites

  • 🐍 Python 3.11 or higher
  • πŸ’» A Databricks workspace
  • πŸ”‘ Databricks Personal Access Token (PAT)
  • πŸ“¦ Required Python packages (installed in setup)

πŸš€ Quickstart

1️⃣ Clone the repository
git clone https://github.com/leminkhoa/databricks-mcp
cd databricks-mcp
2️⃣ Configure environment variables

Create a .env file in the project root with your Databricks credentials:

# Databricks API Configuration
DATABRICKS_HOST="https://adb-<your workspace uri>.azuredatabricks.net/"
DATABRICKS_TOKEN="dapi_<your_token_here>"

# Server Configuration
SERVER_HOST="0.0.0.0"
SERVER_PORT="8000"
DEBUG="false"
TRANSPORT="stdio"

# Logging Configuration
LOG_LEVEL="INFO"

πŸ’‘ Tip: For further instructions, You can use the env.sample file as a template.

3️⃣ Choose Your Installation Method

You can use MCP Databricks in two ways:

Option A: Docker (Recommended for production)
  1. Build the Docker image:
docker build -t databricks-mcp .
  1. Configure in Cursor with the following mcp.json entry:
{
  "databricks-mcp-docker": {
    "command": "docker",
    "args": [
      "run",
      "--rm",
      "-i",
      "--name", "databricks-mcp",
      "--env-file", "<path/to/.env>",
      "databricks-mcp"
    ]
  }
}

πŸ’‘ Note: Replace <path/to/.env> with the absolute path to your .env file.

Option B: Local Installation with uv
  1. Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh

πŸ’‘ Note: See uv installation documentation for alternative installation methods.

  1. Set up virtual environment:
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install dependencies with uv:
uv sync
  1. Configure in Cursor with the following mcp.json entry:
{
  "databricks-mcp-stdio": {
    "command": "uv",
    "args": [
      "--directory",
      "<repository directory>",
      "run",
      "main.py"
    ]
  }
}

πŸ’‘ Note: Replace <repository directory> with the absolute path to your cloned repository.

πŸš€ Usage

Running the MCP Server

If not using Docker or Cursor integration, start the server with:

python main.py

or

uv run main.py
Connecting to Claude or other MCP clients

This server uses the stdio transport for seamless compatibility with Claude Desktop and other MCP clients. After installing the server, you can immediately connect to it using your preferred MCP client.

🧰 Tools and Capabilities

The MCP Databricks server provides a comprehensive toolkit for managing your Databricks environment:

πŸ’» Cluster Management
ToolDescription
list_clustersList all Databricks clusters in the workspace
create_clusterCreate a new Databricks cluster with customizable settings
delete_clusterDelete a Databricks cluster by ID
start_clusterStart a terminated Databricks cluster
list_node_typesList all available node types for Databricks clusters
list_spark_versionsList all available Spark versions for Databricks clusters
get_clusterGet detailed information about a specific Databricks cluster
πŸ“¦ Library Management
ToolDescription
install_librariesInstall libraries (JAR, WHL, PyPI, Maven, CRAN, etc.) on a running cluster
πŸ–₯️ Command Execution
ToolDescription
execute_commandExecute a command (Python, Scala, SQL) on a running Databricks cluster
create_execution_contextCreate an execution context for interactive command sessions
πŸ“Š SQL Warehouse Management
ToolDescription
list_sql_warehousesList all SQL warehouses in the workspace
create_sql_warehouseCreate a new SQL warehouse with configurable size and settings
πŸ“ Workspace Objects
ToolDescription
delete_workspace_objectDelete an object from the Databricks workspace
get_workspace_object_statusGet the status of an object in the Databricks workspace
import_workspace_objectImport an object (notebook, file, etc.) into the workspace
create_workspace_directoryCreate a directory in the Databricks workspace

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.