Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[logfood]
host = $DATABRICKS_HOST
token = test-token-logfood-$UNIQUE_NAME

[dogfood]
host = $DATABRICKS_HOST
token = test-token-dogfood-$UNIQUE_NAME
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[dogfood]
host = https://adb-2.test
token = test-token-dogfood
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[dogfood]
host = $DATABRICKS_HOST
token = test-token-dogfood
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cloud = false
91 changes: 91 additions & 0 deletions acceptance/cmd/aitools/mcp/drift-profile-missing/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@

=== Both profiles get a server

>>> [CLI] aitools mcp add --profile logfood --names system.ai.genie_one_mcp --agents claude-code
Profile logfood ([DATABRICKS_URL])
Agents (named with --agents): claude-code

genie_one_mcp-logfood system.ai.genie_one_mcp
claude-code installed [TEST_TMP_DIR]/home/.claude.json

>>> [CLI] aitools mcp add --profile dogfood --names system.ai.genie_one_mcp --agents claude-code
Profile dogfood ([DATABRICKS_URL])
Agents (named with --agents): claude-code

genie_one_mcp-dogfood system.ai.genie_one_mcp
claude-code installed [TEST_TMP_DIR]/home/.claude.json

=== logfood is deleted from the Databricks config file: list reports it and exits 0

>>> [CLI] aitools mcp list
Profile dogfood ([DATABRICKS_URL], config file [TEST_TMP_DIR]/.databrickscfg)
genie_one_mcp-dogfood system.ai.genie_one_mcp Claude Code

Profile logfood (profile not found in [TEST_TMP_DIR]/.databrickscfg)
genie_one_mcp-logfood system.ai.genie_one_mcp Claude Code
broken: run `databricks aitools mcp remove --names genie_one_mcp-logfood` or `DATABRICKS_CONFIG_FILE=[TEST_TMP_DIR]/.databrickscfg databricks auth login --host [DATABRICKS_URL] --profile logfood`

=== dogfood now points at another host: list reports the host change

>>> [CLI] aitools mcp list --output json
{
"profiles": [
{
"profile": "dogfood",
"host": "https://adb-2.test",
"config_file": "[TEST_TMP_DIR]/.databrickscfg",
"status": "host_changed",
"servers": [
{
"name": "genie_one_mcp-dogfood",
"service": "system.ai.genie_one_mcp",
"host": "[DATABRICKS_URL]",
"sign_in_required": false,
"status": "host_changed",
"agents": [
{
"name": "claude-code",
"path": "[TEST_TMP_DIR]/home/.claude.json",
"status": "installed"
}
]
}
]
},
{
"profile": "logfood",
"host": "[DATABRICKS_URL]",
"config_file": "[TEST_TMP_DIR]/.databrickscfg",
"status": "profile_missing",
"servers": [
{
"name": "genie_one_mcp-logfood",
"service": "system.ai.genie_one_mcp",
"host": "[DATABRICKS_URL]",
"sign_in_required": false,
"status": "profile_missing",
"agents": [
{
"name": "claude-code",
"path": "[TEST_TMP_DIR]/home/.claude.json",
"status": "installed"
}
]
}
]
}
],
"unmanaged": [],
"warnings": []
}

=== The same change in text

