Update skill to CLI commands, rework agent init, add aspire mcp tools/call#14837
Update skill to CLI commands, rework agent init, add aspire mcp tools/call#14837mitchdenny merged 2 commits intorelease/13.2from
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14837Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14837" |
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22749871815 |
There was a problem hiding this comment.
Pull request overview
Updates the Aspire agent skill content generated by aspire agent init to rely on Aspire CLI commands (rather than Aspire MCP server tools), so agents can manage/run/debug Aspire apps in environments that only have the CLI installed.
Changes:
- Rewrites the generated
SKILL.mdcontent to reference CLI equivalents (e.g.,aspire start,aspire wait,aspire docs search,aspire otel ...,--apphost). - Adds a compact CLI command reference table and updated “key workflows / rules” guidance around detached + isolated execution.
- Updates the unit test assertion to validate the new skill content.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Aspire.Cli/Agents/CommonAgentApplicators.cs | Replaces embedded SkillFileContent to use CLI commands and updated guidance/rules. |
| tests/Aspire.Cli.Tests/Agents/CommonAgentApplicatorsTests.cs | Updates test to assert for new skill content (aspire start --isolated). |
427053b to
05a9e79
Compare
416d040 to
fd14fb8
Compare
|
I have some concerns about replacing the logs and telemetry MCP tools. For example, |
|
Actually, I forgot I added the resource destination to output JSON. There is a "aspire.destination" value added to span attributes. The Aspire skill should mention that can be used to match a span to the resource it calls. I still worry about the size of telemetry JSON (it's verbose) but hopefully agents put some effort into client analysis rather than putting everything in the context window. |
All of the agents worth their salt have large context optimization by putting the result on disk and grepping 😄. That said I still think we should enable more complex filtering with the cli that what we have right now. |
f066eb1 to
ed3b1b0
Compare
6db004c to
28d8723
Compare
83058d0 to
3153a99
Compare
3153a99 to
e4adcba
Compare
mitchdenny
left a comment
There was a problem hiding this comment.
Code Review — 3 Issues Found
1. 🔴 High — preSelected not forwarded via extension backchannel
File: src/Aspire.Cli/Interaction/ExtensionInteractionService.cs:276
When the extension prompt path is active, Backchannel.PromptForSelectionsAsync(...) is called without the new preSelected parameter. The console fallback path (line 293) correctly passes it through. This means extensions will never see pre-selected items.
// Extension path (line 276) — missing preSelected:
var result = await Backchannel.PromptForSelectionsAsync(promptText.RemoveSpectreFormatting(), choices, choiceFormatter, _cancellationToken);
// Console fallback path (line 293) — correctly passes preSelected:
return await _consoleInteractionService.PromptForSelectionsAsync(promptText, choices, choiceFormatter, preSelected, optional, cancellationToken);2. 🟡 Medium — Unhandled InvalidOperationException in McpCallCommand
File: src/Aspire.Cli/Commands/McpCallCommand.cs:93-104
If --input is a JSON array or primitive (not an object), EnumerateObject() throws InvalidOperationException, which isn't caught by the catch (JsonException) block. Users would see a raw stack trace instead of a friendly error.
Fix: check doc.RootElement.ValueKind == JsonValueKind.Object before calling EnumerateObject(), or widen the catch to include InvalidOperationException.
3. 🟡 Medium — TestInteractionService drops TryDequeue call
File: tests/Aspire.Cli.Tests/TestServices/TestInteractionService.cs:127
The _responses.TryDequeue(out _) line was removed entirely. Any existing test that enqueues a response expecting it to be consumed by PromptForSelectionsAsync will now have a stale queue, potentially affecting subsequent prompt assertions in the same test.
I don't use request changes ... it stops flow
…e mcp tools/call ## Skill updates - Replace all MCP server tool references with CLI command equivalents - Use aspire start (not aspire run) for agents, --isolated for worktrees - Add aspire wait, aspire mcp tools, aspire mcp call to command table - Restore USE FOR/DO NOT USE FOR routing tags in frontmatter - Explicit rules: never use aspire run, restart via aspire start ## Agent init rework - Single flat prompt instead of 3 grouped prompts - Skill file pre-selected (Recommended), MCP server opt-in (last) - Playwright CLI shown as separate option - Deprecated config migrations applied silently - Categorization via McpInitPromptGroup (SkillFiles, Tools, AgentEnvironments) - Shows which environments were configured after applying - preSelected parameter added to PromptForSelectionsAsync ## New CLI commands - aspire mcp tools: list MCP tools from running resources via backchannel - aspire mcp call <resource> <tool> --input <json>: invoke resource MCP tools Fixes #14619 Fixes #14856 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nt, restore TryDequeue - McpCallCommand: Validate JSON input is an object before calling EnumerateObject() to avoid unhandled InvalidOperationException for array/primitive inputs. - ExtensionInteractionService: Add comment documenting that the extension backchannel protocol does not yet support preSelected. - TestInteractionService: Restore _responses.TryDequeue call to maintain queue consumption behavior for existing tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
cd667e4 to
13d0faa
Compare
…/call (microsoft#14837) * Update Aspire skill to use CLI commands, rework agent init, add aspire mcp tools/call ## Skill updates - Replace all MCP server tool references with CLI command equivalents - Use aspire start (not aspire run) for agents, --isolated for worktrees - Add aspire wait, aspire mcp tools, aspire mcp call to command table - Restore USE FOR/DO NOT USE FOR routing tags in frontmatter - Explicit rules: never use aspire run, restart via aspire start ## Agent init rework - Single flat prompt instead of 3 grouped prompts - Skill file pre-selected (Recommended), MCP server opt-in (last) - Playwright CLI shown as separate option - Deprecated config migrations applied silently - Categorization via McpInitPromptGroup (SkillFiles, Tools, AgentEnvironments) - Shows which environments were configured after applying - preSelected parameter added to PromptForSelectionsAsync ## New CLI commands - aspire mcp tools: list MCP tools from running resources via backchannel - aspire mcp call <resource> <tool> --input <json>: invoke resource MCP tools Fixes microsoft#14619 Fixes microsoft#14856 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix review issues: JSON input validation, extension backchannel comment, restore TryDequeue - McpCallCommand: Validate JSON input is an object before calling EnumerateObject() to avoid unhandled InvalidOperationException for array/primitive inputs. - ExtensionInteractionService: Add comment documenting that the extension backchannel protocol does not yet support preSelected. - TestInteractionService: Restore _responses.TryDequeue call to maintain queue consumption behavior for existing tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Mitch Denny <mitch@mitchdeny.com>
…/call (#14837) * Update Aspire skill to use CLI commands, rework agent init, add aspire mcp tools/call ## Skill updates - Replace all MCP server tool references with CLI command equivalents - Use aspire start (not aspire run) for agents, --isolated for worktrees - Add aspire wait, aspire mcp tools, aspire mcp call to command table - Restore USE FOR/DO NOT USE FOR routing tags in frontmatter - Explicit rules: never use aspire run, restart via aspire start ## Agent init rework - Single flat prompt instead of 3 grouped prompts - Skill file pre-selected (Recommended), MCP server opt-in (last) - Playwright CLI shown as separate option - Deprecated config migrations applied silently - Categorization via McpInitPromptGroup (SkillFiles, Tools, AgentEnvironments) - Shows which environments were configured after applying - preSelected parameter added to PromptForSelectionsAsync ## New CLI commands - aspire mcp tools: list MCP tools from running resources via backchannel - aspire mcp call <resource> <tool> --input <json>: invoke resource MCP tools Fixes #14619 Fixes #14856 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix review issues: JSON input validation, extension backchannel comment, restore TryDequeue - McpCallCommand: Validate JSON input is an object before calling EnumerateObject() to avoid unhandled InvalidOperationException for array/primitive inputs. - ExtensionInteractionService: Add comment documenting that the extension backchannel protocol does not yet support preSelected. - TestInteractionService: Restore _responses.TryDequeue call to maintain queue consumption behavior for existing tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Mitch Denny <mitch@mitchdeny.com>
Description
Three related changes that shift the Aspire agent story from MCP-server-dependent to CLI-first:
1. Skill file: MCP tools → CLI commands
Updates the Aspire skill (
SKILL.mdgenerated byaspire agent init) to use CLI commands instead of MCP server tools. The skill no longer requires the MCP server to be configured — it works in any environment where theaspireCLI is installed.Key changes:
aspire startinstead ofaspire run— agents should always useaspire start(detached), with--isolatedin worktreesaspire wait <resource>— block until a resource is healthy before interactingaspire mcp tools/aspire mcp call— discover and invoke resource MCP tools via CLIaspire docs searchfor finding integration docsaspire run, restart by re-runningaspire start2. Agent init rework
Replaces the 3-group sequential prompt flow with a single flat prompt:
McpInitPromptGroup(SkillFiles,Tools,AgentEnvironments) instead of string matchingpreSelectedparameter added toPromptForSelectionsAsync3. New CLI commands:
aspire mcp tools/aspire mcp callCLI-native MCP tool discovery and invocation for resources that expose MCP tools (e.g.
WithPostgresMcp()):Uses the existing backchannel connection (same as
aspire describe,aspire logs, etc.) — no MCP server needed. Pattern matches prior art (mcptools, mcp-cli).Fixes #14619
Fixes #14856
Checklist
aspire.devissue: