by JordiNeil
mcp-databricks-server is a Model Context Protocol (MCP) server that connects Large Language Models (LLMs) with the Databricks API. It enables LLMs to interact with Databricks for tasks such as running SQL queries and managing jobs.
mcp-databricks-server is a Model Context Protocol (MCP) server designed to connect Large Language Models (LLMs) with the Databricks API. This allows LLMs to interact with Databricks for tasks such as running SQL queries, listing jobs, and retrieving job statuses.
To use mcp-databricks-server, you need Python 3.7+ and a Databricks workspace with a personal access token, a SQL warehouse endpoint, and appropriate permissions. After cloning the repository, set up a virtual environment, install dependencies from requirements.txt
, and configure a .env
file with your Databricks host, token, and HTTP path. You can then run the server using python main.py
and test it with the MCP inspector.
This project enables natural language interaction with your Databricks environment through LLMs. Example use cases include:
Q: What are the prerequisites for running this server? A: Python 3.7+, a Databricks workspace with a personal access token, a SQL warehouse endpoint, and permissions to run queries and access jobs.
Q: How do I obtain Databricks credentials? A: Your Databricks instance URL is the host. A personal access token can be generated in your Databricks User Settings under the "Developer" tab. The HTTP Path for your SQL warehouse can be found in its connection details.
Q: What if I encounter connection issues?
A: Ensure your Databricks host is correct (without https://
), your SQL warehouse is running, your personal access token has necessary permissions, and try running the test_connection.py
script.
Q: What are the security considerations?
A: Your Databricks personal access token provides direct access. Secure your .env
file and never commit it to version control. Consider using tokens with appropriate permission scopes and running the server in a secure environment.
A Model Context Protocol (MCP) server that connects to Databricks API, allowing LLMs to run SQL queries, list jobs, and get job status.
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
.env
file in the root directory with the following variables:
DATABRICKS_HOST=your-databricks-instance.cloud.databricks.com
DATABRICKS_TOKEN=your-personal-access-token
DATABRICKS_HTTP_PATH=/sql/1.0/warehouses/your-warehouse-id
python test_connection.py
your-instance.cloud.databricks.com
)Start the MCP server:
python main.py
You can test the MCP server using the inspector by running
npx @modelcontextprotocol/inspector python3 main.py
The following MCP tools are available:
When used with LLMs that support the MCP protocol, this server enables natural language interaction with your Databricks environment:
https://
prefixpython test_connection.py
.env
file and never commit it to version controlPlease log in to share your review and rating for this MCP.