Skip to content

feat(devserver-cli): app verbs that call the App MCP tools from a shell - #25374

Merged
kazo0 merged 13 commits into
masterfrom
dev/steve/devserver-cli-app-verbs
Oct 14, 2026
Merged

kazo0 merged 13 commits into
masterfrom
dev/steve/devserver-cli-app-verbs

Conversation

@kazo0

@kazo0 kazo0 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What

uno-devserver app <verb|tool> [--param value]... [--json] [--out <file>] [--no-start]

One new command on the existing DevServer CLI. Every verb is one App MCP tool (uno_app_*) called over the host's /mcp HTTP endpoint with the same MCP client the stdio proxy uses, so a shell, a Claude Code hook, or a CI script gets the same tools as an MCP client, plus an exit code.

  • Verbs: tools, start, close, info, hot-reload-status, screenshot, tree, find, invoke, action, click, key, type, datacontext, memory, diag. An unknown verb is sent verbatim, so app-defined app_* tools work too.
  • Script-side verbs that compose the tools: wait [--timeoutSeconds] [--ready] (until an app is connected, then until Hot Reload is Ready), assert <find selectors> [--state tok,..] [--absent] [--count N] (a find with a verdict on the {state} tokens). On an App MCP whose element tools take only elementRef, --name is resolved through a compact tree snapshot, like the DevFlow CLI resolves --automationId; --automationId cannot be (the tree does not print it) and says so.
  • Exit codes read structuredContent (matched, verdict) when the host sends it (unoplatform/uno.app-mcp#197), and fall back to the text checks on older hosts.
  • --name value becomes a typed tool argument (JSON when it parses as JSON, string otherwise, bare --flag is true). --json prints the raw CallToolResult; an image block goes to --out or a timestamped file.
  • Starts the DevServer the way start does when none is registered for the solution, unless --no-start.
  • Exit codes: 0 ok; 1 the tool reported an error or find matched nothing; 2 bad arguments, no host with --no-start, or tool not offered. hot-reload-status --file maps every HotReloadVerdict: 0 applied/noChanges/superseded/ignored; 1 notApplied/noOperation/probablyNotApplied/unknown, or no verdict at all; 3 rudeEdit; 4 queued/processing/notReceived/applying (call again).
  • --log-level/-l/--file-log/-fl work before or after the app verb and are never sent to the tool.
  • Logs go to stderr, the result to stdout.
  • uno-devserver app --help (also app help and a bare app) prints the full reference: verbs and their tools, parameter typing, wait/assert, exit codes, examples. The global --help points to it.
  • Docs: new doc/articles/features/devserver-app-commands.md (in the Dev Server TOC), linked from dev-server.md and using-the-uno-mcps.md.

Why

The App MCP already is the Uno equivalent of the Dart MCP server. What was missing is the half that a shell can drive: hooks and CI cannot call MCP tools, exit codes are assertions, a command line is replayable by a person, and one install serves every agent. The first consumer is the uno-testing PostToolUse hook in unoplatform/studio#188, which runs app hot-reload-status --no-start --file <edited> after each edit and reports the verdict to the agent.

Testing

  • Uno.UI.DevServer.Cli.Tests: 394 total, 389 pass. The 5 failures (Given_CliCommandProcess list/cleanup/stop nested-workspace, Given_McpRootsFallbackProcess ×2) fail identically on master on the same machine.

  • End to end against a real host and app (Uno.Sdk 6.8.0-dev.12, host 6.8.0-dev.42): app tools cold-started the host and listed the tools; app start → info → tree → screenshot --fileType png → close returned the right text and exit codes; app find exits 2 there because that App MCP predates uno_app_find_elements.

  • --no-start: reuses a registered host, exits 2 with a message when none runs, never spawns one.

  • hot-reload-status exit codes are unit-tested against the status text format; the tool itself ships with App MCP 2.0 and was not exercised live.

  • Live on testingground (App MCP 1.3-era host): app wait --ready returned after the connection plus the 15 s fallback; app datacontext --name HelloText resolved ^4t through the tree and returned the real result; unknown name → 1, --automationId on an elementRef-only tool → 2, assert without the find tool → 2, wait with no app → 1 after the timeout.

Known

  • The host lists every tool twice over /mcp (host 6.8 + App MCP 1.4); app tools dedupes.
  • When the app call itself spawns the host, the host inherits the CLI's stdout handle, so uno-devserver app ... | tail waits until the host exits. Same spawn path as start; --no-start or a redirect to a file avoids it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NzKY9EQxsHN7uhcmPniyJZ

kazo0 and others added 3 commits October 11, 2026 20:37
… a shell

`uno-devserver app <verb> [--param value]... [--json] [--out file]` runs one
uno_app_* tool over the host's /mcp endpoint, the same channel the stdio proxy
uses, so a script, a hook or a shell-only agent gets the tools an MCP client
gets, plus an exit code: 1 for an error result or a find that matched nothing,
2 for a tool the host does not offer. Starts the host like `start` when none
is registered for the solution.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NzKY9EQxsHN7uhcmPniyJZ
…ad verdict

A hook or script must never start a DevServer by accident: with --no-start,
no running host for the solution is exit code 2, like a tool that is not
offered. `app hot-reload --file` exits 0 only when the app runs the edit,
1 when it does not (the text says why), 3 for a rude edit that needs a
start, so a PostToolUse hook can act on the code alone.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NzKY9EQxsHN7uhcmPniyJZ
…oad-status`

Saving the file triggers Hot Reload; the verb only reports whether the
edit was applied, and its name said otherwise.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NzKY9EQxsHN7uhcmPniyJZ

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.

🔵 Needs a closer look

It introduces a new multi-process CLI command surface with live-host MCP orchestration and exit-code contracts that external hooks/CI will depend on, and several paths were only partially exercised end-to-end, warranting human review.

1 open finding
What changed in this PR

This PR adds a new app command group to the Uno DevServer CLI (Uno.UI.DevServer.Cli). Each app verb maps to one App MCP tool (uno_app_*) and is invoked over the host's /mcp HTTP endpoint using the same MCP client the stdio proxy already uses, giving shells, Claude Code hooks, and CI scripts the same tool surface as an MCP client plus a meaningful process exit code. It fits into the DevServer subsystem alongside the existing start/stop/mcp command routing, and its first consumer is a hot-reload PostToolUse hook.

Changes:

  • New AppCommandHandler that parses app <verb|tool> [--param value]... [--json] [--out file] [--no-start], calls the tool, renders text/image/JSON results, and maps results to exit codes (0 ok, 1 error/no-match/not-applied, 2 bad args/no host, 3 rude edit).
  • CliManager routes the app verb and adds EnsureHostAsync, which reuses a registered DevServer or starts one the same way start does (unless --no-start).
  • Program adds IsAppCommand so app logs are routed to stderr (keeping stdout clean for results), plus help text for the new commands.
  • New unit tests for argument parsing, value typing, and exit-code logic.
File Description
src/​Uno.UI.DevServer.Cli/​AppCommandHandler.cs New handler: parse args, call one MCP tool, render output, derive exit codes.
src/​Uno.UI.DevServer.Cli/​CliManager.cs Routes app to the handler and adds EnsureHostAsync host-reuse/start logic.
src/​Uno.UI.DevServer.Cli/​Program.cs Adds IsAppCommand stderr-logging routing and help text for app commands.
src/​Uno.UI.DevServer.Cli.Tests/​Given_AppCommandHandler.cs Unit tests for parsing, value typing, and exit-code mapping.

Notes: The code is consistent with existing MCP client usage (McpUpstreamClient, ToolListManager), disposes transport/client via await using, and honors --no-start semantics. The parse/exit-code logic is well covered by the new tests; the live network/host-start orchestration (RunAsync HTTP flow, EnsureHostAsync) is not unit-tested, which is understandable given it requires a running host.

🧠 Review effort: Balanced


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

Comment thread src/Uno.UI.DevServer.Cli/Program.cs Resolved
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 239048 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • Buttons.png-dark
    • Buttons.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • DisplayInformation.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
  • skia-windows-screenshots: 2458 changed over 2488

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png
    • AppBarButtonTest.png-dark
    • AppBarToggleButtonTest.png
    • ApplicationViewSizing.png-dark
    • Application_DispatcherShutdownMode.png-dark
    • AppWindowPositionAndSize.png
    • ArcSegment.png
    • AuthenticationBroker_Cancel.png
    • AutomationProperties_AutomationId.png
    • AutomationProperties_Landmark.png-dark
    • AutoSuggestBox_Description.png-dark
    • AutoSuggestBox_Description.png
    • BadgeNotificationTests.png-dark
    • BadgeNotificationTests.png
    • Basics_Automated.png-dark
    • Basics_Automated.png
    • BezierSegment.png-dark
    • BezierSegment.png
    • BitmapIcon_Monochromatic.png-dark
    • BitmapIcon_Monochromatic.png

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 239048 has failed on Uno.UI - CI.

kazo0 and others added 2 commits October 12, 2026 08:45
…n for elementRef-only tools

Three script-side verbs that need nothing new from the host:

- `wait [--timeoutSeconds] [--ready]` polls the runtime info until an app
  is connected, then until Hot Reload is Ready (through the status tool
  when offered, else 15 s by the clock). Exit 1 on timeout or Disabled.
- `assert <find selectors> [--state tok,..] [--absent] [--count N]` is a
  find with a verdict on the {state} tokens of every match; exit 1 on fail.
- On an App MCP whose element tools take only elementRef, `--name` is
  resolved through a compact tree snapshot (#Name), like the DevFlow CLI
  resolves --automationId. --automationId cannot be resolved there, since
  the tree does not print it, and says so (exit 2).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NzKY9EQxsHN7uhcmPniyJZ
…ad-status exit codes

App MCP hosts that send `{ matched }` and `{ verdict }` decide the exit
code directly; the text checks stay for older hosts.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NzKY9EQxsHN7uhcmPniyJZ
Copilot AI balanced review requested due to automatic review settings October 12, 2026 13:20

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.

🔵 Needs a closer look

It adds a sizable new user-facing CLI surface whose main execution paths (host start, live MCP tool calls, the untested wait --ready status path) depend on host behavior that can't be verified here and warrant human sign-off.

1 open finding

🧠 Review effort: Balanced

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 239065 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • DropDownButtonPage.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • ImageBrushAlignmentXY.png-dark
    • ImageBrushAlignmentXY.png
  • skia-windows-screenshots: 2458 changed over 2488

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png-dark
    • AnimatedVisualsTestbedPage.png-dark
    • AppBarToggleButtonTest.png
    • ApplicationViewSizing.png
    • AppWindowClosing.png-dark
    • AppWindowPresenters.png
    • ArcSegment.png
    • AuthenticationBroker_Cancel.png-dark
    • AutoBorderStretchwithleftmargin.png
    • AutoBorderStretchwithrightmargin.png-dark
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • BackGesture.png-dark
    • BackGesture.png
    • BasicEnability.png-dark
    • BasicEnability.png
    • BeginTime_MultipleAnimations.png-dark
    • BeginTime_MultipleAnimations.png
    • BitmapIcon_Generic.png-dark
    • BitmapIcon_Generic.png

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 239065 has failed on Uno.UI - CI.

Copilot AI balanced review requested due to automatic review settings October 12, 2026 20:04

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.

🔵 Needs a closer look

It introduces a new CLI subsystem that spawns hosts and relies on MCP/live-host output contracts largely unverifiable in CI, so a human should validate the end-to-end behavior.

1 open finding

🧠 Review effort: Balanced

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 239077 has failed on Uno.UI - CI.

…t does not list

A hook pays this wait on every edit when the App MCP is older than the
status tool; with --no-start the host was already running, so a tool it
does not list now is not coming.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NzKY9EQxsHN7uhcmPniyJZ
Copilot AI balanced review requested due to automatic review settings October 12, 2026 23:57
@mergify

mergify Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

backport servicing/6.8

✅ Backports have been created

Details

Copilot AI balanced review requested due to automatic review settings October 14, 2026 12:33

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.

🔵 Needs a closer look

It is a sizeable new CLI feature whose key runtime paths (on-demand host spawning and live MCP interaction) are validated only manually and cannot be exercised by the automated tests, warranting human review.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@kazo0
kazo0 enabled auto-merge October 14, 2026 12:45
Copilot AI balanced review requested due to automatic review settings October 14, 2026 12:50
@github-actions github-actions Bot added area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation labels Oct 14, 2026

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.

🔵 Needs a closer look

It introduces a large (~646-line) new CLI surface that spawns the DevServer and performs MCP/process I/O whose end-to-end behavior cannot be verified here, so it warrants final human review.

0 open findings

🧠 Review effort: Balanced

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 239466 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • DisplayInformation.png-dark
    • DynamicFont.png-dark
    • DynamicFont.png
    • DropDownButtonPage.png-dark
    • Examples.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
  • skia-windows-screenshots: 2458 changed over 2488

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png-dark
    • AppBarButtonTest.png-dark
    • AppBarButtonTest.png
    • AppBarToggleButtonTest.png-dark
    • ApplicationViewSizing.png-dark
    • AppWindowClosing.png-dark
    • AppWindowPresenters.png-dark
    • ArcSegment.png-dark
    • Attributed_text_Simple.png
    • Attributed_text_Supserscript.png-dark
    • AutoBorderStretchwithrightmargin.png
    • AutoBorderStretchwithtopmargin.png-dark
    • AutomationProperties_StructureAndProps.png
    • AutoSizedPathCentered.png-dark
    • AutoSuggestBox_SoftKeboard.png-dark
    • AutoSuggestBox_SoftKeboard.png
    • Basics_Automated.png-dark
    • Basics_Automated.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png

@vatsashah45 vatsashah45 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.

Reviewed at c73bdbc against uno.app-mcp main as of today (which now includes #188's 2a58bfc). The verb table, parameter names, restart, wait --ready and the find matched field all line up with main, and the IsAppCommand tests close Copilot's finding. Three things inline: the verdict exit-code table predates 2a58bfc, a file query can exit 0 on an unavailable status, and the global logging options do not survive the app verb.

…tions around `app`

- hot-reload-status --file: noChanges, superseded and ignored exit 0; queued,
  processing, notReceived and applying exit 4 (call again); a file query with
  no verdict (status unavailable) exits 1 instead of 0.
- --log-level/-l/--file-log/-fl are applied by Program before or after the
  verb, and are no longer sent to the tool or rejected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Fd9qv2ueBstmsvPi99nW4L
Copilot AI balanced review requested due to automatic review settings October 14, 2026 14:19

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.

🔵 Needs a closer look

It introduces a large new user-facing CLI surface whose core runtime behavior depends on a live host and an external App MCP contract that cannot be validated in automated review, so it warrants final human review.

0 open findings

🧠 Review effort: Balanced

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 239483 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png-dark
    • Buttons.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • DisplayInformation.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • DropDownButtonPage.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Examples.png
  • skia-windows-screenshots: 2458 changed over 2488

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png
    • AppBarButtonTest.png
    • AppBar_KeyBoard.png
    • Application_DispatcherShutdownMode.png
    • AppWindowPresenters.png
    • Attributed_text_FontSize_Changing.png
    • AuthenticationBroker_Demo.png
    • AutoBorderStretchwithrightmargin.png
    • AutomationProperties_StructureAndProps.png
    • AutoSizedPathCentered.png-dark
    • AutoSuggestBox_SoftKeboard.png-dark
    • AutoSuggestBox_SoftKeboard.png
    • BasicThemeResources.png-dark
    • BasicThemeResources.png
    • BitmapIcon_Generic.png-dark
    • BitmapIcon_Generic.png
    • BorderCenteredwithmargins.png-dark
    • BorderCenteredwithmargins.png
    • BorderLeftwithmargins.png-dark
    • BorderLeftwithmargins.png

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 239483 has failed on Uno.UI - CI.

@kazo0
kazo0 merged commit 44c5630 into master Oct 14, 2026
59 checks passed
@kazo0
kazo0 deleted the dev/steve/devserver-cli-app-verbs branch October 14, 2026 18:06
@mergify

mergify Bot commented Oct 14, 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.

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

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants