Skip to content
Draft
Show file tree
Hide file tree
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
12 changes: 7 additions & 5 deletions acceptance/cmd/aitools/mcp/hidden/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,27 @@ Each server runs through 'databricks aitools mcp serve' with that profile's cred

Servers come from --names: full names such as system.ai.github, or leaf names such as github. Leaf names
resolve in --location, which defaults to system.ai, or to the one schema that the full names in --names share.
Agents come from --agents. Without it, every detected MCP-capable agent is used.
Agents come from --agents.

Interactive selection is not available yet: in a terminal, pass both --names and --agents.
With --output json, both are required.
In a terminal, the command asks for whatever is not given: the profile, the servers and the agents (detected
agents are pre-checked). It confirms the plan when it asked for any of them, and it asks before each sign-in unless
--login or --no-login is given. Without a terminal, --names is required and the agents default to every detected
MCP-capable agent. With --output json, --names and --agents are required.

Supported agents: claude-code, cursor, codex, opencode, copilot, antigravity, gemini

Usage:
databricks aitools mcp add [flags]

Flags:
--agents string Agents to install for, comma-separated (default: every detected MCP-capable agent)
--agents string Agents to install for, comma-separated (default: a picker in a terminal; otherwise every detected MCP-capable agent)
--force Overwrite an existing server with the same name that this CLI did not write
-h, --help help for add
--location string Schema to resolve leaf names in, as <catalog>.<schema> (default: system.ai, or the one schema that the full names in --names share)
--login Sign in to each sign-in-required server that was installed, after the installs
--name string Server name to use instead of the generated one; only with exactly one service
--names string Services to install: full names (system.ai.github) or leaf names (github), comma-separated
--no-login Do not sign in; print the login commands for sign-in-required servers (default)
--no-login Do not sign in; print the login commands for sign-in-required servers (default without a terminal; in a terminal, the default asks for each one)

Global Flags:
--debug enable debug logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ Error: no installed MCP server named orphan
Error: no installed MCP servers on profile typo

>>> musterr [CLI] aitools mcp remove --names genie_one_mcp-logfood --agents cursor
Error: no selected MCP server is installed for Cursor
Error: no MCP server is installed for Cursor
21 changes: 21 additions & 0 deletions cmd/aitools/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,19 @@ import (
"github.com/spf13/cobra"
)

// Prompt text shared by install, uninstall and the mcp commands.
const (
// multiSelectHelp is the description of the multi-select prompts of install and mcp add and remove.
multiSelectHelp = "space to toggle, enter to confirm"
// cancelledMessage is printed when the user declines at a prompt, and the command ends without a change.
cancelledMessage = "Cancelled."
)

// Package-level seams for testability. Tests override these via helpers in
// install_test.go.
var (
promptAgentSelection = defaultPromptAgentSelection
promptProceed = defaultPromptProceed
installSkillsForAgentsFn = installer.InstallSkillsForAgents
installPluginForAgentFn = installer.InstallPluginForAgent
recordPluginInstallsFn = installer.RecordPluginInstalls
Expand Down Expand Up @@ -509,6 +518,18 @@ func agentStateLabel(s agents.DisplayState) string {
}
}

func defaultPromptProceed() (bool, error) {
proceed := true
err := huh.NewConfirm().
Title("Proceed?").
Value(&proceed).
Run()
if err != nil {
return false, err
}
return proceed, nil
}

func defaultPromptAgentSelection(_ context.Context, scope string, choices []agentChoice) ([]*agents.Agent, error) {
options := make([]huh.Option[string], 0, len(choices))
byName := make(map[string]*agents.Agent, len(choices))
Expand Down
2 changes: 1 addition & 1 deletion cmd/aitools/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func resolveProfile(ctx context.Context, flagValue string) (string, error) {
case 1:
return profiles[0].Name, nil
}
return "", failure(categoryProfileRequired, nil, "several workspace profiles exist; pass --profile. Found: %s", strings.Join(profiles.Names(), ", "))
return "", failure(categoryProfileRequired, &profileChoice{profiles: profiles}, "several workspace profiles exist; pass --profile. Found: %s", strings.Join(profiles.Names(), ", "))
}

// profileFlag returns the root --profile value, or "" when it is not set.
Expand Down
Loading
Loading