abpframework/abp · critical · CliUsageException

No active license found.

Error message

No active license found.

What it means

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.

Solutions

  1. Verify your ABP Commercial license is active in the ABP.IO account portal
  2. If using a trial, ensure it has not expired; renew or purchase a license
  3. Check licenseResult.ErrorMessage (if surfaced in CLI output) for the specific server-side reason
  4. Contact ABP support if the license should be active but is not being recognized
  5. Log in with the correct account that holds the active license: `abp login` with the licensed account

Example fix

N/A
Defensive patterns

Strategy: validation

Validate before calling

// Verify active license before running MCP commands
var license = await apiKeyService.GetApiKeyOrNullAsync();
if (license == null || !license.HasActiveLicense)
{
    Console.Error.WriteLine($"Error: No active ABP Commercial license. {license?.ErrorMessage}");
    return;
}

Try / catch

try
{
    await mcpCommand.ExecuteAsync(commandLineArgs);
}
catch (CliUsageException ex) when (ex.Message.Contains("license"))
{
    logger.LogError("License issue: {0}. Verify your ABP Commercial subscription.", ex.Message);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Related errors


AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13). Data as JSON: /api/errors/e0915cb1c00d8573. Report an issue: GitHub.

Appendix: source

Thrown at framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/McpCommand.cs:135

            cts.Dispose();
        }
    }

    private async Task ValidateLicenseAsync()
    {
        var loginInfo = await _authService.GetLoginInfoAsync();

        if (string.IsNullOrEmpty(loginInfo?.Organization))
        {
            throw new CliUsageException("Please log in with your account!");
        }
        
        var licenseResult = await _apiKeyService.GetApiKeyOrNullAsync();

        if (licenseResult == null || !licenseResult.HasActiveLicense)
        {
            var errorMessage = licenseResult?.ErrorMessage ?? "No active license found.";
            throw new CliUsageException(errorMessage);
        }

        if (licenseResult.LicenseEndTime.HasValue && licenseResult.LicenseEndTime.Value < DateTime.UtcNow)
        {
            throw new CliUsageException("Your license has expired. Please renew your license to use the MCP server.");
        }
    }

    private Task PrintConfigurationAsync()
    {
        var config = new McpClientConfiguration
        {
            McpServers = new Dictionary<string, McpServerConfig>
            {
                ["abp"] = new McpServerConfig
                {
                    Command = "abp",
                    Args = new List<string> { "mcp" },

View on GitHub (pinned to 7ed43b1931)