Skip to content

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

Closed

Description

@MartinZikmund

Current behavior

The DevServer host's /mcp HTTP endpoint (added in commit afa3154, "feat: expose uno_health tool and resource in Host HTTP MCP") never actually works. Every request to /mcp returns a 404, and the host logs a warning on startup:

warn: Uno.UI.RemoteControl.Host.Program[0]
      Unable to find the MCP Tooling in the environment, the MCP feature is disabled.
      System.InvalidOperationException: You must call WithHttpTransport(). Unable to find required services. Call builder.Services.AddMcpServer().WithHttpTransport() in application startup code.
         at Microsoft.AspNetCore.Builder.McpEndpointRouteBuilderExtensions.MapMcp(IEndpointRouteBuilder endpoints, String pattern)
         at Uno.UI.RemoteControl.Host.Startup.<>c.<Configure>b__5_2(IEndpointRouteBuilder endpoints) in .../src/Uno.UI.RemoteControl.Host/Startup.cs:line 63

Root cause: HostHealthTool.Configure() calls services.AddMcpServer(...) and registers tools/resources via .WithTools<HostHealthTool>() etc., but never calls .WithHttpTransport(). Startup.cs then calls endpoints.MapMcp("/mcp") unconditionally, which throws because no HTTP transport was ever registered. Startup.cs catches the exception and only logs it as a warning, so the host keeps running with the MCP feature silently disabled.

This affects any MCP client that talks to the DevServer host over HTTP — confirmed with Claude Code's Uno App MCP bridge, which reports uno_health → toolCount: 0, HostMcpEndpointNotAvailable (Fatal), and every uno_app_* operation fails opaquely as a result.

Confirmed present on both master (current tip) and feature/breakingchanges — not a breaking-changes-branch-specific issue, it was simply inherited into feature/breakingchanges via the routine automated master-sync merge.

Expected behavior

/mcp should return a working MCP endpoint, and uno_health reports toolCount > 0.

How to reproduce

  1. Build/run Uno.UI.RemoteControl.Host.exe for any project with the DevServer host.
  2. curl http://localhost:<port>/mcp -X POST -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" -d '{"jsonrpc":"2.0","id":1,"method":"initialize", ...}' → 404.
  3. Or connect any MCP-HTTP client (e.g. Claude Code's Uno App MCP bridge) and observe toolCount: 0.

Workaround

None short of patching the host.

Fix

Add .WithHttpTransport() to the AddMcpServer() chain in HostHealthTool.Configure(). PR: (to follow in this comment thread once opened).


🤖 Filed by an automated investigation (Claude Code) while validating an unrelated Uno 7.0 retargeting spike in a downstream repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions