Databricks-cursor-mcp
Provides tools for managing Databricks workspaces, including browsing and editing notebooks, managing clusters and jobs, running SQL queries, and performing DBFS file operations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Databricks-cursor-mcpList my Databricks clusters"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Databricks MCP Server for Cursor
30 powerful tools to manage Databricks directly from Cursor IDE with AI assistance.
π Quick Setup
Prerequisites
Node.js v14+ (
node --version) β if missing, runbrew install nodeDatabricks CLI (
databricks --version) β if missing, runbrew install databricksDatabricks account with OAuth access
Installation
# 1. Clone or download this directory
git clone https://github.com/nayantarasundarraj-hue/Databricks-cursor-mcp.git ~/databricks-mcp-server
cd ~/databricks-mcp-server
# 2. Install dependencies
npm install
# 3. Verify installation
npm test
# 4. Authenticate with Databricks
databricks auth login --profile dev --host https://YOUR-WORKSPACE.cloud.databricks.com
# 5. Verify your paths (note these down for the config below)
which node
which databricks
# 6. Configure CursorEdit ~/.cursor/mcp.json:
{
"mcpServers": {
"databricks": {
"command": "node",
"args": [
"/Users/YOUR_USERNAME/databricks-mcp-server/server.js"
],
"env": {
"PATH": "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
"DATABRICKS_PROFILE": "dev",
"DATABRICKS_WORKSPACE_HOST": "YOUR-WORKSPACE.cloud.databricks.com"
}
}
}
}Important:
Replace
YOUR_USERNAMEwith your macOS username andYOUR-WORKSPACEwith your Databricks workspace hostname.DATABRICKS_PROFILEmust match the profile name you used duringdatabricks auth login. Common values aredev,affirm-prod, orDEFAULT. Check~/.databrickscfgto see your profiles.If you get
node: command not found, runwhich nodeand replace"node"with the full path (e.g./opt/homebrew/bin/node).
6. Restart Cursor
Quit completely (Command + Q / Alt + F4) and reopen. Wait 10-15 seconds.
Related MCP server: Databricks MCP Server
β Verify It Works
In Cursor, ask:
"List my Databricks clusters"
"List notebooks in /Users/"
"Show me available Databricks tools"
π οΈ What You Get - 30 Tools
π Browse & Read (5)
list_notebooks- Browse foldersget_notebook- Read contentlist_clusters- Show clusterslist_jobs- Show jobsget_job_details- Job info
β‘ Execute & Monitor (5)
run_notebook- Execute with parametersget_run- Check statusget_run_output- Get resultscancel_run- Stop executionlist_runs- View history
βοΈ Edit Notebooks (3) - with Auto-Backup!
export_notebook- Downloadimport_notebook- Upload with backupget_notebook_revisions- View history
π₯οΈ Manage Clusters (4)
start_cluster- Wake upstop_cluster- Save costsget_cluster_status- Check statusrestart_cluster- Restart
π Job Operations (2)
run_job- Trigger jobsget_job_runs- View runs
π DBFS Operations (4)
list_dbfs- Browse filesystemread_dbfs_file- Read filesupload_to_dbfs- Uploaddownload_from_dbfs- Download
π SQL Queries (2)
execute_sql- Run querieslist_sql_warehouses- List warehouses
π Workspace Management (3)
create_notebook- Create newdelete_notebook- Removemove_notebook- Organize
π¦ Library Management (2)
list_cluster_libraries- Show installedinstall_library- Add packages
π‘ Usage Examples
Edit code safely:
"Add import pandas as pd to /Users/me/notebook"Save money:
"Stop all idle clusters"Query data:
"Run this SQL on warehouse abc123: SELECT * FROM users LIMIT 10"Automate workflows:
"Run /Users/me/ETL on cluster X with params date=2024-01-20"π Safety Features
β Path validation β all local file operations are restricted to your home directory and /tmp; sensitive paths (.ssh, .aws, .env, .kube, etc.) are blocked
β Shell injection prevention β uses
execFileSync(notexecSync), no shell interpretationβ Human-in-the-loop (HIL) β 8 operations require explicit user confirmation:
run_notebook,run_job,delete_notebook,move_notebook,stop_cluster,restart_cluster,upload_to_dbfs,install_libraryβ SQL blocklist β DDL/DML/Databricks-specific statements (DROP, DELETE, INSERT, COPY INTO, CALL, VACUUM, etc.) require confirmation; read-only SQL runs immediately
β Error sanitization β OAuth tokens, URLs, and internal paths are stripped from error messages
β Language validation β only PYTHON, SQL, SCALA, R accepted for notebook creation
β Pinned dependencies β SDK version locked to prevent supply chain attacks
β Automatic local backup on notebook edits (timestamped)
β New Databricks revision on import (UI rollback)
β οΈ Agentic Deployment Warning
This MCP exposes both read and write tools in a single server. In an agentic context where the AI processes untrusted content (web pages, Slack messages, RAG documents, emails), a prompt injection could chain read operations (e.g., get_notebook, read_dbfs_file) with write/exec operations (e.g., execute_sql, upload_to_dbfs).
Recommendations:
Do NOT co-install this MCP in an agent that also has tools reading untrusted external content (web fetch, Slack search, RAG over external docs, mailbox readers) without understanding this risk.
Always review HIL confirmation prompts carefully β they show the full operation details including file paths and SQL queries.
For high-security environments, consider disabling write tools via
disabledToolsin your Cursor MCP config and only enabling the read-only subset.
π Troubleshooting
"node: command not found"
Cursor doesn't load your shell config (.zshrc), so it may not find node. Run which node in your terminal and use that full path as the command value in your mcp.json.
"databricks not found" on tool calls
Same issue β Cursor can't find the Databricks CLI. Make sure the PATH in your config env includes the directory from which databricks (usually /opt/homebrew/bin or /usr/local/bin).
"npm: command not found"
You need Node.js installed:
brew install nodeThen retry npm install.
"Cannot find module @modelcontextprotocol/sdk"
cd ~/databricks-mcp-server
npm install"Authentication failed" or "Token expired"
databricks auth login --profile YOUR_PROFILE --host https://YOUR-WORKSPACE.cloud.databricks.com
# Then restart Cursor (Cmd+Q, reopen)"Profile not found"
Make sure DATABRICKS_PROFILE in your mcp.json matches a profile in ~/.databrickscfg. Run cat ~/.databrickscfg to check.
Tools not showing in Cursor
Check the absolute path in
mcp.jsonis correctQuit Cursor completely (Cmd+Q) and reopen
Wait 10-15 seconds
Check Settings β MCP for connection status
Check logs: View β Output β "Model Context Protocol"
π Project Structure
databricks-mcp-server/
βββ server.js # Main MCP server (1,380 lines)
βββ package.json # Dependencies
βββ node_modules/ # Installed packages (auto-created)
βββ README.md # This fileπ€ Contributing
To add new tools:
Add method in
server.js:
async myNewTool(args) {
const result = await this.executeCLI(['my-command', 'subcommand', args.param, '--output', 'json']);
return JSON.parse(result);
}Register in
setupHandlers():
case 'my_new_tool':
const result = await this.myNewTool(args);
return { content: [{ type: 'text', text: JSON.stringify(result) }] };Add tool definition in
ListToolsRequestSchemahandlerTest and commit!
π License
MIT - Feel free to modify and share
π¬ Support
Issues? Check troubleshooting above or ask the team!
This server cannot be deployed
Maintenance
Related MCP Connectors
Your Databricks Lakehouse in natural language: run SQL on your SQL warehouses, track long-running qu
Remote data science agents for Snowflake, Databricks & BigQuery in Claude/Cursor via MCP
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Manage files and folders directly from your workspace. Read and write files, list directories, creβ¦
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables 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.2-
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to access enterprise data from Unity Catalog (vector search, functions, Genie spaces) and perform developer actions in Databricks like managing notebooks and running jobs.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Databricks workspaces programmatically, providing comprehensive tools for cluster management, notebook operations, job orchestration, Unity Catalog data governance, user management, permissions control, and FinOps cost analytics.188 npmMIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables LLMs to manage Databricks clusters, jobs, and notebooks while providing schema references for gold and silver data layers. It allows agents to perform data discovery and execute SQL queries directly against Databricks environments.MIT