Repository navigation
crates: run stdio MCP servers in the worker - #243
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
Why
Stdio MCP servers could be registered and enabled per project, but runs ignored them. This change makes a run start them. It is PR 4 of the stdio MCP series (#240 to #242 came first).
The agent starts the server as a child process inside the worker, so it reaches
/workand the worker's localhost. That bypasses the proxy, so there are no stored secrets, no enforced tool toggles and no connection check. Tool calls are read from the agent's output instead.What changed:
McpConfignow holds an optional proxy. A run with only stdio servers issues no run token and passes noFACTORY_MCP_TOKEN. Remote entries are unchanged.--mcp-config /claude/factory-mcp.json. Copilot reads--additional-mcp-config @/copilot/factory-mcp.json. Codex reads[mcp_servers.<name>]tables in itsconfig.toml. The podman flags do not change.MCP_TIMEOUT=120000through--settings. Codex setsstartup_timeout_sec = 120. Copilot has no startup timeout setting.mcp-unavailablewarning. Claude reports it in theinitline. Copilot is parsed fromsession.mcp_server_status_changedandsession.mcp_servers_loaded.mcp-tool-callrow under its job. Remote calls stay recorded by the proxy alone.Checked against the pinned CLIs (copilot 1.0.114, codex 0.165.0, claude 2.1.330):
MCP_TIMEOUTthrough the settingsenvworks.config.toml, and escaped",\and spaces round-trip. It emits no event for a failed stdio server, so it gets no warning.docs/design.mdsays so.@pathfor--additional-mcp-config. Its failed-status events come from the SDK types, and I did not confirm that-pJSON output emits them live. That needs a check on moon.Docs
docs/design.md: the MCP stdio servers, MCP project settings, MCP proxy, MCP unavailable servers, Job MCP tool calls and Credentials rows, a new MCP stdio isolation row, the Architecture block, and the Claude, Codex and Copilot sections. The playwright-mcp recipe waits for the worker packages PR.Verification
nix develop -c just lint: passed.nix develop -c cargo test --workspace --locked: passed. It includes tests for each agent that pass 64 arguments of 4096 bytes through the file, and tests that a preexisting symlink is replaced and its target stays unchanged.nix develop -c just check-tests: passed.Signed-off-by: Copilot 223556219+Copilot@users.noreply.github.com