Databricks MCP Server
Provides access to Databricks functionality through tools that allow interacting with clusters (listing, creating, terminating, starting), jobs (listing, running), notebooks (listing, exporting), files (browsing DBFS paths), and executing SQL queries on a Databricks instance.
Used for implementing test endpoints and API functionality for the MCP server, enabling proper API interaction with Databricks services.
Click on "Deploy 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 Server list all running clusters"
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
A Model Completion Protocol (MCP) server for Databricks that provides access to Databricks functionality via the MCP protocol. This allows LLM-powered tools to interact with Databricks clusters, jobs, notebooks, and more.
Features
MCP Protocol Support: Implements the MCP protocol to allow LLMs to interact with Databricks
Databricks API Integration: Provides access to Databricks REST API functionality
Tool Registration: Exposes Databricks functionality as MCP tools
Async Support: Built with asyncio for efficient operation
Related MCP server: Databricks MCP Server
Available Tools
The Databricks MCP Server exposes 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 Databricks 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
Installation
Prerequisites
Python 3.10 or higher
uvpackage manager (recommended for MCP servers)
Setup
Install
uvif you don't have it already:# MacOS/Linux curl -LsSf https://astral.sh/uv/install.sh | sh # Windows (in PowerShell) irm https://astral.sh/uv/install.ps1 | iexRestart your terminal after installation.
Clone the repository:
git clone https://github.com/JustTryAI/databricks-mcp-server.git cd databricks-mcp-serverSet up the project with
uv:# Create and activate virtual environment uv venv # On Windows .\.venv\Scripts\activate # On Linux/Mac source .venv/bin/activate # Install dependencies in development mode uv pip install -e . # Install development dependencies uv pip install -e ".[dev]"Set up environment variables:
# 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-tokenYou can also create an
.envfile based on the.env.exampletemplate.
Running the MCP Server
To start the MCP server, run:
# Windows
.\start_mcp_server.ps1
# Linux/Mac
./start_mcp_server.shThese wrapper scripts will execute the actual server scripts located in the scripts directory. The server will start and be ready to accept MCP protocol connections.
You can also directly run the server scripts from the scripts directory:
# Windows
.\scripts\start_mcp_server.ps1
# Linux/Mac
./scripts/start_mcp_server.shQuerying Databricks Resources
The repository includes utility scripts to quickly view Databricks resources:
# View all clusters
uv run scripts/show_clusters.py
# View all notebooks
uv run scripts/show_notebooks.pyProject Structure
databricks-mcp-server/
├── src/ # Source code
│ ├── __init__.py # Makes src a package
│ ├── __main__.py # Main entry point for the package
│ ├── main.py # Entry point for the MCP server
│ ├── api/ # Databricks API clients
│ ├── core/ # Core functionality
│ ├── server/ # Server implementation
│ │ ├── databricks_mcp_server.py # Main MCP server
│ │ └── app.py # FastAPI app for tests
│ └── cli/ # Command-line interface
├── tests/ # Test directory
├── scripts/ # Helper scripts
│ ├── start_mcp_server.ps1 # Server startup script (Windows)
│ ├── run_tests.ps1 # Test runner script
│ ├── show_clusters.py # Script to show clusters
│ └── show_notebooks.py # Script to show notebooks
├── examples/ # Example usage
├── docs/ # Documentation
└── pyproject.toml # Project configurationSee project_structure.md for a more detailed view of the project structure.
Development
Code Standards
Python code follows PEP 8 style guide with a maximum line length of 100 characters
Use 4 spaces for indentation (no tabs)
Use double quotes for strings
All classes, methods, and functions should have Google-style docstrings
Type hints are required for all code except tests
Linting
The project uses the following linting tools:
# Run all linters
uv run pylint src/ tests/
uv run flake8 src/ tests/
uv run mypy src/Testing
The project uses pytest for testing. To run the tests:
# Run all tests with our convenient script
.\scripts\run_tests.ps1
# Run with coverage report
.\scripts\run_tests.ps1 -Coverage
# Run specific tests with verbose output
.\scripts\run_tests.ps1 -Verbose -Coverage tests/test_clusters.pyYou can also run the tests directly with pytest:
# Run all tests
uv run pytest tests/
# Run with coverage report
uv run pytest --cov=src tests/ --cov-report=term-missingA minimum code coverage of 80% is the goal for the project.
Documentation
API documentation is generated using Sphinx and can be found in the
docs/apidirectoryAll code includes Google-style docstrings
See the
examples/directory for usage examples
Examples
Check the examples/ directory for usage examples. To run examples:
# Run example scripts with uv
uv run examples/direct_usage.py
uv run examples/mcp_client_usage.pyContributing
Contributions are welcome! Please feel free to submit a Pull Request.
Ensure your code follows the project's coding standards
Add tests for any new functionality
Update documentation as necessary
Verify all tests pass before submitting
License
This project is licensed under the MIT License - see the LICENSE file for details.
Available Tools
11 toolscreate_clusterC
Create a new Databricks cluster with parameters: cluster_name (required), spark_version (required), node_type_id (required), num_workers, autotermination_minutes
Inputs: params (required).
execute_sqlC
Execute a SQL statement with parameters: statement (required), warehouse_id (required), catalog (optional), schema (optional)
Inputs: params (required).
export_notebookC
Export a notebook from the workspace with parameters: path (required), format (optional, one of: SOURCE, HTML, JUPYTER, DBC)
Inputs: params (required).
get_clusterC
Get information about a specific Databricks cluster with parameter: cluster_id (required)
Inputs: params (required).
list_clustersC
List all Databricks clusters
Inputs: params (required).
list_filesC
List files and directories in a DBFS path with parameter: dbfs_path (required)
Inputs: params (required).
list_jobsC
List all Databricks jobs
Inputs: params (required).
list_notebooksC
List notebooks in a workspace directory with parameter: path (required)
Inputs: params (required).
run_jobC
Run a Databricks job with parameters: job_id (required), notebook_params (optional)
Inputs: params (required).
start_clusterC
Start a terminated Databricks cluster with parameter: cluster_id (required)
Inputs: params (required).
terminate_clusterC
Terminate a Databricks cluster with parameter: cluster_id (required)
Inputs: params (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool has a distinct purpose with clear boundaries: cluster management (create, get, list, start, terminate), SQL execution, notebook operations (export, list), file listing, and job operations (list, run). No overlapping functionality exists, making tool selection straightforward for an agent.
All tools follow a consistent verb_noun pattern (e.g., create_cluster, execute_sql, list_files) using snake_case throughout. This predictable naming convention enhances readability and usability for agents.
With 11 tools, the server is well-scoped for Databricks operations, covering clusters, SQL, notebooks, files, and jobs. Each tool serves a clear purpose without redundancy, making the count appropriate for the domain.
The toolset provides strong coverage for core Databricks workflows, including cluster lifecycle, SQL execution, notebook/file management, and job operations. Minor gaps exist, such as missing notebook creation or job update tools, but agents can work around these with available operations.
Maintenance
Related MCP Connectors
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceThis is a Model Context Protocol (MCP) server for executing SQL queries against Databricks using the Statement Execution API. It enables AI assistants to directly query Databricks data warehouses, analyze database schemas, and retrieve query results in a structured format43MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables LLMs to interact with Databricks workspaces through natural language, allowing SQL query execution and job management operations.50-
- AlicenseNot gradedqualityDmaintenanceA server that provides tools to interact with Databricks for cluster, job, notebook, DBFS, and SQL management through natural language interfaces like Claude-Desktop and Cursor.GPL 3.0
- AlicenseBqualityDmaintenanceA fixed Model Completion Protocol (MCP) server that enables LLMs like Claude Code to interact with Databricks functionality including clusters, jobs, notebooks, and SQL execution through natural language commands.195MIT