Repository navigation
fix(remotecontrol): register HTTP transport for the DevServer Host's MCP server - #24196
Conversation
…MCP server
HostHealthTool.Configure() calls AddMcpServer() and registers tools/resources,
but never calls WithHttpTransport(). Startup.cs then unconditionally maps
/mcp via endpoints.MapMcp("/mcp"), which throws InvalidOperationException at
every request since no HTTP transport was ever registered for the MCP
server. The exception is caught and only logged as a warning ("Unable to
find the MCP Tooling in the environment, the MCP feature is disabled."), so
the host keeps running but the /mcp endpoint 404s on every request.
This breaks any MCP client that talks to the DevServer host over HTTP,
including IDE/tooling integrations that rely on uno_health and friends.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013hhqdwAeyzFqWJcy44Lyad
There was a problem hiding this comment.
Pull request overview
This PR fixes the DevServer Host’s /mcp endpoint by registering the MCP HTTP transport during service configuration, aligning the service setup with the unconditional endpoints.MapMcp("/mcp") routing in Startup.cs.
Changes:
- Register MCP HTTP transport by adding
.WithHttpTransport()to the Host’sAddMcpServer(...)builder chain.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24196/wasm-skia-net9/index.html |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
morning4coffe-dev
left a comment
There was a problem hiding this comment.
Code review assessment: WithHttpTransport supplies the services required by the existing MapMcp("/mcp") endpoint, and it is registered on the WebApplication service collection before Build. The host health tool/resource and existing add-in registration remain unchanged. This is the missing transport registration rather than a new endpoint or listener. No blocking issues found.
|
@Mergifyio backport servicing/6.8 release/stable/6.7 |
✅ Backports have been createdDetails
|
…r-24196 fix(remotecontrol): register HTTP transport for the DevServer Host's MCP server (backport #24196)
…6.7/pr-24196 fix(remotecontrol): register HTTP transport for the DevServer Host's MCP server (backport #24196)
Summary
Fixes #24195.
The DevServer host's
/mcpHTTP endpoint (added in afa3154) never actually works:HostHealthTool.Configure()callsAddMcpServer()and registers tools/resources, but never calls.WithHttpTransport().Startup.csunconditionally callsendpoints.MapMcp("/mcp"), which throwsInvalidOperationExceptionon every request since no HTTP transport was registered — caught and only logged as a warning, so the host keeps running with/mcpsilently 404ing.This one-line fix adds
.WithHttpTransport()to theAddMcpServer()chain.Test plan
Uno.UI.RemoteControl.Hostfrom this branch (net10.0 slice) and ran it standalone.curl http://localhost:<port>/mcpwith a properinitializerequest now returns200with a valid MCP handshake response, instead of404.Unable to find the MCP Tooling in the environmentwarning on startup.uno_healthnow reportsstatus: Healthy,toolCount: 12(once theUno.UI.App.Mcp.Serveradd-in is also passed),issues: [], versustoolCount: 0/HostMcpEndpointNotAvailablebefore the fix.🤖 Generated with Claude Code
https://claude.ai/code/session_013hhqdwAeyzFqWJcy44Lyad