Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
ACP threads only received bb's own bb-bridge server at session/new, so
servers declared in the workspace's .mcp.json, which Claude Code loads on
its own, were missing for Antigravity and every other ACP agent.
The ACP bridge now reads <cwd>/.mcp.json when it starts, resumes, or forks
a session and passes its servers next to bb-bridge. ${VAR} and
${VAR:-default} expand from the agent's environment, relative commands
resolve against the workspace and PATH, and http/sse servers are passed
only when the agent advertises that transport. Skipped servers show as a
provider warning in the thread.
Fixes #7998
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ACP requires an absolute stdio command. When a path-like command such as ./tools/server cannot be found as an executable (on Windows, a file without a PATHEXT extension), it was sent unchanged and the agent resolved it against its own working directory. Resolve it against the workspace instead, as Claude Code does when it starts the server there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
force-pushed
the
bb/7998-acp-pass-the-workspace-s-mcp-servers-to-the-thr_izeyn5agpb
branch
from
December 1, 2026 04:36
bd6fc3c to
3ef4c05
Compare
ymichael
deleted the
bb/7998-acp-pass-the-workspace-s-mcp-servers-to-the-thr_izeyn5agpb
branch
December 1, 2026 04:49
scowalt
pushed a commit
to scowalt/bb
that referenced
this pull request
Dec 1, 2026
## Human comments ## What was wrong ACP threads only received bb's own `bb-bridge` MCP server in `session/new`. bb never read the workspace's `.mcp.json`. Claude Code loads that file itself through its SDK setting sources, but Antigravity and the other ACP agents rely on the client to pass servers in `mcpServers`, so a workspace's MCP servers never started for them (get-bb#7998). ## What changed - New `packages/provider-bridge-acp/src/bridge/workspace-mcp-servers.ts` reads `<cwd>/.mcp.json` (Claude Code's format) with zod and turns each entry into an ACP `McpServer`: - `${VAR}` and `${VAR:-default}` expand from the agent's environment. A server that references an unset variable with no default is skipped. - Relative or bare stdio commands resolve against the workspace and `PATH` (`resolvePortableCommand`), because ACP needs an absolute path. A path-like command the lookup can't find (for example an extensionless script on Windows) is resolved against the workspace folder, so it isn't sent relative. - stdio servers are always passed. http and sse servers are passed only when the agent advertises `mcpCapabilities.http` or `.sse`, since an agent can reject the whole session over one entry it doesn't support. - A server named `bb-bridge` is skipped. - `bridge.ts`: `buildSessionMcpServers` now sends `bb-bridge` followed by the workspace servers. It does this for `session/new`, load/resume and fork. It runs after `initialize`, so capabilities are known. - Skipped servers, invalid JSON and unreadable files appear in the thread as provider warnings (`acp/warning`). Previously they would have been invisible. - Docs: the `acp-provider` skill and `docs/configuration.md` (Custom ACP Agents). - No server/daemon wire change: the bridge already runs on the host, so `HOST_DAEMON_PROTOCOL_VERSION` is unchanged. Not covered: servers declared per agent in bb settings (get-bb#2471), reading `.mcp.json` from parent folders, and an approval prompt like Claude Code's project-server approval. ## How you verified - New test in `bridge.test.ts`: "passes the workspace .mcp.json servers alongside bb-bridge at session/new". It covers a relative stdio command with expanded args and env, an http server the agent advertises, an sse server it doesn't, an unset variable, and the reserved `bb-bridge` name. It checks the `mcpServers` the fake agent receives and the three warnings. Before this change, only `bb-bridge` was sent. - `pnpm exec turbo run typecheck lint test --filter=@bb/provider-bridge-acp --filter=bb-plugin-provider-acp`: 13/13 tasks; 633 passed and 4 skipped, plus 83 passed. - Manual check with Antigravity (`agy acp`) on a `pnpm start:worktree` instance, using a workspace whose `.mcp.json` declares a stdio server with a `get_secret_word` tool: - Before: the agent saw only `bb-bridge` and replied "NO SECRET TOOL". - After: the agent listed `secret/get_secret_word`, called it, and replied "The secret word is PERIWINKLE-7998". - A server that needs an unset variable shows the thread warning `Skipped MCP server "needs-token" from …/.mcp.json: environment variable QA_7998_UNSET_TOKEN is not set`. Fixes get-bb#7998 > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Human comments
What was wrong
ACP threads only received bb's own
bb-bridgeMCP server insession/new. bb never read the workspace's.mcp.json. Claude Code loads that file itself through its SDK setting sources, but Antigravity and the other ACP agents rely on the client to pass servers inmcpServers, so a workspace's MCP servers never started for them (#7998).What changed
packages/provider-bridge-acp/src/bridge/workspace-mcp-servers.tsreads<cwd>/.mcp.json(Claude Code's format) with zod and turns each entry into an ACPMcpServer:${VAR}and${VAR:-default}expand from the agent's environment. A server that references an unset variable with no default is skipped.PATH(resolvePortableCommand), because ACP needs an absolute path. A path-like command the lookup can't find (for example an extensionless script on Windows) is resolved against the workspace folder, so it isn't sent relative.mcpCapabilities.httpor.sse, since an agent can reject the whole session over one entry it doesn't support.bb-bridgeis skipped.bridge.ts:buildSessionMcpServersnow sendsbb-bridgefollowed by the workspace servers. It does this forsession/new, load/resume and fork. It runs afterinitialize, so capabilities are known.acp/warning). Previously they would have been invisible.acp-providerskill anddocs/configuration.md(Custom ACP Agents).HOST_DAEMON_PROTOCOL_VERSIONis unchanged.Not covered: servers declared per agent in bb settings (#2471), reading
.mcp.jsonfrom parent folders, and an approval prompt like Claude Code's project-server approval.How you verified
bridge.test.ts: "passes the workspace .mcp.json servers alongside bb-bridge at session/new". It covers a relative stdio command with expanded args and env, an http server the agent advertises, an sse server it doesn't, an unset variable, and the reservedbb-bridgename. It checks themcpServersthe fake agent receives and the three warnings. Before this change, onlybb-bridgewas sent.pnpm exec turbo run typecheck lint test --filter=@bb/provider-bridge-acp --filter=bb-plugin-provider-acp: 13/13 tasks; 633 passed and 4 skipped, plus 83 passed.agy acp) on apnpm start:worktreeinstance, using a workspace whose.mcp.jsondeclares a stdio server with aget_secret_wordtool:bb-bridgeand replied "NO SECRET TOOL".secret/get_secret_word, called it, and replied "The secret word is PERIWINKLE-7998".Skipped MCP server "needs-token" from …/.mcp.json: environment variable QA_7998_UNSET_TOKEN is not set.Fixes #7998
🤖 Generated with Claude Code