Skip to content

fix(remotecontrol): register HTTP transport for the DevServer Host's MCP server - #24196

Merged
morning4coffe-dev merged 1 commit into
unoplatform:masterfrom
MartinZikmund:dev/mz/devserver-host-mcp-http-transport-master
Sep 10, 2026
Merged

morning4coffe-dev merged 1 commit into
unoplatform:masterfrom
MartinZikmund:dev/mz/devserver-host-mcp-http-transport-master

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

Summary

Fixes #24195.

The DevServer host's /mcp HTTP endpoint (added in afa3154) never actually works: HostHealthTool.Configure() calls AddMcpServer() and registers tools/resources, but never calls .WithHttpTransport(). Startup.cs unconditionally calls endpoints.MapMcp("/mcp"), which throws InvalidOperationException on every request since no HTTP transport was registered — caught and only logged as a warning, so the host keeps running with /mcp silently 404ing.

This one-line fix adds .WithHttpTransport() to the AddMcpServer() chain.

Test plan

  • Built Uno.UI.RemoteControl.Host from this branch (net10.0 slice) and ran it standalone.
  • curl http://localhost:<port>/mcp with a proper initialize request now returns 200 with a valid MCP handshake response, instead of 404.
  • The host no longer logs the Unable to find the MCP Tooling in the environment warning on startup.
  • Verified end-to-end against a real MCP client (Claude Code's Uno App MCP bridge): uno_health now reports status: Healthy, toolCount: 12 (once the Uno.UI.App.Mcp.Server add-in is also passed), issues: [], versus toolCount: 0 / HostMcpEndpointNotAvailable before the fix.

🤖 Generated with Claude Code

https://claude.ai/code/session_013hhqdwAeyzFqWJcy44Lyad

…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
Copilot AI lite review requested due to automatic review settings August 25, 2026 12:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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’s AddMcpServer(...) builder chain.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@unodevops

Copy link
Copy Markdown
Contributor

@mergify

mergify Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

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 morning4coffe-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@morning4coffe-dev
morning4coffe-dev merged commit 58387d1 into unoplatform:master Sep 10, 2026
65 checks passed
@agneszitte

Copy link
Copy Markdown
Member

@Mergifyio backport servicing/6.8 release/stable/6.7

@mergify

mergify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

backport servicing/6.8 release/stable/6.7

✅ Backports have been created

Details

agneszitte added a commit that referenced this pull request Oct 27, 2026
…r-24196

fix(remotecontrol): register HTTP transport for the DevServer Host's MCP server (backport #24196)
agneszitte added a commit that referenced this pull request Oct 27, 2026
…6.7/pr-24196

fix(remotecontrol): register HTTP transport for the DevServer Host's MCP server (backport #24196)
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.

DevServer Host /mcp endpoint always fails: WithHttpTransport() never called

7 participants