Sponsored by Deepsite.site

🚀 MCP Databricks

Created By
leminkhoa7 months ago
My Databricks MCP server to interact with Databricks through LLM models
Content

🚀 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:

  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

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
CursorThe AI Code Editor
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
WindsurfThe new purpose-built IDE to harness magic
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Playwright McpPlaywright MCP server
Tavily Mcp
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
ChatWiseThe second fastest AI chatbot™
DeepChatYour AI Partner on Desktop
Amap Maps高德地图官方 MCP Server
Serper MCP ServerA Serper MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.