What is A Model Context Protocol (MCP) server that connects to the Databricks Genie API, allowing LLMs to ask natural language questions and run SQL queries.?
Databricks Genie MCP Server is a Model Context Protocol (MCP) server that connects to the Databricks Genie API, enabling LLMs to ask natural language questions, run SQL queries, and interact with Databricks conversational agents. It features listing available Genie spaces, fetching metadata, starting new conversations, and retrieving SQL results in structured format.
Documentation
Databricks Genie MCP Server
A Model Context Protocol (MCP) server that connects to the Databricks Genie API, allowing LLMs to ask natural language questions, run SQL queries, and interact with Databricks conversational agents.
โจ Features
List Genie spaces available in your Databricks workspace (Currently Manual/Using Resource)
Fetch metadata (title, description) of a specific Genie space
Start new Genie conversations with natural language questions
Ask follow-up questions in ongoing Genie conversations
Retrieve SQL and result tables in structured format
๐งฑ Prerequisites
Python 3.7+
Databricks workspace with:
Personal access token
Genie API enabled
Permissions to access Genie spaces and run queries
โ๏ธ Setup
Clone this repository
Create and activate a virtual environment (recommended):
python -m venv .venv
source .venv/bin/activate
Install dependencies:
pip install -r requirements.txt
Create a .env file in the root directory with the following variables:
Note:
At this time, the Databricks Genie API does not provide a public endpoint to list all available space IDs and titles. (afaik)
As a workaround, you need to manually add the Genie space IDs and their titles in the get_genie_space_id() function in main.py.
๐งช Test the Server
You can test the MCP server using the inspector (optional but recommended):