Databricks MCP server

Integrates with Databricks APIs to manage clusters, jobs, notebooks, DBFS files, and execute SQL queries directly from your assistant interface
Back to servers
Provider
markov-kernel
Release date
Apr 03, 2025
Language
Python
Stats
37 stars

The Databricks MCP Server provides access to Databricks functionality via the Model Completion Protocol (MCP), enabling LLM-powered tools to interact with Databricks clusters, jobs, notebooks, and other resources. This server acts as a bridge between AI assistants and your Databricks environment.

Installation Requirements

Prerequisites

  • Python 3.10 or higher
  • uv package manager (recommended)

Installation Steps

  1. Install the uv package manager:

    # MacOS/Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Windows (in PowerShell)
    irm https://astral.sh/uv/install.ps1 | iex
    

    Restart your terminal after installation.

  2. Clone the repository:

    git clone https://github.com/markov-kernel/databricks-mcp.git
    cd databricks-mcp
    
  3. Set up the environment:

    # Linux/Mac
    ./scripts/setup.sh
    
    # Windows (PowerShell)
    .\scripts\setup.ps1
    

    Alternatively, manual setup:

    # Create and activate virtual environment
    uv venv
    
    # On Windows
    .\.venv\Scripts\activate
    
    # On Linux/Mac
    source .venv/bin/activate
    
    # Install dependencies
    uv pip install -e .
    uv pip install -e ".[dev]"
    
  4. Configure your Databricks credentials:

    # Windows
    set DATABRICKS_HOST=https://your-databricks-instance.azuredatabricks.net
    set DATABRICKS_TOKEN=your-personal-access-token
    
    # Linux/Mac
    export DATABRICKS_HOST=https://your-databricks-instance.azuredatabricks.net
    export DATABRICKS_TOKEN=your-personal-access-token
    

    Alternatively, create an .env file based on the provided .env.example.

Running the MCP Server

Standalone Mode

To start the server directly:

# Activate your virtual environment if not already active
source .venv/bin/activate 

# Run the start script
./scripts/start_mcp_server.sh

Integration with AI Clients

Cursor Setup

  1. Open or create ~/.cursor/mcp.json

  2. Add the following configuration:

    {
      "mcpServers": {
        "databricks-mcp-local": { 
          "command": "/absolute/path/to/your/project/databricks-mcp-server/start_mcp_server.sh",
          "args": [],
          "env": {
            "DATABRICKS_HOST": "https://your-databricks-instance.azuredatabricks.net", 
            "DATABRICKS_TOKEN": "dapiXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            "RUNNING_VIA_CURSOR_MCP": "true" 
          }
        }
      }
    }
    
  3. Replace the path and credentials with your actual values

  4. Restart Cursor

  5. Invoke tools using databricks-mcp-local:<tool_name>

Claude CLI Setup

Register the server with:

claude mcp add databricks-mcp-local \
  -s user \
  -e DATABRICKS_HOST="https://your-databricks-instance.azuredatabricks.net" \
  -e DATABRICKS_TOKEN="dapiXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -- /absolute/path/to/your/project/databricks-mcp-server/start_mcp_server.sh

Replace the path and credentials with your actual values.

Available Tools

The Databricks MCP Server provides the following tools:

  • list_clusters: List all Databricks clusters
  • create_cluster: Create a new Databricks cluster
  • terminate_cluster: Terminate a Databricks cluster
  • get_cluster: Get information about a specific cluster
  • start_cluster: Start a terminated Databricks cluster
  • list_jobs: List all Databricks jobs
  • run_job: Run a Databricks job
  • list_notebooks: List notebooks in a workspace directory
  • export_notebook: Export a notebook from the workspace
  • list_files: List files and directories in a DBFS path
  • execute_sql: Execute a SQL statement

Querying Databricks Resources

Use the included utility scripts to quickly view resources:

# View all clusters
uv run scripts/show_clusters.py

# View all notebooks
uv run scripts/show_notebooks.py

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later