Skip to content

feat(upstream): edit a stdio server's command and arguments in the Web UI and CLI - #2026

Merged
Dumbris merged 6 commits into
mainfrom
fix/2008-edit-command-args
Nov 24, 2026
Merged

Dumbris merged 6 commits into
mainfrom
fix/2008-edit-command-args

Conversation

@Dumbris

@Dumbris Dumbris commented Nov 24, 2026

Copy link
Copy Markdown
Member

Summary

PATCH /api/v1/servers/{id} already accepted command and args, but neither the Web UI nor mcpproxy upstream patch offered them. Changing a stdio server's command meant a raw REST call, a hand-edited config file, or removing and re-adding the server.

Closes #2008

Web UI

The Process card on the server Configuration tab has an Edit button: one field for the command, and a text box with one argument per line.

  • Only what the user changed is sent, judged against a snapshot taken when the editor opened. A masked credential the user did not touch is never echoed back, and an untouched argument list is never re-parsed.
  • args replaces the whole list, so a changed list is sent complete.
  • A backend refusal stays beside the fields with the editor open. A refused masked argument is named by its line in the text box.
  • If the stored command line changed elsewhere while the editor was open, the save is refused instead of overwriting the newer value.
  • The draft is dropped when the view moves to another server.
  • An argument list that one-per-line cannot represent (an empty argument, a line break, leading or trailing space) is not editable here; the note points to the CLI.

CLI

mcpproxy upstream patch <name> gains:

Form Effect
-- command [args...] Replace the command and all arguments
--command PROGRAM Replace the program only
--arg VALUE (repeatable) Replace all arguments
--clear-args Remove all arguments

The existing --header, --env and --init-timeout flags behave as before; the body is now built by a pure function (buildUpstreamPatchBody) that the tests call directly. A dash-leading server name behind -- keeps its old meaning.

Notes

  • No backend change. The REST handler already refuses masked values on write (CheckArgvMaskEcho, CheckServerWriteMasks).
  • The macOS tray is not changed.

Testing

  • go test ./cmd/mcpproxy/ and ./scripts/test-api-e2e.sh
  • frontend: vue-tsc --noEmit, vitest run (new server-detail-process-edit.spec.ts)
  • golangci-lint v2 with .github/.golangci.yml
  • Manual run against an isolated instance: each CLI form and the Web UI editor, including the masked-argument refusal.

…b UI and CLI

PATCH /api/v1/servers/{id} already accepted `command` and `args`, but neither
the Web UI nor `mcpproxy upstream patch` offered them, so changing a command
meant a raw REST call, a hand-edited config file, or removing and re-adding
the server.

Web UI: the Process card on the server Configuration tab has an Edit button.
The command is one field and the arguments are a text box with one argument
per line. Only what changed is sent, so a masked credential the user did not
touch is never echoed back; a refusal from the backend stays beside the
fields and names the argument line.

CLI: `mcpproxy upstream patch <name>` gains `--command`, `--arg` (repeatable,
replaces the list), `--clear-args`, and `-- command args...` to replace the
whole command line.

Closes #2008
- CLI: a dash-leading server name behind `--` keeps working; the command is
  stored as given instead of trimmed; docs name the right read command.
- Web UI: changes are judged against a snapshot taken when the editor opened,
  so an untouched argument list is never re-parsed and sent, a command line
  changed elsewhere is not overwritten, and a draft is dropped when the view
  moves to another server. Argument lists that one-per-line cannot represent
  are left to the CLI, and a refused argument is named by its text-box line.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: d8e7905
Status: ✅  Deploy successful!
Preview URL: https://d7f2620f.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-2008-edit-command-args.mcpproxy-docs.pages.dev

View logs

The fields stay disabled while a save is in flight, so an edit made after
submitting is not lost when the editor closes. A save that fails after the
view moved to another server is reported as a toast, not as an error in the
other server's editor.
…tion

Two different credentials render as the same mask, so comparing displayed
values could miss an argument rotated elsewhere while the editor was open.
The committed generation and incarnation now decide; the values still cover
a core that does not report them.
Blank lines and spaces around a line are dropped on purpose (a stray trailing
space is far more common than an intended one). The hint now says so and
points to the CLI for the arguments the box cannot express.
@Dumbris
Dumbris enabled auto-merge (squash) November 24, 2026 06:22
buildUpstreamPatchBody builds a PATCH request from what the operator typed;
it reads no stored config, so it is not a read door.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/2008-edit-command-args

Available Artifacts

  • archive-darwin-amd64 (33 MB)
  • archive-darwin-arm64 (30 MB)
  • archive-linux-amd64 (21 MB)
  • archive-linux-arm64 (19 MB)
  • archive-windows-amd64 (33 MB)
  • archive-windows-arm64 (29 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (29 MB)
  • installer-dmg-darwin-arm64 (26 MB)
  • smart-mcp-proxymcpproxy-go2E3MAO.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 45347019988 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@codecov-commenter

codecov-commenter commented Nov 24, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 70.58824% with 30 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/mcpproxy/upstream_cmd.go 70.58% 30 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Dumbris
Dumbris merged commit 716bfc1 into main Nov 24, 2026
55 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.

[Bug]: Unable to change MCP server command from UI

2 participants