Repository navigation
Add and remove agent MCP entries through the agent's own CLI - #7595
Draft
simonfaltum wants to merge 1 commit into
Draft
simonfaltum wants to merge 1 commit into
simonfaltum wants to merge 1 commit into
Conversation
Contributor
|
Commit: Regression test reportSelected 16 changed tests (limit=20, 0 not selected) 16 tests: regression=16 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-remove-agent-clis: 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): 12 more failure details omitted, see the full report in the run. |
Collaborator
✅ Integration test reportCommit: 8cca61b
Top 5 slowest tests (at least 2 minutes):
|
simonfaltum
force-pushed
the
aitools-mcp/08b-agent-clis
branch
from
November 13, 2026 09:48
7122f6a to
93e536b
Compare
aitools mcp add and remove now change the Claude Code, Codex CLI, Gemini CLI and Copilot CLI entries through each agent's own mcp commands, with a read-back of the agent's config file. The agent CLI runner, resolver and stderr helper live in agents, and the installer's plugin probe reuses agents.ResolveBinary. The installer keeps its timeout-aware runner and stderr helper. Co-authored-by: Isaac <no-reply@databricks.com>
simonfaltum
force-pushed
the
aitools-mcp/08-challenge
branch
from
November 13, 2026 15:05
1abf7d0 to
6b41591
Compare
simonfaltum
force-pushed
the
aitools-mcp/08b-agent-clis
branch
from
November 13, 2026 15:06
3ed1398 to
8cca61b
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; its parent is #7553.aitools mcp addandremovenow change the Claude Code, Codex CLI, Gemini CLI and Copilot CLI configs through each agent's own MCP command, when that CLI is on PATH.Changes
claude mcp add-json --scope user,codex mcp add,gemini mcp add --scope user,copilot mcp add --tools *). Afterwards the config file holds the entry asked for, whatever the exit status: a differing entry is replaced, and a missing one is added directly.removeruns the CLI's remove for an entry we wrote, when the agent reads that file now. A CLI failure, or an entry left behind, falls back to the direct writer. Symlinked configs and names that start with-always use the direct writer.Why
The agent's own CLI writes its config with its own locking and layout, for example while a running Claude Code session rewrites
.claude.json, and when an agent changes its file format its CLI follows, where a copy in this repo would not.Decisions to review
mcp addandmcp removerewrite the[mcp_servers.*]tables in Codex's own serialization. With Codex CLI 0.167.1 in a temporaryCODEX_HOME, a comment after a value and an unknown key in another server's table were dropped. The direct writer re-renders only the server it writes, so comments inside that server's tables are lost on either path..cmdshim gets only arguments without spaces, double quotes orcmd.exespecial characters. Other arguments use the direct writer.Tests
libs/aitools/agentscovers argv per agent, including a Windows path with spaces.agentconfig/cli_test.gocovers each outcome of an add, symlinks, dash names and the timeout.libs/processcoversWithoutEnv, which ignores case on Windows.acceptance/cmd/aitools/mcp/add-remove-agent-cliscovers each agent's argv and the files it wrote../task test-exp-aitoolspasses withBROWSERunset and withBROWSER=none.-inprocessmode, which already fails on the base for these tests.This pull request and its description were written by Isaac.