Skip to content

Commit 15e4169

Browse files
fjakobsclaude
andauthored
Refactor aitools into command group with mcp subcommand (#4303)
## Summary Separates the `databricks experimental aitools` command into a proper command group by moving the MCP server functionality to a new `mcp` subcommand. ## NOTE This is a breaking change. Users who have installed the MCP after we renamed it from `apps-mcp` to `aitools` will have a broken MCP configuration and need to run the install command again. We are not ingesting in a clean migration we have because it has not released this widely yet and it hasn't been out for long. ## Changes - `aitools` is now a command group with no default action - New `mcp` subcommand starts the MCP server: `databricks experimental aitools mcp` - Updated installation scripts (Claude Code, Cursor) to use the new command structure - Updated documentation and examples ## Before ```bash databricks experimental aitools # started MCP server ``` ## After ```bash databricks experimental aitools mcp # starts MCP server ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent d99241f commit 15e4169

File tree

6 files changed

+34
-17
lines changed

6 files changed

+34
-17
lines changed

experimental/aitools/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ If you prefer to configure manually or the automatic installation doesn't work:
9494
"mcpServers": {
9595
"databricks": {
9696
"command": "databricks",
97-
"args": ["experimental", "aitools"],
97+
"args": ["experimental", "aitools", "mcp"],
9898
"env": {
9999
"DATABRICKS_HOST": "https://your-workspace.databricks.com",
100100
"DATABRICKS_TOKEN": "dapi...",
@@ -156,7 +156,7 @@ If the MCP server doesn't connect or shows errors:
156156
5. **Check Databricks CLI:** Verify the CLI is installed and accessible:
157157
```bash
158158
databricks --version
159-
databricks experimental aitools --help
159+
databricks experimental aitools mcp --help
160160
```
161161

162162
6. **Test authentication:** Try listing catalogs to verify credentials work:
@@ -323,8 +323,8 @@ The `invoke_databricks_cli` tool:
323323
# Install MCP server in coding agents (Claude Code, Cursor, etc.)
324324
databricks experimental aitools install
325325

326-
# Start MCP server (default mode)
327-
databricks experimental aitools
326+
# Start MCP server
327+
databricks experimental aitools mcp
328328
```
329329

330330
### Environment Variables

experimental/aitools/cmd/aitools.go

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,33 @@ import (
1313
)
1414

1515
func NewMcpCmd() *cobra.Command {
16-
var warehouseID string
17-
1816
cmd := &cobra.Command{
1917
Use: "aitools",
2018
Aliases: []string{"apps-mcp"},
2119
Hidden: true,
2220
Short: "Databricks AI Tools - Model Context Protocol server for AI agents",
23-
Long: `Start and manage an MCP server that provides AI agents with tools to interact with Databricks.
21+
Long: `Manage Databricks AI Tools and Model Context Protocol server.
22+
23+
Provides commands to:
24+
- Start an MCP server for AI agents (mcp)
25+
- Install the MCP server in coding agents (install)
26+
- Access MCP tools directly (tools)`,
27+
}
28+
29+
cmd.AddCommand(newMcpCmd())
30+
cmd.AddCommand(newInstallCmd())
31+
cmd.AddCommand(newToolsCmd())
32+
33+
return cmd
34+
}
35+
36+
func newMcpCmd() *cobra.Command {
37+
var warehouseID string
38+
39+
cmd := &cobra.Command{
40+
Use: "mcp",
41+
Short: "Start the Model Context Protocol server",
42+
Long: `Start an MCP server that provides AI agents with tools to interact with Databricks.
2443
2544
The MCP server exposes the following capabilities:
2645
- Data exploration (query catalogs, schemas, tables, execute SQL)
@@ -29,7 +48,7 @@ The MCP server exposes the following capabilities:
2948
3049
The server communicates via stdio using the Model Context Protocol.`,
3150
Example: ` # Start MCP server with required warehouse
32-
databricks experimental aitools --warehouse-id abc123`,
51+
databricks experimental aitools mcp --warehouse-id abc123`,
3352
RunE: func(cmd *cobra.Command, args []string) error {
3453
// Create cancellable context for graceful shutdown
3554
ctx, cancel := context.WithCancel(cmd.Context())
@@ -82,8 +101,5 @@ The server communicates via stdio using the Model Context Protocol.`,
82101
// Define flags
83102
cmd.Flags().StringVar(&warehouseID, "warehouse-id", "", "Databricks SQL Warehouse ID")
84103

85-
cmd.AddCommand(newInstallCmd())
86-
cmd.AddCommand(newToolsCmd())
87-
88104
return cmd
89105
}

experimental/aitools/cmd/tools.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import (
88
func newToolsCmd() *cobra.Command {
99
cmd := &cobra.Command{
1010
Use: "tools",
11-
Short: "MCP tools for AI agents",
12-
Hidden: true,
11+
Short: "CLI tools for AI agents",
12+
Long: `CLI tools to be used by AI agents. These tools are optimized for AI coding agents like Claude Code and Cursor. The tools can change at any time. There are no stability guarantees for these tools.`,
13+
Hidden: false,
1314
}
1415

1516
cmd.AddCommand(newQueryCmd())

experimental/aitools/lib/agents/claude.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func InstallClaude() error {
3232
"--transport", "stdio",
3333
"databricks-mcp",
3434
"--",
35-
databricksPath, "experimental", "aitools")
35+
databricksPath, "experimental", "aitools", "mcp")
3636

3737
output, err := cmd.CombinedOutput()
3838
if err != nil {

experimental/aitools/lib/agents/cursor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func InstallCursor() error {
8484
// Add or update the Databricks AI Tools MCP server entry
8585
config.McpServers["databricks-mcp"] = mcpServer{
8686
Command: databricksPath,
87-
Args: []string{"experimental", "aitools"},
87+
Args: []string{"experimental", "aitools", "mcp"},
8888
}
8989

9090
// Write back to file with pretty printing

experimental/aitools/lib/agents/custom.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ func ShowCustomInstructions(ctx context.Context) error {
1212
To install the Databricks CLI MCP server in your coding agent:
1313
1414
1. Add a new MCP server to your coding agent's configuration
15-
2. Set the command to: "databricks experimental aitools"
15+
2. Set the command to: "databricks experimental aitools mcp"
1616
3. No environment variables or additional configuration needed
1717
1818
Example MCP server configuration:
1919
{
2020
"mcpServers": {
2121
"databricks": {
2222
"command": "databricks",
23-
"args": ["experimental", "aitools"]
23+
"args": ["experimental", "aitools", "mcp"]
2424
}
2525
}
2626
}

0 commit comments

Comments
 (0)