Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8213903
Add non-interactive aitools mcp add behind a hidden group
simonfaltum Nov 12, 2026
e40dc20
Adapt aitools mcp add to the agentconfig and mcpconfig changes
simonfaltum Nov 12, 2026
59f229a
Refuse agents named with --agents that are not installed
simonfaltum Nov 12, 2026
35db3ab
Read the MCP state from the shared skills state file in acceptance
simonfaltum Nov 12, 2026
8548e10
Export the binding helpers for aitools mcp add
simonfaltum Nov 12, 2026
d37af43
Fix review findings in aitools mcp add
simonfaltum Nov 12, 2026
3317af4
Seed the mcp acceptance services through the fake, and clear agent homes
simonfaltum Nov 12, 2026
e57b959
Fix second-round review findings in aitools mcp add
simonfaltum Nov 12, 2026
2ab04c3
Assert the profile error categories in aitools mcp add
simonfaltum Nov 12, 2026
683cdc3
Share the binding check and bound config with aitools mcp add
simonfaltum Nov 12, 2026
de52f5d
Fix third-round review findings in aitools mcp add
simonfaltum Nov 12, 2026
6aa99af
Check the profile of a service without an entry in CheckBinding
simonfaltum Nov 12, 2026
3f53557
Define the entry env keys once in mcpconfig
simonfaltum Nov 12, 2026
7f3a1f7
Count an agent with an MCP home variable by that directory only
simonfaltum Nov 12, 2026
7e00263
Name the --agent flag next to the other entry flags
simonfaltum Nov 12, 2026
a90fa2f
Refuse name conflicts before any request and keep every failure
simonfaltum Nov 12, 2026
c990f3e
Route the mcp acceptance setup output to LOG files
simonfaltum Nov 12, 2026
99a5697
Document the per-agent refusals of installServer
simonfaltum Nov 12, 2026
f423c92
Word a missing profile without an install record as not set up
simonfaltum Nov 12, 2026
aa53c0e
Resolve a missing config file with OS separators
simonfaltum Nov 12, 2026
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

[dogfood]
host = $DATABRICKS_HOST
token = test-token-dogfood
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cloud = false
42 changes: 42 additions & 0 deletions acceptance/cmd/aitools/mcp/add-agent-not-installed/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

=== An agent named with --agents that is not installed is refused; the installed agent still gets the server, and the command exits non-zero

>>> [CLI] aitools mcp add --profile logfood --names system.ai.genie_one_mcp --agents claude-code,antigravity --output json
{
"profile": "logfood",
"host": "[DATABRICKS_URL]",
"scope": "global",
"servers": [
{
"name": "genie_one_mcp-logfood",
"service": "system.ai.genie_one_mcp",
"sign_in_required": false,
"agents": [
{
"name": "claude-code",
"status": "installed",
"path": "[TEST_TMP_DIR]/home/.claude.json"
},
{
"name": "antigravity",
"status": "failed",
"error_category": "UNKNOWN_AGENT",
"message": "Antigravity is not installed; install it first or leave it out of --agents"
}
]
}
],
"error_category": "TYPE_UNSPECIFIED"
}

=== Nothing was created for Antigravity

>>> ls -A home
.claude
.claude.json
.databricks

=== With no installed agent named, the command is refused before any request, and the text output says what to do

>>> [CLI] aitools mcp add --profile logfood --names system.ai.genie_one_mcp --agents antigravity
Error: Antigravity is not installed; install it first or leave it out of --agents
17 changes: 17 additions & 0 deletions acceptance/cmd/aitools/mcp/add-agent-not-installed/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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 services of system.ai, created in the fake workspace.
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

title "An agent named with --agents that is not installed is refused; the installed agent still gets the server, and the command exits non-zero"
musterr trace $CLI aitools mcp add --profile logfood --names system.ai.genie_one_mcp --agents claude-code,antigravity --output json

title "Nothing was created for Antigravity"
trace ls -A home

title "With no installed agent named, the command is refused before any request, and the text output says what to do"
musterr trace $CLI aitools mcp add --profile logfood --names system.ai.genie_one_mcp --agents antigravity
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[logfood]
host = $DATABRICKS_HOST
token = test-token-logfood
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cloud = false
23 changes: 23 additions & 0 deletions acceptance/cmd/aitools/mcp/add-default-config/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

=== Without DATABRICKS_CONFIG_FILE the server is added for the default config file

