Provides tools for interacting with Databricks workspaces, including cluster management, job creation and execution, SQL query execution via SQL warehouses, and workspace resource management through the Databricks SDK
🤖 Databricks MCP Server Template
Host Model Context Protocol (MCP) prompts and tools on Databricks Apps, enabling AI assistants like Claude to interact with your Databricks workspace through a secure, authenticated interface.
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
- 🔐 Authenticate securely with OAuth through Databricks Apps
- 🚀 Deploy instantly to make your MCP server accessible to Claude
Think of it as 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
🎬 Demo
This 10-minute video shows you how to set up and use a Databricks MCP server with Claude: https://www.youtube.com/watch?v=oKE59zgb6e0
This video demonstrates creating your own MCP server with a custom jobs interface in Claude.
Quick Start
Create Your Own MCP Server
Step 1: Use this template
Or use the GitHub CLI:
Step 2: Clone and setup
This will:
- Configure Databricks authentication
- Set your MCP server name
- Install all dependencies
- Create your
.env.local
file
Step 3: Deploy with Claude
In Claude Code, run:
This will:
- Deploy your MCP server to Databricks Apps
- Configure the MCP integration
- Show you available prompts and tools
Then restart Claude Code to use your new MCP server.
Add to Claude CLI
After deployment, add your MCP server to Claude:
Local Development
Customization Guide
This template uses FastMCP, a framework that makes it easy to build MCP servers. FastMCP provides two main decorators for extending functionality:
@mcp_server.prompt
- For registering prompts that return text@mcp_server.tool
- For registering tools that execute functions
Adding Prompts
The easiest way is to create a markdown file in the prompts/
directory:
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
MCP Inspector Features:
- 🖥️ Web-based interface for interactive MCP server testing
- 🔧 Visual tool execution with parameter input forms
- 📊 Real-time request/response monitoring
- 🐛 Protocol-level debugging and error inspection
- 📋 Complete tool and resource discovery
What Each Test Validates
Test Type | Authentication | Protocol | Session Management | Tool Discovery |
---|---|---|---|---|
curl tests | ✅ | ✅ | ✅ | ✅ |
proxy tests | ✅ | ✅ | ✅ | ✅ |
MCP Inspector | ✅ | ✅ | ✅ | ✅ |
All tests dynamically discover app URLs and handle OAuth authentication automatically.
See claude_scripts/README.md
for detailed documentation.
Troubleshooting
- Authentication errors: Run
databricks auth login
to refresh credentials - MCP not found: Ensure the app is deployed and accessible
- Tool errors: Check logs at
https://your-app.databricksapps.com/logz
- MCP connection issues:
- Check Claude logs:
tail -f ~/Library/Logs/Claude/*.log
- Verify the proxy works:
uvx --from git+ssh://... dba-mcp-proxy --help
- Test with echo pipe:
echo "list your mcp commands" | claude
- Check Claude logs:
- Cached version issues: If you get errors about missing arguments after an update:
Contributing
- Fork the repository
- Add your prompts and tools
- Test locally with
./watch.sh
- Submit a pull request
License
See LICENSE.md
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables 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.
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants to interact with Databricks workspaces, allowing them to browse Unity Catalog, query metadata, sample data, and execute SQL queries.Last updated -PythonMIT License
- -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 -PythonGPL 3.0
- -securityFlicense-qualityProvides intelligent dbt assistance through Claude Code integration, enabling users to perform dbt CLI operations, explore project metadata, and execute SQL queries against DuckDB warehouse with context-aware support.Last updated -1Python
- AsecurityAlicenseAqualityProvides flexible access to Oracle databases for AI assistants like Claude, supporting SQL queries across multiple schemas with comprehensive database introspection capabilities.Last updated -62JavaScriptMIT License