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. - 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
Add this skill
npx mdskills install yashshingvi/databricks-genie-mcpWell-documented MCP server with useful Databricks Genie tools but overly broad permissions and manual setup workaround.
12# Databricks Genie MCP Server34A 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.567## โจ Features89- List Genie spaces available in your Databricks workspace (Currently Manual/Using Resource)10- Fetch metadata (title, description) of a specific Genie space11- Start new Genie conversations with natural language questions12- Ask follow-up questions in ongoing Genie conversations13- Retrieve SQL and result tables in structured format1415## ๐งฑ Prerequisites1617- Python 3.7+18- Databricks workspace with:19 - Personal access token20 - Genie API enabled21 - Permissions to access Genie spaces and run queries222324## โ๏ธ Setup25261. **Clone this repository**27282. **Create and activate a virtual environment** (recommended):293031```32 python -m venv .venv33 source .venv/bin/activate34 ```353637**Install dependencies:**3839```40pip install -r requirements.txt41```4243Create a **.env** file in the root directory with the following variables:4445```46DATABRICKS_HOST=your-databricks-instance.cloud.databricks.com # Don't add https47DATABRICKS_TOKEN=your-personal-access-token48```495051๐ **Manually Adding Genie Space IDs**5253**Note:**54 At this time, the Databricks Genie API **does not provide a public endpoint to list all available space IDs and titles**. (afaik)55As a workaround, you need to **manually add the Genie space IDs and their titles** in the `get_genie_space_id()` function in `main.py`.565758596061## ๐งช Test the Server62You can test the MCP server using the inspector (optional but recommended):6364```65npx @modelcontextprotocol/inspector python main.py66```67OR6869**You can directly build and run docker to test the server**7071## ๐ฌ Use with Claude Desktop7273Download Claude Desktop7475**Install Your MCP Server:**76From your project directory, run:7778```79mcp install main.py80```81**Once Server Installed**82 1. Connect in Claude8384 2. Open Claude Desktop8586 3. Click Resources โ Add Resource8788 4. Select your Genie MCP Server8990 5. Start chatting with your data using natural language! ๐ฏ9192939495## ๐งพ Obtaining Databricks Credentials96**Host**97Your Databricks instance URL (e.g., your-instance.cloud.databricks.com) โ do not include https://9899**Token**100101 1. Go to your Databricks workspace102103 2. Click your username (top right) โ User Settings104 3. Under the Developer tab, click Manage under "Access tokens"105 4. Generate a new token and copy it106107108109110## ๐ Running the Server111112```113python main.py114```115This will start the Genie MCP server over the stdio transport for LLM interaction.116117## ๐งฐ Available MCP Tools118The following MCP tools are available:119120121**Tool Description**1221. get_genie_space_id() List available Genie space IDs and titles1232. get_space_info(space_id: str) Retrieve title and description of a Genie space1243. ask_genie(space_id: str, question: str) Start a new Genie conversation and get results1254. follow_up(space_id: str, conversation_id: str, question: str) Continue an existing Genie conversation126127## ๐ ๏ธ Troubleshooting128Common Issues129- Invalid host: Ensure the host does not include https://130131- Token error: Make sure your personal access token is valid and has access to Genie132133- Timeout: Check if the Genie space is accessible and not idle/expired134135- No data returned: Ensure your query is valid for the selected space136137## ๐ Security Considerations138139 - Keep your .env file secure and never commit it to version control140141 - Use minimal scope tokens with expiration whenever possible142143- Avoid exposing this server in public-facing environments unless authenticated144145## Claude Desktop Screenshots146147148149150
Full transparency โ inspect the skill content before installing.