Repository navigation
Conversation
pwngh
force-pushed
the
agent-mcp
branch
5 times, most recently
from
December 2, 2026 08:42
f6010ea to
5a0556d
Compare
…y through claude mcp
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.
flow agent on clauderoutes Claude Code's model calls through the gateway, but its MCP servers still ran directly, so the proxy's record of what each server was asked and answered stayed empty. The plan's--mcpoption puts them behind the proxy.flow agent on claude --mcpreads the MCP servers Claude Code uses from this folder: user and local scope in~/.claude.json, project scope in.mcp.json. For each name it takes the entry Claude Code actually uses here (local, then project, then user). A stdio entry keeps its keys;commandbecomes Flow's Python andargsbecomes-m flowd.proxy.stdio --server <name> -- <command> <args>.... Every write goes throughclaude mcp removeandclaude mcp add-json --scope.A project server gets a local entry of the same name, so the committed
.mcp.jsonis never written. That happens only for servers Claude Code has approved, and the approve-all setting is taken from the highest-priority settings file that sets it. HTTP and SSE servers are left alone and listed. Servers from managed settings, plugins and claude.ai connectors aren't in these files, and the output says they are not changed.flow agent off clauderestores the MCP entries first. If any entry is no longer what Flow wrote, it shows the difference and changes nothing, settings included. A failed write duringonis undone. The code is inflowd/agents/claude_mcp.py, besideflowd/agents/claude.py, which is unchanged.Proof:
tests/agents/test_claude_mcp.py(10 tests, new) runs in a temporary HOME with a fakeclaudecommand that edits~/.claude.jsonthe way Claude Code does. It coverstest_mcp_json_never_written,test_off_restores_entriesandtest_off_stops_on_edited_entry, plus the entry used here, approval, rollback,FLOW_HOMEreaching the proxy, andoffrestoring MCP before settings. Claude Code's real files and command were never touched. Python suite 410 passed. The real Claude Code run is the owner's.Reviewed with sol-loop: 3 rounds with gpt-6.2-sol. Sol verdict: approved
Sol's fixes: only the entry Claude Code uses here changes, unapproved project servers are left alone, no state is saved when nothing changed, the retry message is clearer, and
offnever reads.mcp.json. Declined: naming managed, plugin and connector servers (the only way isclaude mcp list, which starts every server), and tracking a half-finished restore.