Repository navigation
Add non-interactive aitools mcp add behind a hidden group - #7544
Draft
simonfaltum wants to merge 20 commits into
Draft
simonfaltum wants to merge 20 commits into
simonfaltum wants to merge 20 commits into
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 7 changed tests (limit=20, 0 not selected) 7 tests: regression=7 unreleased=0 coverage=0 failing=0
TestAccept/cmd/aitools/mcp/add-agent-not-installed: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌main (8e70c8b): latest (v1.26.0): TestAccept/cmd/aitools/mcp/add-default-config: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌main (8e70c8b): latest (v1.26.0): TestAccept/cmd/aitools/mcp/add-text: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌main (8e70c8b): latest (v1.26.0): TestAccept/cmd/aitools/mcp/add-two-agents: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌main (8e70c8b): latest (v1.26.0): TestAccept/cmd/aitools/mcp/add-two-profiles: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌main (8e70c8b): latest (v1.26.0): 2 more failure details omitted, see the full report in the run. |
Collaborator
✅ Integration test reportCommit: aa53c0e
Top 8 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
`databricks aitools mcp add` installs Databricks managed MCP servers into coding agents, bound to one CLI profile. Each server is written as a stdio entry that runs `databricks aitools mcp serve`, which lands in a later change. The group stays hidden until the stack is complete. Co-authored-by: Isaac <no-reply@databricks.com>
mcpconfig.Spec.IsOurs is gone, so the unmanaged check calls mcpconfig.IsDatabricksEntry directly. serverNamePattern is replaced by mcpconfig.ValidServerName so the --name rule cannot drift from the writer. The add-two-agents Codex golden changes: agentconfig now edits TOML as text, so the server tables are written flush-left without the [mcp_servers] parent header. The entries are unchanged. Co-authored-by: Isaac <no-reply@databricks.com>
An agent named explicitly with --agents whose config directory does not exist now fails for that agent alone: nothing is written and its directory is not created. The other agents still install, and the command exits 1. Agents picked by detection are installed by construction, so they are unchanged. The failure uses the UNKNOWN_AGENT category, since the SPEC table has no row for an agent that is not installed. The add cases whose agents must exist now create their config directories first, and add-agent-not-installed covers the refusal. Co-authored-by: Isaac <no-reply@databricks.com>
Card 03 moved MCP records into the `mcp` section of ~/.databricks/aitools/skills/.state.json. The add acceptance scripts read the old mcp/state.json path and its top-level `servers` array. Point them at the new file and filter the `mcp` section. The golden loses the `schema_version: 1` line, which is no longer part of the MCP section. Co-authored-by: Isaac <no-reply@databricks.com>
ResolveConfigFile and AuthError are exported, and CheckBinding runs the binding drift check without a request. Bind's profile and drift checks move into shared helpers with the same behavior. Co-authored-by: Isaac <no-reply@databricks.com>
Refuse a recorded entry whose profile changed (host, workspace or config file) before any request reaches the profile's host, and load state first. Read the config file with the same resolver as Bind, and create the client with Bind's loaders. Check --agents, the binary name and the --names with the other flags, before the profile is read. Installed agents are the ones whose MCP config file or its directory exists, which covers CODEX_HOME, COPILOT_HOME and Antigravity's ~/.gemini/config. A status comes from the agent write, so a re-add reports re-asserted without state. The command fails when no agent was installed. The state is recorded after the results are printed. Printed paths use forward slashes. Errors use the binding and install categories, and a name clash reports MCP_NAME_CONFLICT. --name follows mcp.Sanitize. A relative arg0 with a directory is made absolute. Co-authored-by: Isaac <no-reply@databricks.com>
The shared test.toml no longer stubs the listing with a fixed body. Each script creates the services it lists through the fake's POST handler, so parent filtering and the FULL view are exercised. Agent home overrides are cleared in test.toml. The hidden check uses contains.py. The new add-default-config script covers an unpinned entry. Output changes: add-text no longer repeats the Cursor approval hint for re-asserted entries; hidden checks the help text with contains.py. Co-authored-by: Isaac <no-reply@databricks.com>
Refusals that need no request now run before the first request: --name conflicts with the state or with another profile's agent entry, an --agents agent that is not installed, and a profile that is gone or has no host. When every --agents agent is refused, the command stops there. Service and location names are lowercased before the binding check, and service names match case-insensitively. Names that agent files hold for another binding are reserved, so a new install never overwrites them. Agent presence is one rule for explicit and detected agents: the agent's own detection, its CLI on PATH, its MCP config file, or the directory that CODEX_HOME or COPILOT_HOME names. A service that reached no agent fails the command. A rejected credential is AUTH_FAILED with the login command. --name must be lowercase. Listing and profile errors use the categories from the spec. Printed paths use forward slashes; the state keeps the native paths. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Export the pieces that Bind and mcp add both need, so that the two agree: CheckBinding takes the resolved config file, FindEntry (was findEntry) finds the entry for a service, profile and file, BoundConfig and AuthenticateBound build and authenticate the profile's config, and EntryServes tells whether an agent entry is a Databricks entry for a binding in any layout (env or environment, args or command array). AbsoluteAsWritten keeps a path as written, and SystemAILocation is shared with the command. Bind's behavior is unchanged. Co-authored-by: Isaac <no-reply@databricks.com>
Ownership of agent entries: a server name stored for the profile is checked in each agent before any write, so an entry of another binding is refused instead of overwritten. Entries that this binding already holds are reused under whatever name they have, whether the state knows them or not, and their config file is compared as resolved paths, in the env and environment layouts. Planning reads each agent's entries once and finds the state entry by service, profile and config file. Shared binding check: mcp add uses mcp.CheckBinding, mcp.FindEntry, mcp.BoundConfig and mcp.AuthenticateBound, the same functions Bind uses, with the config file resolved once and the profile read from it. Names and flags: a generated server name that sanitizes to nothing is refused before any request, with a hint to pass --name. --name counts distinct services, so a leaf with its full name is one service. Without --location, full names in one schema give that schema. Errors: an uncategorized binding failure keeps its cause for classification. Cleanup: the --location help and the long help name the new default, the binary path is joined to the working directory without cleaning, the hidden-help check is traced, the mcp add fixture is committed, and the agent home variables and serve flags are constants. Co-authored-by: Isaac <no-reply@databricks.com>
CheckBinding returned no error for a missing profile or one with no host when no state entry existed. Bind checked that case itself, and aitools mcp add had its own check with other wording. The check moves into CheckBinding, so Bind and add refuse the same profiles with the same error, and an account-level profile with no host is refused before any request. Co-authored-by: Isaac <no-reply@databricks.com>
EntryEnv and the agent writers each listed env and environment. The list is now mcpconfig.EnvKeys, and EntryEnv has a direct test. Co-authored-by: Isaac <no-reply@databricks.com>
InstalledForMCP let a leftover agent directory (~/.codex) count as installed when CODEX_HOME pointed at a directory that did not exist, so the MCP write created it. With the variable set, the directory it names is the only signal. The InstalledForMCP test moves from detect_test.go to agents_test.go. Co-authored-by: Isaac <no-reply@databricks.com>
The serve command line that aitools mcp add writes repeated the --agent literal. Co-authored-by: Isaac <no-reply@databricks.com>
Planning now reads each named agent's entries. A stored or --name server name that another state entry holds, or that an agent holds as an entry this CLI did not write, is refused before any request (unless --force). A conflict in an agent that was only detected fails that agent for that server, and the run continues with the other agents. A run that no agent can take refuses before any request. Recording writes each server on its own and saves the state for the ones that recorded, returning the joined errors. Agent failures keep every distinct failure, not the first per agent. Service names with an empty part are reported as malformed, not as a location error. The profile check is the shared one in CheckBinding, so requireProfile is gone. The help text says leaf names resolve in --location. Co-authored-by: Isaac <no-reply@databricks.com>
The setup posts that create the fake services sent their output to /dev/null, so a failed setup showed only a later, unrelated failure. They write to LOG.create-<service>-<profile> now. The hidden golden shows the new help text for --location and the leaf-name rule. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
A profile that is missing when no state entry exists is not bound to any server yet, so the message no longer says the server is bound to it or suggests removing it. It says the service needs the profile and how to set it up. Co-authored-by: Isaac <no-reply@databricks.com>
A "~" name expands to the home directory joined with "/", and a file that does not exist is kept as written, so on Windows the resolved path mixed separators and did not equal the one other callers build. Convert slashes to the OS separator without cleaning, which keeps ".." after a symlink. Co-authored-by: Isaac <no-reply@databricks.com>
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
This branch has not been deployed
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 agents named with--agents, or every detected agent. Leaf names resolve in--location, which defaults tosystem.aior to the one schema the full names share.--force).--agents, and fails only that agent for a detected one.databricks aitools mcp serve, withDATABRICKS_CONFIG_FILEpinned when it is set.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
serveruns, so both commands print the same text. Without an install record it says the service needs the profile and how to set it up, with noremovehint.UNKNOWN_AGENTcovers a known agent that is not installed. No telemetry category fits.--forceoverride.--locationis inferred from full names only when they share one schema. A leaf next to full names outsidesystem.aiis refused.--agentsmust name an installed agent, soaddnever creates a config directory.addexits 1 when a requested service reached no agent.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.