Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions experimental/aitools/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,29 @@ func newInstallCmd() *cobra.Command {
}

func runInstall(ctx context.Context) error {
// Check for non-interactive mode with agent detection
// If running in an AI agent, install automatically without prompts
if !cmdio.IsTTY(os.Stdin) {
if os.Getenv("CLAUDECODE") != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do claude and cursor set these env vars?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Codex also sets something, and I think others do as well. I've also been using these vars for other purposes.

if err := agents.InstallClaude(); err != nil {
return err
}
cmdio.LogString(ctx, color.GreenString("✓ Installed Databricks MCP server for Claude Code"))
cmdio.LogString(ctx, color.YellowString("⚠️ Please restart Claude Code for changes to take effect"))
return nil
}
if os.Getenv("CURSOR_AGENT") != "" {
if err := agents.InstallCursor(); err != nil {
return err
}
cmdio.LogString(ctx, color.GreenString("✓ Installed Databricks MCP server for Cursor"))
cmdio.LogString(ctx, color.YellowString("⚠️ Please restart Cursor for changes to take effect"))
return nil
}
// Unknown agent in non-interactive mode - show manual instructions
return agents.ShowCustomInstructions(ctx)
}

cmdio.LogString(ctx, "")
green := color.New(color.FgGreen).SprintFunc()
cmdio.LogString(ctx, " "+green("[")+"████████"+green("]")+" Experimental Databricks AI Tools MCP server")
Expand All @@ -34,9 +57,9 @@ func runInstall(ctx context.Context) error {
cmdio.LogString(ctx, "")

yellow := color.New(color.FgYellow).SprintFunc()
cmdio.LogString(ctx, yellow("════════════════════════════════════════════════════════════════"))
cmdio.LogString(ctx, yellow(" ⚠️ EXPERIMENTAL: This command may change in future versions "))
cmdio.LogString(ctx, yellow("════════════════════════════════════════════════════════════════"))
cmdio.LogString(ctx, yellow("════════════════════════════════════════════════════════════════"))
cmdio.LogString(ctx, yellow(" ⚠️ EXPERIMENTAL: This command may change in future versions "))
cmdio.LogString(ctx, yellow("════════════════════════════════════════════════════════════════"))
cmdio.LogString(ctx, "")

cmdio.LogString(ctx, "Which coding agents would you like to install the MCP server for?")
Expand Down