
这个模板通过一个MCP服务器来利用Databricks命令执行API,使得Databricks的AI辅助开发得以实现.
概览
这个模板通过一个MCP服务器来利用Databricks命令执行API,使得Databricks的AI辅助开发得以实现. 直接在集群上进行测试代码,然后与Databricks Asset Bundles(DABs)一起部署. - 直接在 Databricks 集群上运行和测试代码 - 自动选择集群 - 无需指定集群 ID - 创建和部署 Databricks Associate Bundles (DABs) - 全部来自自然语言提示! 克隆并设置 MCP 服务器 在你的机器某处: Databricks 工作空间 – Profile – 设置 – 开发者 – Access Tokens – 生成新令牌 创建您的工程目录并安装 Databricks 技能 : 这创造了: -:.cursor/rules/ 有Databricks规则 -:.claude/ 技能/ 有Databricks技能 将您的AI客户端指向您在第1步设置的 MCP 服务器. 在您的工程中创建. cursor/ mcp.json :
概述(AI 翻译)
□ Databricks MCP 代码执行模板
这个模板通过一个MCP服务器来利用Databricks命令执行API,使得Databricks的AI辅助开发得以实现. 直接在集群上进行测试代码,然后与Databricks Asset Bundles(DABs)一起部署.
? 这有什么?
- 在Databricks集群上直接运行和测试代码
- QQ 自动选择集群 - 不需要指定集群 ID
- 创建和部署Databricks资产库
- 来自自然语言的提示!
** 请描述你想要什么 ~ AI建立,测试Databricks上的代码,并部署完整的管道。 **
– – . . .
QQ 快速启动( 建议的工作流程)
QQ 第 1 步 : 设置 MCP 服务器( 一次)
克隆并设置 MCP 服务器 在你的机器某处:
-
- 第2步:配置数据砖
添加到您的 [[T0] 或 [[T1] 中:
确保变量被装入 :
(a).
** 获取个人访问(PAT):** Databricks 工作空间 – Profile – 设置 – 开发者 – Access Tokens – 生成新令牌
- 第3步:启动新项目
创建您的工程目录并安装 Databricks 技能 :
这就产生了:
- ** ursor**:
.cursor/rules/有Databricks规则
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Databricks MCP Code Execution Template
This template enables AI-assisted development in Databricks by leveraging the Databricks Command Execution API through an MCP server. Test code directly on clusters, then deploy with Databricks Asset Bundles (DABs).
🎯 What This Does
- ✅ Run and test code directly on Databricks clusters
- ✅ Auto-select clusters - no need to specify a cluster ID
- ✅ Create and deploy Databricks Asset Bundles (DABs)
- ✅ All from natural language prompts!
Just describe what you want → AI builds, tests the code on Databricks, and deploys the complete pipeline.
🚀 Quick Start (Recommended Workflow)
Step 1: Set Up the MCP Server (One Time)
Clone and set up the MCP server somewhere on your machine:
git clone https://github.com/databricks-solutions/databricks-exec-code-mcp.git
cd databricks-exec-code-mcp
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Step 2: Configure Databricks Credentials
Add to your ~/.zshrc or ~/.bashrc:
export DATABRICKS_HOST=https://your-workspace.cloud.databricks.com
export DATABRICKS_TOKEN=dapi_your_token_here
Make sure the variables are loaded:
source ~/.zshrc
To get your Personal Access Token (PAT): Databricks workspace → Profile → Settings → Developer → Access Tokens → Generate new token
Step 3: Start a New Project
Create your project directory and install the Databricks skills:
# Create and enter your project
mkdir my-databricks-project && cd my-databricks-project
# Initialize git in your my-databricks-project project
git init .
# Install skills for your AI client (downloads from remote)
curl -sSL https://raw.githubusercontent.com/databricks-solutions/databricks-exec-code-mcp/main/install_skills.sh | bash -s -- --cursor
# Or for Claude Code:
curl -sSL https://raw.githubusercontent.com/databricks-solutions/databricks-exec-code-mcp/main/install_skills.sh | bash -s -- --claude
# Or for both:
curl -sSL https://raw.githubusercontent.com/databricks-solutions/databricks-exec-code-mcp/main/install_skills.sh | bash -s -- --all
This creates:
- Cursor:
.cursor/rules/with Databricks rules - Claude Code:
.claude/skills/with Databricks skills
Step 4: Configure Your AI Client
Point your AI client to the MCP server you set up in Step 1.
For Cursor — create .cursor/mcp.json in your project:
{
"mcpServers": {
"databricks": {
"command": "/path/to/databricks-exec-code-mcp/.venv/bin/python",
"args": ["/path/to/databricks-exec-code-mcp/mcp_tools/tools.py"]
}
}
}
For Claude Code — run in your project:
claude mcp add-json databricks '{"command":"/path/to/databricks-exec-code-mcp/.venv/bin/python","args":["/path/to/databricks-exec-code-mcp/mcp_tools/tools.py"]}'
Replace
/path/to/databricks-exec-code-mcpwith the actual path from Step 1.
Step 5: Start Prompting!
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"databricks": {
"command": "/path/to/databricks-exec-code-mcp/.venv/bin/python",
"args": ["/path/to/databricks-exec-code-mcp/mcp_tools/tools.py"]
}
}
}