About Databricks Genie API MCP Server
Databricks Genie API MCP Server is an MCP server that exposes Databricks Genie API functions as tools. It is aimed at users who want to query Databricks data in natural language and connect that capability to other applications through a standard interface.
Key features
- 01Genie API functions exposed as MCP tools
- 02Genie conversation and message management
- 03SQL result execution and retrieval from Genie
- 04Authentication through the Databricks SDK
Use cases
- 01Querying Databricks data in natural language from Claude Desktop
- 02Starting Genie conversations and retrieving query results
- 03Downloading full query results generated by Genie
MCP support
The project runs as an MCP server, exposing Genie-related tools such as start_conversation, create_message and get_space to MCP clients.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEDatabricks Genie API MCP Server
This project implements a Model Context Protocol (MCP) server that exposes Databricks Genie API capabilities as tools. It allows you to integrate Databricks' no-code AI/BI assistant features with other applications through a standardized interface, enabling powerful natural language querying of your Databricks data.
For a detailed explanation and example use cases, please see the accompanying blog post.
Features
- Expose Databricks Genie API functions as MCP tools.
- Enable natural language querying of Databricks data.
- Start and manage Genie conversations.
- Create and retrieve messages.
- Execute and fetch SQL query results generated by Genie.
- Secure authentication with Databricks.
Prerequisites
- Python 3.10+
- Databricks workspace with Genie access and System Tables enabled (if using them).
- Databricks Assistant enabled.
- CAN USE permission on a Pro or Serverless SQL warehouse.
- Access to Unity Catalog data relevant to your Genie Space.
- An MCP-compatible client application, such as Claude Desktop.
Setup Instructions
-
Clone the Repository (if you haven't already)
# Add clone command if needed -
Navigate to the Server Directory
cd genie_api -
Install Dependencies
pip install -r requirements.txt -
Configure Authentication
Set the required environment variables for the Databricks SDK to connect to your workspace. Create a
.envfile in this directory (genie_api/) or set them globally:# --- .env file content --- # For PAT authentication (recommended for development) # DATABRICKS_HOST=https://your-workspace.cloud.databricks.com # DATABRICKS_TOKEN=your-personal-access-token # Or for OAuth with service principal (recommended for production) DATABRICKS_HOST=https://your-workspace.cloud.databricks.com DATABRICKS_CLIENT_ID=your-client-id DATABRICKS_CLIENT_SECRET=your-client-secret # --- end .env file content ---Ensure the
.envfile is added to your `.gitignore! -
Run the Server Locally
python server.pyThe server will start and listen for connections via standard input/output (stdio).
Using with Claude Desktop
This MCP server is designed to be used with MCP clients like Claude Desktop. Follow these steps to connect:
-
Install Claude Desktop: Download and install from the official website.
-
Configure Claude Desktop:
- Open Claude Desktop settings (Menu Bar -> Claude -> Settings...).
- Go to Developer -> Edit Config.
- Add the following entry to the
mcpServersobject in theclaude_desktop_config.jsonfile, adjusting paths as needed:
{ "mcpServers": { "databricks-genie": { "command": "python", // Or python3, or the full path to your python executable "args": [ "/full/absolute/path/to/your/project/genie_api/server.py" ], "workingDirectory": "/full/absolute/path/to/your/project/genie_api/" } // ... potentially other servers ... } }- Important: Use the full absolute path to
server.pyand thegenie_apidirectory. - Ensure the Python
commandis accessible by Claude Desktop. - The
workingDirectoryensures the server can findauth.pyand your.envfile.
-
Restart Claude Desktop: Close and reopen the application.
-
Verify: Click the hammer icon (Tools) in the chat input. You should see the
databricks-genietools listed (e.g.,start_conversation,create_message).
Now you can ask Claude questions like "What was our DBU consumption last month?" or "Who accessed the PII table yesterday?", and it will use the tools provided by your local server.
For more details on configuring Claude Desktop, see the MCP Quickstart for Claude Desktop Users.
Available Tools
start_conversation: Start a new conversation in a Genie space.create_message: Create a new message in an existing conversation.get_message: Retrieve a message from a conversation.get_message_attachment_query_result: Get SQL query results from a message attachment.execute_message_attachment_query: Execute SQL for a message query attachment.get_space: Get details about a Genie space.generate_download_full_query_result: Initiate a full query result download.poll_message_until_complete: Poll a message until it reaches a terminal state.
Troubleshooting
- Authentication Issues: Verify Databricks credentials (
.envfile or environment variables) and required permissions in Databricks. - Connection Problems (Claude Desktop):
- Ensure absolute paths in
claude_desktop_config.jsonare correct. - Verify the
commandpoints to a valid Python interpreter. - Check Claude Desktop logs (
~/Library/Logs/Claude/or%APPDATA%\Claude\logs). Look formcp.logandmcp-server-databricks-genie.log. - Try running
python server.pymanually in your terminal from thegenie_apidirectory to check for errors.
- Ensure absolute paths in
- SQL Execution Errors: Ensure the service principal or user has CAN USE on a SQL warehouse and access to the relevant Unity Catalog data.
Security Considerations
- Credentials: Never hardcode credentials. Use environment variables (
.env) or secure credential stores. Ensure.envis in your.gitignore. Use OAuth with service principals for production. - MCP Security: This server runs locally with your user's permissions and Databricks credentials. Clients like Claude Desktop MUST obtain user consent before executing tools (MCP Security Specification).
- Production Deployment: Running this server for broader use requires a secure hosting strategy. Do not simply expose this local server. Work with security/DevOps to determine appropriate hosting, network controls, and potentially MCP server-level authentication. The hosting environment needs secure access to Databricks credentials (e.g., instance profiles, managed secrets). See the blog post for more discussion.
- Input Sanitization: Trust the Databricks SDK/API for input handling passed via tools.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This software is provided under a specific license granted by Databricks, Inc. Please see the LICENSE file for the full terms and conditions governing your use of this software.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.