From 33ff24db9c3a6d8af74bbaf2e896126fbf695eb5 Mon Sep 17 00:00:00 2001 From: Evgenii Kniazev Date: Wed, 7 Jan 2026 21:48:55 +0000 Subject: [PATCH 1/4] Fixes of scaffolding instructions --- experimental/apps-mcp/lib/prompts/flow.tmpl | 15 ++++++++------- .../apps-mcp/lib/providers/clitools/provider.go | 6 ++++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/experimental/apps-mcp/lib/prompts/flow.tmpl b/experimental/apps-mcp/lib/prompts/flow.tmpl index 50a90c16fb..58f3abc90c 100644 --- a/experimental/apps-mcp/lib/prompts/flow.tmpl +++ b/experimental/apps-mcp/lib/prompts/flow.tmpl @@ -6,15 +6,16 @@ */ -}} ## Databricks MCP Available Tools -- **databricks_discover**: Discover workspace resources and get workflow recommendations +- **databricks_discover**: MUST call first - returns scaffolding commands +- **invoke_databricks_cli**: Execute CLI commands including init-template for scaffolding - **databricks_configure_auth**: Switch workspace profile/host -- **invoke_databricks_cli**: Execute any Databricks CLI command -## Workflow Best Practices -- Use `databricks_discover` at the beginning of your session to get context-aware recommendations -- For operations affecting live environments, ask for confirmation -- Always validate before deploying -- When not sure about the user's intent, ask clarifying questions +## Critical Workflow Rules +1. ALWAYS call databricks_discover FIRST to get scaffolding guidance +2. For new apps: use invoke_databricks_cli with init-template (see below) +3. NEVER use npm/npx/vite directly - init-template creates proper Databricks bundle +4. Validate before deploying +5. Ask for confirmation on live environment changes {{.WorkspaceInfo}}{{if .WarehouseName}} Default SQL Warehouse: {{.WarehouseName}} ({{.WarehouseID}}){{else}} diff --git a/experimental/apps-mcp/lib/providers/clitools/provider.go b/experimental/apps-mcp/lib/providers/clitools/provider.go index e9d146f21a..b9573f2a81 100644 --- a/experimental/apps-mcp/lib/providers/clitools/provider.go +++ b/experimental/apps-mcp/lib/providers/clitools/provider.go @@ -92,8 +92,10 @@ func (p *Provider) RegisterTools(server *mcpsdk.Server) error { mcpsdk.AddTool(server, &mcpsdk.Tool{ - Name: "databricks_discover", - Description: "Discover available Databricks workspaces, warehouses, and get workflow recommendations. Call this FIRST when planning ANY Databricks work involving apps, dashboards, pipelines, jobs, bundles, or SQL workflows. Returns workspace capabilities and recommended tooling.", + Name: "databricks_discover", + Description: `CALL THIS FIRST before any other action. Returns essential scaffolding commands and workflow guidance. + +Without calling this first, you won't know the correct way to scaffold Databricks apps. This tool returns init-template commands that create proper bundle structure.`, }, func(ctx context.Context, req *mcpsdk.CallToolRequest, args DiscoverInput) (*mcpsdk.CallToolResult, any, error) { log.Debugf(ctx, "databricks_discover called: working_directory=%s", args.WorkingDirectory) From e187fc4dccec66881cef3c984d24602ffc67a2c4 Mon Sep 17 00:00:00 2001 From: Evgenii Kniazev Date: Thu, 8 Jan 2026 11:02:59 +0000 Subject: [PATCH 2/4] Allow npm commands after scaffolding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clarify that npm run dev/install/build are OK for development, only npm create vite should be avoided for initial scaffolding. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- experimental/apps-mcp/lib/prompts/flow.tmpl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/experimental/apps-mcp/lib/prompts/flow.tmpl b/experimental/apps-mcp/lib/prompts/flow.tmpl index 58f3abc90c..a5ca238cd0 100644 --- a/experimental/apps-mcp/lib/prompts/flow.tmpl +++ b/experimental/apps-mcp/lib/prompts/flow.tmpl @@ -13,9 +13,10 @@ ## Critical Workflow Rules 1. ALWAYS call databricks_discover FIRST to get scaffolding guidance 2. For new apps: use invoke_databricks_cli with init-template (see below) -3. NEVER use npm/npx/vite directly - init-template creates proper Databricks bundle -4. Validate before deploying -5. Ask for confirmation on live environment changes +3. For scaffolding: NEVER use `npm create vite` or `npx create-vite` - init-template creates proper Databricks bundle +4. For development: `npm run dev`, `npm install`, `npm run build` are OK after scaffolding +5. Validate before deploying +6. Ask for confirmation on live environment changes {{.WorkspaceInfo}}{{if .WarehouseName}} Default SQL Warehouse: {{.WarehouseName}} ({{.WarehouseID}}){{else}} From 8ab6941da7445e26ccb3ee12fcd4155836dbd8b3 Mon Sep 17 00:00:00 2001 From: Eugenek Date: Thu, 8 Jan 2026 11:55:58 +0000 Subject: [PATCH 3/4] Update experimental/apps-mcp/lib/providers/clitools/provider.go Co-authored-by: Lennart Kats (databricks) --- experimental/apps-mcp/lib/providers/clitools/provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/apps-mcp/lib/providers/clitools/provider.go b/experimental/apps-mcp/lib/providers/clitools/provider.go index b9573f2a81..c4abe89032 100644 --- a/experimental/apps-mcp/lib/providers/clitools/provider.go +++ b/experimental/apps-mcp/lib/providers/clitools/provider.go @@ -93,7 +93,7 @@ func (p *Provider) RegisterTools(server *mcpsdk.Server) error { mcpsdk.AddTool(server, &mcpsdk.Tool{ Name: "databricks_discover", - Description: `CALL THIS FIRST before any other action. Returns essential scaffolding commands and workflow guidance. + Description: `CALL THIS FIRST before any other action. Returns essential scaffolding commands, workflow guidance, and guidance on writing and editing Databricks source code. Without calling this first, you won't know the correct way to scaffold Databricks apps. This tool returns init-template commands that create proper bundle structure.`, }, From 08e4a76cf812fda4703a5e73dedbe159488b71c3 Mon Sep 17 00:00:00 2001 From: Evgenii Kniazev Date: Thu, 8 Jan 2026 12:23:07 +0000 Subject: [PATCH 4/4] Broaden databricks_discover description Merged improvements: mention editing code, deploying bundles, querying data, and workspace configuration context. Co-Authored-By: Claude Opus 4.5 --- experimental/apps-mcp/lib/providers/clitools/provider.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/experimental/apps-mcp/lib/providers/clitools/provider.go b/experimental/apps-mcp/lib/providers/clitools/provider.go index c4abe89032..490e3e8b54 100644 --- a/experimental/apps-mcp/lib/providers/clitools/provider.go +++ b/experimental/apps-mcp/lib/providers/clitools/provider.go @@ -93,9 +93,9 @@ func (p *Provider) RegisterTools(server *mcpsdk.Server) error { mcpsdk.AddTool(server, &mcpsdk.Tool{ Name: "databricks_discover", - Description: `CALL THIS FIRST before any other action. Returns essential scaffolding commands, workflow guidance, and guidance on writing and editing Databricks source code. + Description: `CALL THIS FIRST before any Databricks work. Returns essential scaffolding commands, workflow guidance, and guidance on writing and editing Databricks source code. -Without calling this first, you won't know the correct way to scaffold Databricks apps. This tool returns init-template commands that create proper bundle structure.`, +This tool provides context needed for scaffolding new projects, editing existing code, deploying bundles, and querying data. Without calling this first, you won't know the correct CLI patterns or workspace configuration.`, }, func(ctx context.Context, req *mcpsdk.CallToolRequest, args DiscoverInput) (*mcpsdk.CallToolResult, any, error) { log.Debugf(ctx, "databricks_discover called: working_directory=%s", args.WorkingDirectory)