Enables AI assistants to interact with Databricks workspaces through prompts and tools, providing access to clusters, job management, SQL execution, and other Databricks SDK functionality
Databricks MCP Server
Host Model Context Protocol (MCP) prompts and tools on Databricks Apps, enabling AI assistants like Claude to interact with your Databricks workspace.
What is this?
This template lets you create an MCP server that runs on Databricks Apps. You can:
- Add prompts as simple markdown files in the
prompts/
folder - Create tools as Python functions that leverage Databricks SDK
A bridge between Claude and your Databricks workspace - you define what Claude can see and do, and this server handles the rest.
How it Works
Architecture Overview
Components
- MCP Server (
server/app.py
): A FastAPI app with integrated MCP server that:- Dynamically loads prompts from
prompts/*.md
files - Exposes Python functions as MCP tools via
@mcp_server.tool
decorator - Handles both HTTP requests and MCP protocol over Server-Sent Events
- Dynamically loads prompts from
- Prompts (
prompts/
): Simple markdown files where:- Filename = prompt name (e.g.,
check_system.md
→check_system
prompt) - First line with
#
= description - File content = what gets returned to Claude
- Filename = prompt name (e.g.,
- Local Proxy (
dba_mcp_proxy/
): Authenticates and proxies MCP requests:- Handles Databricks OAuth authentication automatically
- Translates between Claude's stdio protocol and HTTP/SSE
- Works with both local development and deployed apps
Prerequisites
- Claude CLI
- Subscription to Databricks apps
- python
Local Development
The prompt will be automatically loaded with:
- Name: filename without extension (e.g.,
get_clusters.md
→get_clusters
) - Description: first line after
#
- Content: entire file content
Alternatively, you can register prompts as functions in server/app.py
:
We auto-load prompts/
for convenience, but function-based prompts are useful when you need dynamic content.
Adding Tools
Add a function in server/app.py
using the @mcp_server.tool
decorator:
Tools must:
- Use the
@mcp_server.tool
decorator - Have a docstring (becomes the tool description)
- Return JSON-serializable data (dict, list, str, etc.)
- Accept only JSON-serializable parameters
Deployment
Your MCP server will be available at https://your-app.databricksapps.com/mcp/
The app_status.sh
script will show your deployed app URL, which you'll need for the DATABRICKS_APP_URL
environment variable when adding the MCP server to Claude.
Authentication
- Local Development: No authentication required
- Production: OAuth is handled automatically by the proxy using your Databricks CLI credentials
Examples
Using with Claude
Once added, you can interact with your MCP server in Claude:
Sample Tool Usage
Project Structure
Advanced Usage
Environment Variables
Configure in .env.local
:
Creating Complex Tools
Tools can access the full Databricks SDK:
Testing Your MCP Server
This template includes comprehensive testing tools for validating MCP functionality at multiple levels.
Quick Verification
After adding the MCP server to Claude, verify it's working:
Comprehensive Testing Suite
The claude_scripts/
directory contains 6 testing tools for thorough MCP validation:
Command Line Tests
Interactive Web UI Tests
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables AI assistants like Claude to interact with Databricks workspaces through custom prompts and tools. Supports running SQL queries, managing clusters, creating jobs, and accessing workspace resources via the Databricks SDK.
Related MCP Servers
- AsecurityAlicenseAqualityActs as a bridge between AI assistants and StarRocks databases, allowing for direct SQL execution and database exploration without requiring complex setup or configuration.Last updated -6117Apache 2.0
- -securityAlicense-qualityA 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.Last updated -GPL 3.0
- -securityFlicense-qualityEnables AI assistants like Claude to interact with Databricks workspaces through secure OAuth authentication. Supports custom prompts, tools for cluster management, SQL execution, and job operations via the Databricks SDK.Last updated -10
- -securityFlicense-qualityEnables AI assistants like Claude to interact with Databricks workspaces through secure OAuth authentication. Supports custom prompts, tools for cluster management, SQL execution, and job operations via the Databricks SDK.Last updated -