aspire mcp call command

Name

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

Synopsis

aspire mcp call   [options]

Description

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. 1

    Scans for all running AppHost processes.

  2. 2

    If multiple AppHosts are running within the current directory scope, prompts you to select which one to target.

  3. 3

    If only one AppHost is running in scope, connects to it directly.

  4. 4

    If no in-scope AppHosts are found but out-of-scope AppHosts exist, displays all running AppHosts for selection.

Arguments

  • <resource>

    The name of the resource that exposes the MCP tool.

  • <tool>

    The name of the MCP tool to call.

Options

The following options are available:

  • -i, --input <input>

    JSON input to pass to the tool.

              • Examples

  • Call a tool on a running resource:

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

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

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

See also