Repository navigation
factory-server: mcp: register stdio servers - #241
Merged
Merged
Conversation
moonthebot
force-pushed
the
factory/job-76-pr-2
branch
2 times, most recently
from
November 23, 2026 20:35
82817d7 to
ce1340c
Compare
An admin can add a server of kind stdio on /settings/mcp, with a command and base arguments.
moonthebot
force-pushed
the
factory/job-76-pr-2
branch
from
November 23, 2026 20:45
ce1340c to
cab49b8
Compare
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
A project needs to run MCP servers such as playwright-mcp as a stdio child inside the worker. The first step is to let an admin register one. This is PR 2 of 5.
An admin can add a server of kind stdio on /settings/mcp, with a command and base arguments. The kind is fixed when the server is added. The proxy and the connection check refuse a stdio server, and runs do not carry it yet.
The command may not hold a line break, NUL or
${, and is checked before it is trimmed. An argument may hold a line break but not NUL or${.The edit form shows an argument with a line break in an ordinary text box, with backslash, line feed and carriage return written as
\\,\nand\r, and posts it asarg_escaped. The server reads the escapes back. A save keeps the value byte for byte without JavaScript and without an index into the stored list, so a stale form cannot swap in another argument. The admin can edit the box or clear it to remove the argument.The server accepts only
remoteorstdioas a posted kind and returns 400 for any other. An edit that posts a different kind than the stored one also gets 400. An omitted kind keeps the old behaviour.The add form's hidden remote fields no longer block a stdio submit, and Add argument works after every row is removed.
Docs
Updated the MCP server registry row in docs/design.md and the rows for header-name editing, factory admins, the MCP proxy and the connection check. Added an MCP stdio servers row.
Verification
nix develop -c just lint: passednix develop -c cargo test --workspace: passed, including a dashboard test for the escaped-argument round trip and unknown kindsnix develop -c just check-tests HEAD~1: passednix develop -c just e2e: 165 passed, including a JavaScript-disabled test that submits the real edit form, keeps multiline arguments on a command-only edit, then edits and clears them