콘텐츠로 이동
Docs Try Aspire

aspire mcp call command

이 콘텐츠는 아직 번역되지 않았습니다.

aspire mcp call - Call an MCP tool on a running resource.

Aspire CLI
aspire mcp call <resource> <tool> [options]

The aspire mcp call command calls an MCP tool exposed by a resource in a running AppHost. Use aspire mcp tools first if you need to discover the available resources and tool names.

When executed without the --apphost option, the command:

  1. Scans for all running AppHost processes.
  2. If multiple AppHosts are running within the current directory scope, prompts you to select which one to target.
  3. If only one AppHost is running in scope, connects to it directly.
  4. If no in-scope AppHosts are found but out-of-scope AppHosts exist, displays all running AppHosts for selection.
  • <resource>

    The name of the resource that exposes the MCP tool.

  • <tool>

    The name of the MCP tool to call.

The following options are available:

  • -i, --input <input>

    JSON input to pass to the tool.

  • --apphost <apphost>

    The path to the Aspire AppHost project file.

  • -?, -h, --help

    Prints help and usage documentation for the available commands and options.

  • -l, --log-level <Critical|Debug|Error|Information|None|Trace|Warning>

    Set the minimum log level for console output. Use this option to increase diagnostics while troubleshooting or reduce output in scripted runs.

  • --non-interactive

    Run the command in non-interactive mode, disabling all interactive prompts and spinners.

  • --nologo

    Suppress the startup banner and telemetry notice.

  • --banner

    Display the animated Aspire CLI welcome banner.

  • --wait-for-debugger

    Wait for a debugger to attach before running a command.

  • Call a tool on a running resource:

    Aspire CLI
    aspire mcp call myresource mytool
  • Pass JSON input to the tool call:

    Aspire CLI
    aspire mcp call myresource mytool --input '{"message":"hello"}'
  • Target a specific AppHost project:

    Aspire CLI
    aspire mcp call myresource mytool --apphost './src/MyApp.AppHost/MyApp.AppHost.csproj'