>>> [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

=== Claude Code config has no pinned variables for the server

>>> gron.py home/.claude.json
json.mcpServers.genie_one_mcp-logfood.env = {};

=== State holds the binding with no config file

>>> jq .mcp.servers[] | {name, profile, config_file} home/.databricks/aitools/skills/.state.json
{
"name": "genie_one_mcp-logfood",
"profile": "logfood",
"config_file": ""
}
17 changes: 17 additions & 0 deletions acceptance/cmd/aitools/mcp/add-default-config/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Isolate HOME. The profile is in the default config file, so DATABRICKS_CONFIG_FILE is unset and no config file is pinned.
sethome home
mkdir -p home/.claude
envsubst < .databrickscfg > home/.databrickscfg
unset DATABRICKS_CONFIG_FILE

# The services of system.ai, created in the fake workspace.
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

title "Without DATABRICKS_CONFIG_FILE the server is added for the default config file"
trace $CLI aitools mcp add --profile logfood --names system.ai.genie_one_mcp --agents claude-code

title "Claude Code config has no pinned variables for the server"
trace gron.py home/.claude.json | grep -F 'mcpServers.genie_one_mcp-logfood.env'

title "State holds the binding with no config file"
trace jq '.mcp.servers[] | {name, profile, config_file}' home/.databricks/aitools/skills/.state.json
3 changes: 3 additions & 0 deletions acceptance/cmd/aitools/mcp/add-text/.databrickscfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[logfood]
host = $DATABRICKS_HOST
token = test-token-logfood
1 change: 1 addition & 0 deletions acceptance/cmd/aitools/mcp/add-text/out.test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cloud = false
74 changes: 74 additions & 0 deletions acceptance/cmd/aitools/mcp/add-text/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

=== Text output: Cursor approval hint, and the sign-in step for github

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

genie_one_mcp-logfood system.ai.genie_one_mcp
claude-code installed [TEST_TMP_DIR]/home/.claude.json
cursor installed [TEST_TMP_DIR]/home/.cursor/mcp.json
Cursor may ask you to approve genie_one_mcp-logfood. Run: cursor-agent mcp enable genie_one_mcp-logfood (the Cursor docs call the CLI agent), or approve it in Cursor's MCP settings.

github-logfood system.ai.github
claude-code installed [TEST_TMP_DIR]/home/.claude.json
cursor installed [TEST_TMP_DIR]/home/.cursor/mcp.json
system.ai.github needs sign-in. Run: databricks aitools mcp login system.ai.github --profile logfood
Cursor may ask you to approve github-logfood. Run: cursor-agent mcp enable github-logfood (the Cursor docs call the CLI agent), or approve it in Cursor's MCP settings.

=== Running it again re-asserts the entries, and nothing is written twice

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

genie_one_mcp-logfood system.ai.genie_one_mcp
claude-code already installed, re-asserted [TEST_TMP_DIR]/home/.claude.json
cursor already installed, re-asserted [TEST_TMP_DIR]/home/.cursor/mcp.json

github-logfood system.ai.github
claude-code already installed, re-asserted [TEST_TMP_DIR]/home/.claude.json
cursor already installed, re-asserted [TEST_TMP_DIR]/home/.cursor/mcp.json
system.ai.github needs sign-in. Run: databricks aitools mcp login system.ai.github --profile logfood

=== Cursor config

>>> cat home/.cursor/mcp.json
{
"mcpServers": {
"genie_one_mcp-logfood": {
"args": [
"aitools",
"mcp",
"serve",
"--profile",
"logfood",
"--service",
"system.ai.genie_one_mcp",
"--agent",
"cursor"
],
"command": "[CLI]",
"env": {
"DATABRICKS_CONFIG_FILE": "[TEST_TMP_DIR]/.databrickscfg"
}
},
"github-logfood": {
"args": [
"aitools",
"mcp",
"serve",
"--profile",
"logfood",
"--service",
"system.ai.github",
"--agent",
"cursor"
],
"command": "[CLI]",
"env": {
"DATABRICKS_CONFIG_FILE": "[TEST_TMP_DIR]/.databrickscfg"
}
}
}
}
18 changes: 18 additions & 0 deletions acceptance/cmd/aitools/mcp/add-text/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Isolate HOME so the agent config files and the state file land in this test directory.
sethome home
mkdir -p home/.claude home/.cursor
envsubst < .databrickscfg > out && mv out .databrickscfg
export DATABRICKS_CONFIG_FILE=.databrickscfg

# The services of system.ai, created in the fake workspace.
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=github" --profile logfood --json '{"comment": "Repositories, issues, pull requests", "config": {"source_connection": {"name": "connections/github", "options": {"oauth_provider": "OAUTH_PROVIDER_GITHUB_MCP"}}}}' &> LOG.create-github-logfood

title "Text output: Cursor approval hint, and the sign-in step for github"
trace $CLI aitools mcp add --profile logfood --names system.ai.genie_one_mcp,system.ai.github --agents claude-code,cursor

title "Running it again re-asserts the entries, and nothing is written twice"
trace $CLI aitools mcp add --profile logfood --names system.ai.genie_one_mcp,system.ai.github --agents claude-code,cursor

title "Cursor config"
trace cat home/.cursor/mcp.json
3 changes: 3 additions & 0 deletions acceptance/cmd/aitools/mcp/add-two-agents/.databrickscfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[logfood]
host = $DATABRICKS_HOST
token = test-token-logfood
9 changes: 9 additions & 0 deletions acceptance/cmd/aitools/mcp/add-two-agents/home/.claude.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"mcpServers": {
"my-server": {
"type": "stdio",
"command": "my-server",
"args": []
}
}
}
1 change: 1 addition & 0 deletions acceptance/cmd/aitools/mcp/add-two-agents/out.test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cloud = false
158 changes: 158 additions & 0 deletions acceptance/cmd/aitools/mcp/add-two-agents/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@

