fix(mcp): the serve path and bind failures were both invisible - #37
Merged
Conversation
Two defects that each make the MCP feature look like it works when it does not. The client-config snippets in the UI, and every example in the docs, pointed at /sse with "type": "sse". That is rmcp 0.1.5's transport; the rmcp 2 migration mounts Streamable HTTP at /mcp and serves nothing at /sse. Anyone copying the config out of the app -- its own documented setup path -- got a 404 on every connection attempt. The docs were also self-contradictory, pairing --transport http with an /sse URL. The path is now a constant the router is built from and the status payload reports, so the UI renders whatever is actually served instead of a second copy that can drift. Separately, TcpListener::bind ran inside tokio::spawn, leaving its error nowhere to go but eprintln! while start_mcp_server unconditionally stored a cancel token and returned success. An unusable port -- taken, or privileged and EACCES -- reported "Running" in the UI, and every retry was then refused with "already running" until the user pressed Stop. Binding before the spawn puts the error back in the caller's hands. Both guards mutation-verified: reintroducing the nest_service literal fails router_path_is_not_hardcoded_alongside_the_constant.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
thinkutils | c18f577 | Jul 20 2026, 03:05 AM |
This was referenced Jul 20, 2026
vietanhdev
added a commit
that referenced
this pull request
Jul 20, 2026
The concurrency block intended never to cancel on main -- the comment said
so -- and did the opposite:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
The expression renders to the STRING "false", and a non-empty string is
truthy in that position, so main was cancelled like any other ref. It
failed silently for exactly as long as nobody merged twice in quick
succession.
Four main runs were cancelled during this batch of merges (#36, #37, #39,
#32), each with ZERO jobs recorded -- so those commits have no evidence
they ever built. The runs that were supposed to be the record of what
shipped are the ones that got killed.
Encoding the rule in the concurrency GROUP is unambiguous: on main the SHA
gives every run its own group, so there is nothing to supersede; every
other ref keeps a per-ref group, so a force-push still cancels the old run.
tests/workflow_concurrency.rs guards both halves -- an expression-valued
cancel-in-progress, and a group that lost its per-SHA component (which
with cancel-in-progress: true would cancel main on every push, strictly
worse than the bug it replaced). Mutation-verified: restoring the original
two lines fails both.
118 tests.
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.
Two defects that each make the MCP feature look like it works when it doesn't.
1. Every config the app hands out points at a dead endpoint
The UI's client-config snippets — and all eight examples in
docs/guide/mcp.md— pointed at/ssewith"type": "sse". That's rmcp 0.1.5's transport. The rmcp 2 migration (#29) mounts Streamable HTTP at/mcpand serves nothing at/sse.So a user starts the server, copies the Claude Desktop config displayed in the app, and every connection attempt 404s. The feature is unusable via its own documented setup path. The docs were additionally self-contradictory —
claude mcp add --transport http ... /ssepairs a Streamable HTTP transport with an SSE path.The path is now a constant the router is built from and
McpStatusreports, so the UI renders whatever is actually being served rather than a second copy free to drift."type"is corrected to"http", which is what selects Streamable HTTP.2. A failed bind reports success
The bind happened inside the spawned task, so its error had nowhere to go but stderr while the command had already returned success and stored a cancel token.
The port field is user-editable. Enter
80(EACCES) or a port something else holds: the task exits immediately, nothing is listening, but the UI shows "Running on 127.0.0.1:80" — and because the cancel token was stored, every retry is refused with "MCP server is already running" until the user presses Stop.Binding before the spawn puts the error back in the caller's hands.
Verification
99 tests pass, clippy clean, frontend lint + format clean.
The guard against re-hardcoding the path is mutation-verified — restoring the
nest_service("/mcp", ...)literal fails it:(It's scoped to code above the test module specifically so it can't match its own assertion string.)
Found while auditing the backend for runtime defects.