Skip to content

feat(mcp): add edit support for stdio sources - #1775

Merged
RhysSullivan merged 7 commits into
UsefulSoftwareCo:mainfrom
The-AarushiSingh:feat/mcp-stdio-edit-ui
Aug 28, 2026
Merged

feat(mcp): add edit support for stdio sources#1775
RhysSullivan merged 7 commits into
UsefulSoftwareCo:mainfrom
The-AarushiSingh:feat/mcp-stdio-edit-ui

Conversation

@The-AarushiSingh

Copy link
Copy Markdown
Contributor

Related Issue

Closes #812

Description

This PR adds full edit support for stdio MCP sources through the UI, eliminating the need for users to manually edit executor.jsonc.

Changes

  • UI: Replaced StdioReadOnly with StdioEditForm with editable fields for command, arguments, working directory, and environment variables
  • Backend: Added updateStdioServer function using Effect pattern to persist config changes
  • Connections: Auto-refresh connections after save to rediscover tools
  • Permissions: Enabled canEdit for stdio sources
  • Error Handling: Proper error messages via messageFromExit
  • Components: Uses shared Input, Label, and Textarea components

Testing

  • ✅ 42/42 MCP tests passing
  • ✅ Typecheck passed
  • ✅ Lint clean
  • ✅ Manual testing verified

- Add StdioEditForm with Save/Cancel buttons for stdio MCP sources
- Implement updateStdioServer backend function using Effect
- Connect UI to backend with proper error handling
- Enable canEdit for stdio sources
- Use shared Input, Label, and Textarea components
- 42/42 MCP tests passing

Closes UsefulSoftwareCo#812
Edit the command, arguments, working directory, and declared env map through
the sheet's staged Save instead of a second inline form, using the add
flow's CardStack fields and its quote-aware argument parsing (now shared).

Drop the parallel updateStdioServer endpoint: configureServer already replaces
an integration config. It now also re-runs discovery on the connections, since
the tool catalog is derived from the config it just replaced.

The env field edits the declared static map only. A stdio server receives that
plus a fixed base set, so the copy no longer implies it inherits executor's
environment.
An integrations config write stamps config_revised_at, and every connection
whose catalog predates the stamp re-lists on its next read. Refreshing from the
plugin duplicated that, eagerly, on the save path. The local stdio scenario
passes either way, which is how the duplication showed up.

Cover the edit in that scenario instead: it adds a declared env var, and the
fixture only advertises saw_declared_env when that variable reached the child,
so the tool appearing after a plain config replace shows the rebuild happens
with no refresh of its own.
Local is the only surface with stdio MCP enabled, so the sheet gets its scenario
there. It edits the declared env through the form and then reads the tool
catalog: the fixture advertises saw_declared_env only when that variable is in
the spawned child environment, so the tool appearing proves the edit travelled
form to config to respawn.

Name the four fields with aria-label. CardStackEntryField renders its label
without htmlFor, so the controls had no accessible name at all.
@The-AarushiSingh

Copy link
Copy Markdown
Contributor Author

@RhysSullivan thanks for the improvements!

Saw the local E2E test failed - let me know if I need to fix anything on my end. Happy to iterate asap.

The local app's dev server discovered effect/Match, effect/Predicate and
js-yaml only when a lazy React chunk first rendered them. Vite then
re-optimized and full-reloaded the page. Opening the integration Edit sheet
is one of those chunks, so the reload landed on the open sheet and closed
it, and the new stdio edit scenario waited 30 seconds for a field that had
been thrown away.

Pre-bundle the same list apps/host-selfhost and apps/cloud already carry, so
nothing is discovered mid-run.
@RhysSullivan
RhysSullivan merged commit ecb87de into UsefulSoftwareCo:main Aug 28, 2026
40 checks passed
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.

feat(mcp): allow editing stdio MCP sources from the UI

2 participants