>>> [CLI] aitools mcp list
Profile dogfood (https://adb-2.test, config file [TEST_TMP_DIR]/.databrickscfg)
genie_one_mcp-dogfood system.ai.genie_one_mcp Claude Code
broken: it was set up for [DATABRICKS_URL], but profile "dogfood" now points at https://adb-2.test; run `databricks aitools mcp remove --names genie_one_mcp-dogfood` and add it again

Profile logfood (profile not found in [TEST_TMP_DIR]/.databrickscfg)
genie_one_mcp-logfood system.ai.genie_one_mcp Claude Code
broken: run `databricks aitools mcp remove --names genie_one_mcp-logfood` or `DATABRICKS_CONFIG_FILE=[TEST_TMP_DIR]/.databrickscfg databricks auth login --host [DATABRICKS_URL] --profile logfood`
24 changes: 24 additions & 0 deletions acceptance/cmd/aitools/mcp/drift-profile-missing/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Isolate HOME so the agent config files and the state file land in this test directory.
sethome home
mkdir -p home/.claude
envsubst < .databrickscfg > out && mv out .databrickscfg
export DATABRICKS_CONFIG_FILE=.databrickscfg

# The service, created in the fake workspace. The fake keeps one workspace per token, so each profile gets its own copy.
MSYS_NO_PATHCONV=1 $CLI api post "/api/2.1/unity-catalog/mcp-services?parent=schemas/system.ai&mcp_service_id=genie_one_mcp" --profile logfood --json '{"comment": "Ask questions about your data"}' &> LOG.create-genie_one_mcp-logfood
MSYS_NO_PATHCONV=1 $CLI api post "/api/2.1/unity-catalog/mcp-services?parent=schemas/system.ai&mcp_service_id=genie_one_mcp" --profile dogfood --json '{"comment": "Ask questions about your data"}' &> LOG.create-genie_one_mcp-dogfood

title "Both profiles get a server"
trace $CLI aitools mcp add --profile logfood --names system.ai.genie_one_mcp --agents claude-code
trace $CLI aitools mcp add --profile dogfood --names system.ai.genie_one_mcp --agents claude-code

title "logfood is deleted from the Databricks config file: list reports it and exits 0"
envsubst < dogfood-only.databrickscfg > out && mv out .databrickscfg
trace $CLI aitools mcp list

title "dogfood now points at another host: list reports the host change"
envsubst < dogfood-moved.databrickscfg > out && mv out .databrickscfg
trace $CLI aitools mcp list --output json

title "The same change in text"
trace $CLI aitools mcp list
1 change: 1 addition & 0 deletions acceptance/cmd/aitools/mcp/help/out.test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cloud = false
77 changes: 77 additions & 0 deletions acceptance/cmd/aitools/mcp/help/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

=== list and remove help show their examples

>>> [CLI] aitools mcp list --help
List Databricks managed MCP servers installed by this CLI, grouped by profile, with the
coding agents each one is in. Entries that drifted from their profile or from the agent config are
reported. Entries in agent configs that this CLI did not write are listed as unmanaged and never changed.
Entries that run 'aitools mcp serve' but have no install record are listed as unmanaged too.

Each agent of a server has one of these statuses. The JSON output uses the same names, with underscores:
installed the entry is the one this CLI wrote
changed the entry still serves the server, but differs from what 'add' writes, for example in
an argument; running 'add' again repairs it
modified the entry was changed outside this CLI, so it no longer serves the server
missing on disk the entry is not in the agent config
path changed the agent now reads its config from another file
unknown the entry or the config could not be checked

--profile lists the servers of that profile only. Unmanaged entries have no profile, so they are not
listed then.

This command makes no network calls. It always exits 0 when entries have drifted or cannot be checked;
an entry or agent config that cannot be checked is a warning.

Usage:
databricks aitools mcp list [flags]

Examples:
databricks aitools mcp list
databricks aitools mcp list --profile logfood
databricks aitools mcp list --output json

Flags:
-h, --help[=true|false] help for list

Global Flags:
--debug[=true|false] enable debug logging
-o, --output type output type: text or json (default text)
-p, --profile string ~/.databrickscfg profile
-t, --target string bundle target to use (if applicable)

>>> [CLI] aitools mcp remove --help
Remove Databricks managed MCP servers that this CLI installed.

Choose servers with --names (server names as listed by 'aitools mcp list', or service names; the
last part of a service name, such as github, is enough when only one schema has it), --profile
(every server of one profile), or --all. --profile also narrows --names or --all to one profile, and
--agents narrows any of them to some agents.
Interactive selection is not available yet, so one of --names, --profile or --all is required.
With --profile or --all and nothing installed to remove, the command succeeds and removes nothing.

Only entries this CLI wrote are removed. An entry that this CLI did not write, and that is not a Databricks
entry, is left in place, and the install record for its agent is dropped. A Databricks entry that was changed outside
this CLI is left in place and reported, and a --names run that names its server is refused. When an agent's config
moved, the entry is removed from the file it was written to and from the file the agent reads now.
Entries that run 'aitools mcp serve' without an install record are not chosen by any flag;
'aitools mcp list' shows them as unmanaged. Provider credentials are not deleted.

Usage:
databricks aitools mcp remove [flags]

Examples:
databricks aitools mcp remove --names github-logfood
databricks aitools mcp remove --profile logfood --agents cursor
databricks aitools mcp remove --all

Flags:
--agents string Agents to remove from, comma-separated (default: every agent the server is installed for)
--all[=true|false] Remove every server this CLI installed
-h, --help[=true|false] help for remove
--names string Servers to remove: server names or service names, comma-separated

Global Flags:
--debug[=true|false] enable debug logging
-o, --output type output type: text or json (default text)
-p, --profile string ~/.databrickscfg profile
-t, --target string bundle target to use (if applicable)
3 changes: 3 additions & 0 deletions acceptance/cmd/aitools/mcp/help/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title "list and remove help show their examples"
trace $CLI aitools mcp list --help
trace $CLI aitools mcp remove --help
2 changes: 2 additions & 0 deletions acceptance/cmd/aitools/mcp/hidden/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Usage:

Available Commands:
add Install Databricks managed MCP servers into coding agents
list List Databricks managed MCP servers installed by this CLI
remove Remove Databricks managed MCP servers from coding agents

Flags:
-h, --help[=true|false] help for mcp
Expand Down
7 changes: 7 additions & 0 deletions acceptance/cmd/aitools/mcp/list-and-remove/.databrickscfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[logfood]
host = $DATABRICKS_HOST
token = test-token-logfood-$UNIQUE_NAME

[dogfood]
host = $DATABRICKS_HOST
token = test-token-dogfood-$UNIQUE_NAME
1 change: 1 addition & 0 deletions acceptance/cmd/aitools/mcp/list-and-remove/out.test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cloud = false
Loading
Loading