{"record":{"id":"e0915cb1c00d8573","repo":"abpframework/abp","slug":"no-active-license-found","errorCode":null,"errorMessage":"No active license found.","messagePattern":"No active license found\\.","errorType":"validation","errorClass":"CliUsageException","httpStatus":null,"severity":"critical","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/McpCommand.cs","lineNumber":135,"sourceCode":"            cts.Dispose();\n        }\n    }\n\n    private async Task ValidateLicenseAsync()\n    {\n        var loginInfo = await _authService.GetLoginInfoAsync();\n\n        if (string.IsNullOrEmpty(loginInfo?.Organization))\n        {\n            throw new CliUsageException(\"Please log in with your account!\");\n        }\n        \n        var licenseResult = await _apiKeyService.GetApiKeyOrNullAsync();\n\n        if (licenseResult == null || !licenseResult.HasActiveLicense)\n        {\n            var errorMessage = licenseResult?.ErrorMessage ?? \"No active license found.\";\n            throw new CliUsageException(errorMessage);\n        }\n\n        if (licenseResult.LicenseEndTime.HasValue && licenseResult.LicenseEndTime.Value < DateTime.UtcNow)\n        {\n            throw new CliUsageException(\"Your license has expired. Please renew your license to use the MCP server.\");\n        }\n    }\n\n    private Task PrintConfigurationAsync()\n    {\n        var config = new McpClientConfiguration\n        {\n            McpServers = new Dictionary<string, McpServerConfig>\n            {\n                [\"abp\"] = new McpServerConfig\n                {\n                    Command = \"abp\",\n                    Args = new List<string> { \"mcp\" },","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/McpCommand.cs#L117-L153","documentation":"Thrown by McpCommand.ValidateLicenseAsync when _apiKeyService.GetApiKeyOrNullAsync() returns null or a result where HasActiveLicense is false. This is the second gate in the MCP license validation: even after confirming authentication, the user must have an active ABP Commercial license. If licenseResult carries an ErrorMessage, that is used instead of the default message.","triggerScenarios":"The authenticated account has no ABP Commercial license, the license has been deactivated/cancelled, or GetApiKeyOrNullAsync() fails to retrieve license data and returns null. licenseResult == null || !licenseResult.HasActiveLicense evaluates true.","commonSituations":"Free/community account attempting to use the MCP server (which requires a commercial license), expired trial license, license not yet provisioned for a new purchase, or a server-side error retrieving license details (in which case ErrorMessage may carry the specific cause).","solutions":["Verify your ABP Commercial license is active in the ABP.IO account portal","If using a trial, ensure it has not expired; renew or purchase a license","Check licenseResult.ErrorMessage (if surfaced in CLI output) for the specific server-side reason","Contact ABP support if the license should be active but is not being recognized","Log in with the correct account that holds the active license: `abp login` with the licensed account"],"exampleFix":"N/A","handlingStrategy":"validation","validationCode":"// Verify active license before running MCP commands\nvar license = await apiKeyService.GetApiKeyOrNullAsync();\nif (license == null || !license.HasActiveLicense)\n{\n    Console.Error.WriteLine($\"Error: No active ABP Commercial license. {license?.ErrorMessage}\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    await mcpCommand.ExecuteAsync(commandLineArgs);\n}\ncatch (CliUsageException ex) when (ex.Message.Contains(\"license\"))\n{\n    logger.LogError(\"License issue: {0}. Verify your ABP Commercial subscription.\", ex.Message);\n}","preventionTips":["Confirm your ABP Commercial license is active in the account portal before using MCP","Log in with the account that holds the licensed seat","Check licenseResult.ErrorMessage for server-side detail when troubleshooting"],"tags":["cli","abp-cli","mcp","license","authorization"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}