Aspire Skill
Orchestrate, monitor, and debug .NET Aspire distributed applications using the Aspire CLI and Aspire MCP tools.
Resources are defined in the AppHost project (Program.cs or AppHost.cs). The CLI manages the app lifecycle; the MCP tools provide real-time inspection from within the editor.
Aspire evolves rapidly. When unsure about an API or behavior, use
mcp_aspire_search_docsoraspire docs searchto check before guessing.
Quick reference — CLI commands
| Task | Command |
|---|---|
| Start the app (background) | aspire start |
| Start isolated (worktrees) | aspire start --isolated |
| Run the app (foreground) | aspire run |
| Restart the app | aspire start (stops previous automatically) |
| Wait for resource healthy | aspire wait <resource> |
| Stop the app | aspire stop |
| List resources | aspire describe [resource] |
| Run resource command | aspire resource <resource> <command> |
| View console logs | aspire logs [resource] |
| View structured logs | aspire otel logs [resource] |
| View spans | aspire otel spans [resource] |
| View traces | aspire otel traces [resource] |
| Logs for a trace | aspire otel logs --trace-id <id> |
| Add an integration | aspire add |
| Create new project | aspire new |
| Init Aspire in existing solution | aspire init |
| List running AppHosts | aspire ps |
| Update AppHost packages | aspire update |
| Export telemetry to zip | aspire export [resource] |
| Search docs | aspire docs search <query> |
| Get doc page | aspire docs get <slug> |
| List doc pages | aspire docs list |
| Environment diagnostics | aspire doctor |
Most commands support --format Json for machine-readable output. Use --apphost <path> to target a specific AppHost.
Full CLI reference → load references/cli-reference.md
Quick reference — MCP tools
| Task | MCP Tool |
|---|---|
| Environment diagnostics | mcp_aspire_doctor |
| List detected AppHosts | mcp_aspire_list_apphosts |
| Select an AppHost | mcp_aspire_select_apphost(appHostPath=...) |
| List resources & status | mcp_aspire_list_resources |
| Execute resource command | mcp_aspire_execute_resource_command(resourceName, commandName) |
| Console logs (stdout/stderr) | mcp_aspire_list_console_logs(resourceName) |
| Structured logs | mcp_aspire_list_structured_logs(resourceName?) |
| Distributed traces | mcp_aspire_list_traces(resourceName?) |
| Logs for a specific trace | mcp_aspire_list_trace_structured_logs(traceId) |
| List available integrations | mcp_aspire_list_integrations |
| Search aspire.dev docs | mcp_aspire_search_docs(query, topK?) |
| Get full doc page | mcp_aspire_get_doc(slug, section?) |
| List all doc pages | mcp_aspire_list_docs |
| Refresh tool list | mcp_aspire_refresh_tools |
Tools that do not require a running AppHost: mcp_aspire_doctor, mcp_aspire_list_integrations, mcp_aspire_search_docs, mcp_aspire_get_doc, mcp_aspire_list_docs.
Full MCP reference → load references/mcp-tools.md
Key workflows
Pre-flight check
Before starting the app for the first time, verify the environment:
mcp_aspire_doctor
This runs comprehensive checks (SDK version, container runtime, CLI version, etc.) and returns pass/warning/fail with actionable fix suggestions. Does not require a running AppHost.
If mcp_aspire_doctor is unavailable, use the CLI equivalent:
aspire doctor
Running in agent environments
Use aspire start to run the AppHost in the background. When working in a git worktree, use --isolated to avoid port conflicts:
aspire start --isolated
Use aspire wait <resource> to block until a resource is healthy before interacting with it:
aspire start --isolated
aspire wait myapi
Relaunching is safe — aspire start automatically stops any previous instance. Re-run aspire start whenever changes are made to the AppHost project.
Monitoring resources
Once running, use MCP or CLI interchangeably:
| Intent | MCP tool | CLI equivalent |
|---|---|---|
| Resource status overview | mcp_aspire_list_resources |
aspire describe |
| Restart a resource | mcp_aspire_execute_resource_command(resourceName, "resource-restart") |
aspire resource <name> restart |
| Stop a resource | mcp_aspire_execute_resource_command(resourceName, "resource-stop") |
aspire resource <name> stop |
| Start a stopped resource | mcp_aspire_execute_resource_command(resourceName, "resource-start") |
aspire resource <name> start |
Debugging issues
Before making code changes, inspect the app state:
- Check resource status —
mcp_aspire_list_resourcesoraspire describe - View structured logs —
mcp_aspire_list_structured_logs(resourceName=...)oraspire otel logs <resource> - View distributed traces —
mcp_aspire_list_traces(resourceName=...)oraspire otel traces <resource> - Drill into trace logs —
mcp_aspire_list_trace_structured_logs(traceId=...)oraspire otel logs --trace-id <id> - Fall back to console logs —
mcp_aspire_list_console_logs(resourceName=...)oraspire logs <resource>
This top-down approach (status → structured logs → traces → trace logs → console logs) finds root causes efficiently.
Console logs can be extremely verbose. Never dump full console logs to the user. Read them, find the relevant parts, and summarize.
Adding integrations
- Search for the integration:
mcp_aspire_search_docs(query="redis integration")oraspire docs search redis - Read the docs:
mcp_aspire_get_doc(slug="redis-integration")oraspire docs get redis-integration - Add the package:
aspire add redis - Restart the app:
aspire start(automatically stops previous instance)
For a catalog of available integrations: mcp_aspire_list_integrations or see references/integrations.md.
Multiple AppHosts
If the workspace contains multiple AppHost projects:
mcp_aspire_list_apphosts # See all detected AppHosts
mcp_aspire_select_apphost(appHostPath="src/MyApp.AppHost") # Select one
Or via CLI: aspire ps to list, --apphost <path> flag on any command to target a specific one.
Important rules
- Always verify the starting state before making changes — run
mcp_aspire_doctorfor environment checks, thenaspire startandmcp_aspire_list_resourcesto confirm baseline health. - To restart, just run
aspire startagain — it automatically stops the previous instance. NEVER chainaspire stopthenaspire start. aspire startvsaspire run:aspire startruns in background (preferred for agents);aspire runruns in foreground (long-running, must be a background terminal process).- Use
--isolatedwhen working in a worktree. - Avoid persistent containers early in development to prevent state management issues.
- Never install the Aspire workload — it is obsolete. Use the Aspire CLI (
dotnet tool install -g aspire). - Prefer
aspire.devandlearn.microsoft.com/dotnet/aspirefor official documentation. - Never print full console logs to the user — summarize the relevant parts.
Reference files
Load these on demand for deeper detail:
| File | When to load |
|---|---|
| references/cli-reference.md | Full CLI command reference with examples |
| references/mcp-tools.md | Detailed MCP tool usage and workflows |
| references/architecture.md | AppHost, service discovery, service defaults, lifecycle |
| references/integrations.md | Common integration patterns and configuration |
| references/docs-index.md | Documentation links and when to fetch docs |