{"record":{"id":"1eeb740102bcd141","repo":"microsoft/aspire","slug":"internalerror-1eeb74","errorCode":"InternalError","errorMessage":"No Aspire AppHost is currently running. To use Aspire MCP tools, you must first start an Aspire application by running 'aspire start' in your AppHost project directory. Once the application is running, the MCP tools will be able to connect to the dashboard and execute commands.","messagePattern":"No Aspire AppHost is currently running\\. To use Aspire MCP tools, you must first start an Aspire application by running 'aspire start' in your AppHost project directory\\. Once the application is running, the MCP tools will be able to connect to the dashboard and execute commands\\.","errorType":"error_code","errorClass":"McpProtocolException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Cli/Mcp/Tools/ListConsoleLogsTool.cs","lineNumber":71,"sourceCode":"        }\n\n        if (string.IsNullOrEmpty(resourceName))\n        {\n            throw new McpProtocolException(\"The resourceName parameter is required.\", McpErrorCode.InvalidParams);\n        }\n\n        string? search = null;\n        if (arguments is not null && arguments.TryGetValue(\"search\", out var searchElement) &&\n            searchElement.ValueKind == JsonValueKind.String)\n        {\n            search = searchElement.GetString();\n        }\n\n        var connection = await AppHostConnectionHelper.GetSelectedConnectionAsync(auxiliaryBackchannelMonitor, logger, cancellationToken).ConfigureAwait(false);\n        if (connection is null)\n        {\n            logger.LogWarning(\"No Aspire AppHost is currently running\");\n            throw new McpProtocolException(McpErrorMessages.NoAppHostRunning, McpErrorCode.InternalError);\n        }\n\n        // Check if the resource is excluded from MCP before fetching logs.\n        // This is the only check needed because the resource name is required for this tool.\n        var excludedResult = await McpToolHelpers.CheckResourceExcludedAsync(connection, resourceName, cancellationToken).ConfigureAwait(false);\n        if (excludedResult is not null)\n        {\n            return excludedResult;\n        }\n\n        try\n        {\n            var logParser = new LogParser(ConsoleColor.Black);\n            var logEntries = new LogEntries(maximumEntryCount: SharedAIHelpers.ConsoleLogsLimit) { BaseLineNumber = 1 };\n\n            // Collect logs from the backchannel\n            await foreach (var logLine in connection.GetResourceLogsAsync(resourceName, follow: false, cancellationToken).ConfigureAwait(false))\n            {","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Cli/Mcp/Tools/ListConsoleLogsTool.cs#L53-L89","documentation":"Thrown by ListConsoleLogsTool.CallToolAsync when AppHostConnectionHelper.GetSelectedConnectionAsync returns null, meaning the CLI has no live auxiliary backchannel connection to a running Aspire AppHost. The shared message McpErrorMessages.NoAppHostRunning explains how to start one; code is InternalError (-32603).","triggerScenarios":"Calling the list-console-logs MCP tool while no 'aspire start' session is active, the AppHost has exited, or no backchannel connection is selected in the monitor.","commonSituations":"Running MCP clients in a fresh terminal before starting the AppHost; AppHost crashed or was stopped; CLI session pointed at a different directory than the AppHost project; backchannel dropped after an AppHost restart.","solutions":["Run 'aspire start' in your AppHost project directory, then retry the tool call.","Verify the AppHost process is still running (dashboard reachable) and restart it if it exited.","Reconnect the CLI/session to the running AppHost so a backchannel connection is selected.","Confirm you are operating in the same project directory / environment as the running AppHost."],"exampleFix":"# before: tool call fails with no connection\naspire mcp list-console-logs --resource frontend\n# after: start the AppHost first\naspire start\naspire mcp list-console-logs --resource frontend","handlingStrategy":"try-catch","validationCode":"// Pre-flight: verify a live AppHost connection before calling the tool\nvar connection = await AppHostConnectionHelper.GetSelectedConnectionAsync(monitor, logger, ct);\nif (connection is null)\n{\n    // Prompt user to run 'aspire start' in the AppHost project directory\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    await ListConsoleLogsAsync(resourceName);\n}\ncatch (McpProtocolException ex) when (ex.Message.Contains(\"No Aspire AppHost is currently running\"))\n{\n    logger.LogWarning(\"AppHost not running; instruct user to run 'aspire start' and retry.\");\n}","preventionTips":["Start the AppHost with 'aspire start' before invoking MCP tools.","Check the dashboard is reachable before each tool session.","Handle AppHost restarts by re-establishing the backchannel connection.","Run the MCP client and AppHost in the same directory/environment/session."],"tags":["mcp","apphost","connection","aspire-cli"],"backgroundTag":"no-apphost-running","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}