{"record":{"id":"89778d2a1ed99a5f","repo":"abpframework/abp","slug":"could-not-connect-to-abp-io-mcp-server-the-mcp-se","errorCode":null,"errorMessage":"Could not connect to ABP.IO MCP Server. The MCP server requires a connection to fetch tool definitions. Please check your internet connection and try again.","messagePattern":"Could not connect to ABP\\.IO MCP Server\\. The MCP server requires a connection to fetch tool definitions\\. Please check your internet connection and try again\\.","errorType":"validation","errorClass":"CliUsageException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/McpCommand.cs","lineNumber":74,"sourceCode":"        await ValidateLicenseAsync();\n\n        var option = commandLineArgs.Target;\n\n        if (!string.IsNullOrEmpty(option) && option.Equals(\"get-config\", StringComparison.OrdinalIgnoreCase))\n        {\n            await PrintConfigurationAsync();\n            return;\n        }\n\n        await using var _ = _telemetryService.TrackActivityAsync(ActivityNameConsts.AbpCliCommandsMcp);\n\n        // Check server health before starting - fail if not reachable\n        _mcpLogger.Info(LogSource, \"Checking ABP.IO MCP Server connection...\");\n        var isHealthy = await _mcpHttpClient.CheckServerHealthAsync();\n        \n        if (!isHealthy)\n        {\n            throw new CliUsageException(\n                \"Could not connect to ABP.IO MCP Server. \" +\n                \"The MCP server requires a connection to fetch tool definitions. \" +\n                \"Please check your internet connection and try again.\");\n        }\n\n        _mcpLogger.Info(LogSource, \"Starting ABP MCP Server...\");\n        \n        var cts = new CancellationTokenSource();\n        \n        ConsoleCancelEventHandler cancelHandler = (sender, e) =>\n        {\n            e.Cancel = true;\n            _mcpLogger.Info(LogSource, \"Shutting down ABP MCP Server...\");\n            \n            try\n            {\n                cts.Cancel();\n            }","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/McpCommand.cs#L56-L92","documentation":"Thrown by McpCommand when the health check against the ABP.IO MCP Server fails. Before starting the MCP server, the command calls _mcpHttpClient.CheckServerHealthAsync(); if it returns false, the command cannot fetch tool definitions and aborts with CliUsageException. This is a network/connectivity prerequisite check.","triggerScenarios":"CheckServerHealthAsync() returns false due to: no internet connection, ABP.IO server unreachable, proxy/firewall blocking the request, DNS resolution failure, or the server health endpoint returning a non-success status.","commonSituations":"Corporate network with strict firewall/proxy rules blocking outbound HTTPS to abp.io, intermittent connectivity during `abp mcp` startup, DNS issues, or ABP.IO server downtime. Also in air-gapped environments where no external connectivity is available.","solutions":["Verify internet connectivity and that abp.io is reachable: `curl -I https://abp.io`","Configure proxy settings if behind a corporate proxy (HTTP_PROXY/HTTPS_PROXY environment variables)","Check for any firewall rules blocking outbound HTTPS traffic to abp.io","Retry after confirming network stability, as this may be transient server-side downtime","If in an air-gapped environment, the MCP server feature is not available without connectivity"],"exampleFix":"N/A","handlingStrategy":"retry","validationCode":"// Pre-check connectivity to abp.io before running the MCP command\nusing var client = new HttpClient { Timeout = TimeSpan.FromSeconds(10) };\ntry\n{\n    var response = await client.GetAsync(\"https://abp.io/api/mcp/health\");\n    if (!response.IsSuccessStatusCode)\n        Console.Error.WriteLine(\"Warning: ABP.IO MCP server health check failed.\");\n}\ncatch\n{\n    Console.Error.WriteLine(\"Warning: Cannot reach abp.io. Check network/proxy settings.\");\n}","typeGuard":null,"tryCatchPattern":"for (int attempt = 0; attempt < 3; attempt++)\n{\n    try\n    {\n        await mcpCommand.ExecuteAsync(commandLineArgs);\n        break;\n    }\n    catch (CliUsageException ex) when (ex.Message.Contains(\"Could not connect to ABP.IO MCP Server\") && attempt < 2)\n    {\n        logger.LogWarning(\"MCP server unreachable, retrying in {0}s...\", (attempt + 1) * 5);\n        await Task.Delay((attempt + 1) * 5000);\n    }\n}","preventionTips":["Configure HTTP_PROXY/HTTPS_PROXY environment variables in corporate networks","Verify outbound HTTPS connectivity to abp.io before running in CI","Understand the MCP feature requires live internet — it is not available air-gapped"],"tags":["cli","abp-cli","mcp","network","connectivity"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}