Repository navigation
Add non-interactive aitools mcp add behind a hidden group - #7544
Merged
Merged
Conversation
simonfaltum
force-pushed
the
aitools-mcp/03-state
branch
from
November 12, 2026 12:11
99f703a to
39c0dec
Compare
simonfaltum
force-pushed
the
aitools-mcp/04-add
branch
from
November 12, 2026 12:11
8dfe722 to
99311a2
Compare
Contributor
|
Commit: Regression test reportSelected 9 changed tests (limit=20, 0 not selected) 9 tests: regression=9 unreleased=0 coverage=0 failing=0
TestAccept/cmd/aitools/mcp/add-agent-not-installed: branch ✅ | main (a96c087) ❌ | latest (v1.27.0) ❌main (a96c087): latest (v1.27.0): TestAccept/cmd/aitools/mcp/add-default-config: branch ✅ | main (a96c087) ❌ | latest (v1.27.0) ❌main (a96c087): latest (v1.27.0): TestAccept/cmd/aitools/mcp/add-name-notices: branch ✅ | main (a96c087) ❌ | latest (v1.27.0) ❌main (a96c087): latest (v1.27.0): TestAccept/cmd/aitools/mcp/add-text: branch ✅ | main (a96c087) ❌ | latest (v1.27.0) ❌main (a96c087): latest (v1.27.0): TestAccept/cmd/aitools/mcp/add-two-agents: branch ✅ | main (a96c087) ❌ | latest (v1.27.0) ❌main (a96c087): latest (v1.27.0): 4 more failure details omitted, see the full report in the run. |
Collaborator
✅ Integration test reportCommit: 742a896
Top 11 slowest tests (at least 2 minutes):
|
simonfaltum
force-pushed
the
aitools-mcp/03-state
branch
from
November 12, 2026 14:25
39c0dec to
acc3ee6
Compare
simonfaltum
force-pushed
the
aitools-mcp/04-add
branch
3 times, most recently
from
November 12, 2026 19:33
f3c3d22 to
182ccf9
Compare
simonfaltum
force-pushed
the
aitools-mcp/03-state
branch
from
November 13, 2026 15:05
1dade3d to
03c01a0
Compare
simonfaltum
force-pushed
the
aitools-mcp/04-add
branch
from
November 13, 2026 15:05
39b5bc1 to
aa53c0e
Compare
simonfaltum
force-pushed
the
aitools-mcp/03-state
branch
from
November 16, 2026 12:47
03c01a0 to
8356812
Compare
simonfaltum
force-pushed
the
aitools-mcp/04-add
branch
from
November 16, 2026 12:47
aa53c0e to
86996e1
Compare
simonfaltum
force-pushed
the
aitools-mcp/03-state
branch
from
November 16, 2026 13:19
8356812 to
c1301e6
Compare
simonfaltum
force-pushed
the
aitools-mcp/04-add
branch
from
November 16, 2026 13:19
86996e1 to
24cec5b
Compare
simonfaltum
force-pushed
the
aitools-mcp/03-state
branch
from
November 16, 2026 13:32
c1301e6 to
94587e4
Compare
simonfaltum
force-pushed
the
aitools-mcp/04-add
branch
from
November 16, 2026 13:32
24cec5b to
3e359a6
Compare
simonfaltum
force-pushed
the
aitools-mcp/03-state
branch
from
November 16, 2026 14:49
94587e4 to
a9c735c
Compare
simonfaltum
force-pushed
the
aitools-mcp/04-add
branch
from
November 16, 2026 14:49
3e359a6 to
73db797
Compare
simonfaltum
force-pushed
the
aitools-mcp/03-state
branch
from
November 16, 2026 15:53
a9c735c to
fa4d812
Compare
simonfaltum
force-pushed
the
aitools-mcp/04-add
branch
2 times, most recently
from
November 17, 2026 10:52
113a0d4 to
2ad5e5b
Compare
simonfaltum
force-pushed
the
aitools-mcp/03-state
branch
from
November 17, 2026 10:52
fa4d812 to
13dc173
Compare
simonfaltum
force-pushed
the
aitools-mcp/04-add
branch
from
November 17, 2026 12:02
631f7bd to
64f9579
Compare
simonfaltum
force-pushed
the
aitools-mcp/03-state
branch
from
November 17, 2026 12:02
13dc173 to
3233f8f
Compare
simonfaltum
force-pushed
the
aitools-mcp/04-add
branch
from
November 17, 2026 12:36
64f9579 to
e4be8db
Compare
simonfaltum
force-pushed
the
aitools-mcp/03-state
branch
from
November 17, 2026 15:11
2d1b8f3 to
1d8c127
Compare
simonfaltum
force-pushed
the
aitools-mcp/04-add
branch
from
November 17, 2026 15:11
763aebd to
2c5b663
Compare
simonfaltum
marked this pull request as ready for review
November 18, 2026 16:20
anton-107
approved these changes
Nov 19, 2026
anton-107
left a comment
Contributor
There was a problem hiding this comment.
Approving. Nothing blocking in what this PR adds on top of aitools-mcp/03-state. I read the diff and ran the unit tests and the aitools acceptance tests on 2c5b663; both pass. I also tried a few extra cases with a built binary: the state file deleted, an entry renamed by hand, detected agents, and a missing default config file.
Non-blocking notes:
- The description puts
FindEntryunder "Refactors, no behavior change", but it now compares services withstrings.EqualFold(libs/aitools/mcp/binding.go), andBindinherits that. It belongs under new behavior. - "A conflict in a detected agent fails only that agent" doesn't cover agents that hold the binding under two names. That case still refuses the whole run without
--agents. I tried it: renamed the Cursor entry, deleted the state, ran with detected agents. The message says what to do, so this may be intended. If so, the description could say so. - In detected mode, a binary on PATH is enough for a config to be written. A stub
geminion PATH created~/.gemini/settings.json, and thecodexon my own PATH was picked up too. It's a listed decision, but it's the one I'd look at again before the group is unhidden. - Windows, not verified:
exec.LookPathreturnsErrDotfor a binary found only in the working directory. So runningdatabricksfrom the folder of an unzippeddatabricks.exewrites the bare name, and the agent can't start it unlessdatabricksis on PATH. The note is printed. Anos.Executable()fallback for just that case might be worth it.
Member
Author
|
Thanks!
|
simonfaltum
force-pushed
the
aitools-mcp/04-add
branch
from
November 19, 2026 11:42
3a2b3bf to
d7e527f
Compare
simonfaltum
force-pushed
the
aitools-mcp/03-state
branch
2 times, most recently
from
November 19, 2026 12:33
5191786 to
01d1905
Compare
One commit for the restack onto main. The individual commits, up to 3a2b3bf, are in the pull request's history. Co-authored-by: Isaac <no-reply@databricks.com>
simonfaltum
force-pushed
the
aitools-mcp/04-add
branch
from
November 19, 2026 13:06
d7e527f to
742a896
Compare
simonfaltum
enabled auto-merge
November 19, 2026 13:07
Collaborator
❌ Integration test reportCommit: 70d24e3
1240 interesting tests: 1210 MISS, 13 RECOVERED, 10 FAIL, 5 PANIC, 2 KNOWN
Top 50 slowest tests (at least 2 minutes):
|
idelafuente-oc
pushed a commit
to idelafuente-oc/cli
that referenced
this pull request
Nov 20, 2026
This pull request is part of a stack that adds the hidden `databricks aitools mcp` command group, on top of databricks#7544 (`aitools mcp add`). It adds `list`, which shows installed servers and their drift, and `remove`, which deletes only the entries this CLI wrote. ## Changes - `aitools mcp list` groups servers by profile and shows each agent entry as `installed`, `changed` (`add` would write it differently), `missing_on_disk`, `modified`, `path_changed`, or `unknown` (the entry or its config could not be read). Profile drift is `profile_missing` or `host_changed`. Entries this CLI did not write are listed as unmanaged. It makes no network calls. - `aitools mcp remove` chooses servers with `--names`, `--profile` or `--all`, and narrows agents with `--agents`. It deletes an entry only when it is the one this CLI wrote. - An entry of the same name that this CLI did not write, and that is not a Databricks entry, is left in place and reported. The install record for that agent is dropped, in the recorded file, the file the agent reads now, or both. The run is not refused. `list` and `remove` offer no delete or `add --force` hint for such an entry. - A changed Databricks entry is left in place and reported. A `--names` run that names its server is refused. - With `--names`, a run refuses before anything is written when a named server has a changed Databricks entry, when its records are all for agents this CLI does not know, or when `--agents` narrows it to no agent. It removes nothing and exits 1. The reason is in `skipped`, or in `error` for the `--agents` case. Records for an unknown agent are kept and reported as skipped, so an older CLI does not drop a newer CLI's records. - When an agent's config directory moved, `remove` takes the entry from the file the agent now reads, if the record's file lost it. - `add` records absolute config paths, so `remove` run from another directory finds the same file. - `serve` hints name `databricks aitools mcp remove --names <server>`. An empty `[DEFAULT]` section reads as "no longer exists" instead of "has no host". ## Why After `add`, nothing shows which servers are installed, whether their profile still exists, or whether an agent config changed under them. `remove` deletes only what this CLI wrote, so an entry a user wrote under the same name is never touched. ## Decisions to review - Moved config: `remove` edits the file the agent now reads, rather than refusing. Cost: it edits a file the record does not name, under the same ownership check. - A same-name entry this CLI did not write, which is not a Databricks entry, is left alone and its record is dropped, rather than refusing the run. Cost: the server no longer shows in `list` for that agent, while the entry stays in the agent config. - `--names` matches a server name exactly, then without case. A service name applies to every profile unless `--profile` narrows it. - An unreadable agent config is a warning, and its servers are `unknown`, rather than failing `list` and hiding the other agents. Cost: a broken file leaves its servers unchecked until fixed. - A `--names` run refuses when a named server has a changed Databricks entry, rather than removing the others and exiting 0. Cost: the user reruns without that name to remove the rest. - A changed Databricks entry keeps its state record, so `list` keeps showing it. Its hint says to delete the entry by hand, and never offers `add --force`, because `add` refuses a Databricks entry for another binding whatever `--force` says. ## Tests - `TestBuildMcpListAndRemoveAgreeAfterConfigMoved` covers both moved-config cases. `TestSelectInstallsExactServerNameWins` covers name matching. `TestRenderMcpListLeavesOtherEntryAlone` covers the `list` hint for a non-Databricks entry. - `TestMcpRemoveDropsRecordOfEntryThisCLIDidNotWrite`, `TestMcpRemoveDropsRecordWhenMovedConfigHasOtherEntry` and `TestMcpRemoveLeavesOtherSameNameEntryWhenAgentConfigMoved` cover the record drop without a refusal, and leave the other entry untouched. - `TestMcpRemoveRefusesWhenNamedEntryIsKept`, `TestMcpRemoveKeepsServerWhenMovedConfigHasChangedDatabricksEntry` and `TestMcpRemoveRefusesNamedEntryWithOnlyUnknownAgent` cover the refusals. `TestMcpRemoveRefusesNamedServerThatAgentsNarrowsToNothing` covers the `--agents` refusal. `TestMcpRemoveKeepsRecordOfUnknownAgent` covers the kept record. - Acceptance `list-and-remove`, `drift-profile-missing` and `repair-and-warnings` cover text and JSON output. - `go test ./cmd/aitools/` and `go test ./acceptance -run TestAccept/cmd/aitools/mcp` pass. - Not tested: the Windows and macOS acceptance goldens. CI runs them. ## How to review Refactors that keep behavior: the agent-config reader and ownership check in `libs/aitools/mcp/agentconfig/` (`unmanaged.go`, `writer.go`), `AbsoluteAsWritten` moved to `libs/aitools/mcpconfig/abspath.go`, and the helpers in `cmd/aitools/mcp_entries.go` that list and remove share. Read closely: `cmd/aitools/mcp_list.go` for statuses and warnings, and `cmd/aitools/mcp_remove.go` for selection, the per-copy plan in `planRemoval`, and the moved-config path. This pull request and its description were written by Isaac. Co-authored-by: Isaac <no-reply@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request is part of the stack that adds the hidden
databricks aitools mcpcommand group. It builds on #7537 and addsaitools mcp add, which installs Databricks managed MCP servers into coding agents non-interactively, bound to one CLI profile.Changes
aitools mcp add --names ... --agents ...installs full names (system.ai.github) or leaf names into the named agents, or into every detected agent without--agents. Leaf names resolve in--location, which defaults tosystem.aior to the one schema the full names share. A leaf next to full names outsidesystem.aiis refused.--force.InstalledForMCPcounts an agent as installed when its config directory, skills, MCP file or a binary on PATH is present. A home variable (CODEX_HOME,COPILOT_HOME,CLAUDE_CONFIG_DIR,GEMINI_CLI_HOME,XDG_CONFIG_HOME) set away from its default leaves only the MCP file's directory to count.--nameand stored names over 32 characters (mcp.MaxServerNameLen) are refused, as are invalid names.databricks aitools mcp serve, withDATABRICKS_CONFIG_FILEpinned when it is set. The binary path comes from argv at run time, made absolute when possible. When PATH finds it only in the working directory (exec.ErrDot, which Windows returns), the running executable's absolute path is used. Otherwise the output notes that agents must finddatabrickson PATH.?w=is auto-detected. On Windows, a drive-relative path is refused unless it is on the working directory's drive.--agentsonly for named agents. A successful add prints the service's note, if it has one.Why
Coding agents cannot use Databricks managed MCP servers yet. The state and agent-config writers from the earlier PRs need a command that calls them. The group stays hidden until
servelands, so no release ships an entry that cannot start.Decisions to review
addstill fails when a requested service reaches no agent.serveruns, so both commands print the same text. Without an install record it names the service and how to set it up, with noremovehint.UNKNOWN_AGENTcovers a known agent that is not installed. No telemetry category fits.--forceoverride.addcreates its config directory on the first write.How to review
Refactors, no behavior change:
Bindis split intoCheckBinding,BoundConfigandAuthenticateBound(libs/aitools/mcp/binding.go). The exported helpers areResolveConfigFileandAbsoluteAsWritten(configfile.go),ErrProfileMissing(state.go),SystemAILocation(known.go), andmcpconfig.EnvKeys(mcpconfig/spec.go).New behavior, to read closely:
FindEntry(binding.go), now exported, matches services ignoring case, as Unity Catalog names do, andBindinherits that;cmd/aitools/mcp_add.go(planAdds,chooseName,locationOf,agentFailureError),libs/aitools/agents/agents.go(InstalledForMCP,mcpHomeMoved),cmd/aitools/mcp.go(mcpWorkspaceProfile), and the drive-relative rule inAbsoluteAsWritten.Tests
cmd/aitools: name planning and conflicts, refusals before any request, recording when one server fails, distinct agent failures, and which agents count as installed.libs/aitools: the MCP-home presence rule, the profile check with no entry, andEntryEnv.acceptance/cmd/aitools/mcp/: two services and agents, text and JSON output, two profiles, an unparsable config, an uninstalled agent, and the hidden group.go test -raceoncmd/aitoolsandlibs/aitools, the aitools acceptance tests,GOOS=windows go vet, golangci-lint and./task checkspass.serve(a later PR), the picker, and real agent processes.This pull request and its description were written by Isaac.