=== Two services for two agents, as JSON

>>> [CLI] aitools mcp add --profile logfood --names system.ai.genie_one_mcp,system.ai.github --agents claude-code,codex --output json
{
"profile": "logfood",
"host": "[DATABRICKS_URL]",
"scope": "global",
"servers": [
{
"name": "genie_one_mcp-logfood",
"service": "system.ai.genie_one_mcp",
"sign_in_required": false,
"agents": [
{
"name": "claude-code",
"status": "installed",
"path": "[TEST_TMP_DIR]/home/.claude.json"
},
{
"name": "codex",
"status": "installed",
"path": "[TEST_TMP_DIR]/home/.codex/config.toml"
}
]
},
{
"name": "github-logfood",
"service": "system.ai.github",
"sign_in_required": true,
"agents": [
{
"name": "claude-code",
"status": "installed",
"path": "[TEST_TMP_DIR]/home/.claude.json"
},
{
"name": "codex",
"status": "installed",
"path": "[TEST_TMP_DIR]/home/.codex/config.toml"
}
]
}
],
"error_category": "TYPE_UNSPECIFIED"
}

=== Claude Code config keeps the entries it already had and gets ours

>>> cat home/.claude.json
{
"mcpServers": {
"my-server": {
"type": "stdio",
"command": "my-server",
"args": []
},
"genie_one_mcp-logfood": {
"args": [
"aitools",
"mcp",
"serve",
"--profile",
"logfood",
"--service",
"system.ai.genie_one_mcp",
"--agent",
"claude-code"
],
"command": "[CLI]",
"env": {
"DATABRICKS_CONFIG_FILE": "[TEST_TMP_DIR]/.databrickscfg"
},
"type": "stdio"
},
"github-logfood": {
"args": [
"aitools",
"mcp",
"serve",
"--profile",
"logfood",
"--service",
"system.ai.github",
"--agent",
"claude-code"
],
"command": "[CLI]",
"env": {
"DATABRICKS_CONFIG_FILE": "[TEST_TMP_DIR]/.databrickscfg"
},
"type": "stdio"
}
}
}

=== Codex config

>>> cat home/.codex/config.toml
[mcp_servers.genie_one_mcp-logfood]
args = ["aitools", "mcp", "serve", "--profile", "logfood", "--service", "system.ai.genie_one_mcp", "--agent", "codex"]
command = "[CLI]"
[mcp_servers.genie_one_mcp-logfood.env]
DATABRICKS_CONFIG_FILE = "[TEST_TMP_DIR]/.databrickscfg"

[mcp_servers.github-logfood]
args = ["aitools", "mcp", "serve", "--profile", "logfood", "--service", "system.ai.github", "--agent", "codex"]
command = "[CLI]"
[mcp_servers.github-logfood.env]
DATABRICKS_CONFIG_FILE = "[TEST_TMP_DIR]/.databrickscfg"

=== State records the binding, without the time and CLI version

>>> jq .mcp | del(.servers[].installed_at, .servers[].cli_version) home/.databricks/aitools/skills/.state.json
{
"servers": [
{
"name": "genie_one_mcp-logfood",
"service": "system.ai.genie_one_mcp",
"profile": "logfood",
"host": "[DATABRICKS_URL]",
"workspace_id": "[WORKSPACE_ID]",
"sign_in_required": false,
"command": "[CLI]",
"config_file": "[TEST_TMP_DIR]/.databrickscfg",
"agents": {
"claude-code": {
"path": "[TEST_TMP_DIR]/home/.claude.json",
"scope": "user"
},
"codex": {
"path": "[TEST_TMP_DIR]/home/.codex/config.toml",
"scope": "user"
}
}
},
{
"name": "github-logfood",
"service": "system.ai.github",
"profile": "logfood",
"host": "[DATABRICKS_URL]",
"workspace_id": "[WORKSPACE_ID]",
"sign_in_required": true,
"command": "[CLI]",
"config_file": "[TEST_TMP_DIR]/.databrickscfg",
"agents": {
"claude-code": {
"path": "[TEST_TMP_DIR]/home/.claude.json",
"scope": "user"
},
"codex": {
"path": "[TEST_TMP_DIR]/home/.codex/config.toml",
"scope": "user"
}
}
}
]
}
Loading
Loading