Skip to content

factory-server: mcp: register stdio servers - #241

Merged
moonthebot merged 1 commit into
mainfrom
factory/job-76-pr-2
Nov 23, 2026
Merged

moonthebot merged 1 commit into
mainfrom
factory/job-76-pr-2

Conversation

@moonthebot

@moonthebot moonthebot commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

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 \\, \n and \r, and posts it as arg_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 remote or stdio as 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: passed
  • nix develop -c cargo test --workspace: passed, including a dashboard test for the escaped-argument round trip and unknown kinds
  • nix develop -c just check-tests HEAD~1: passed
  • nix 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

@moonthebot
moonthebot force-pushed the factory/job-76-pr-2 branch 2 times, most recently from 82817d7 to ce1340c Compare November 23, 2026 20:35
An admin can add a server of kind stdio on /settings/mcp, with a command and base arguments.
@moonthebot
moonthebot merged commit a1a7413 into main Nov 23, 2026
3 checks passed
@moonthebot
moonthebot deleted the factory/job-76-pr-2 branch November 23, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant