AI assistants (MCP)
sunlicense mcp lets the AI coding assistant you already use manage SunLicense for you: list and issue licenses, block a leaked key's machine, create an API key for your app, write the SDK code and check that it works. It's a Model Context Protocol server that runs on your computer through the CLI, so it works with Claude Code, Codex, Cursor, Antigravity and any other assistant that speaks MCP.
The assistant acts as you: it can do exactly what your role allows (and, with a token, what the token's scopes allow). MCP is included in the Lite and Standard plans.
Set it up
- Install the CLI (version 0.2.0 or later).
- Create a personal access token in the dashboard under Settings → Personal access tokens, with only the permissions the assistant needs (for example
products.read,licenses.read,licenses.write,api_keys.write). Signing in withsunlicense loginalso works, but that session expires after 12 hours. - Add the server to your assistant:
claude mcp add sunlicense --env SUNLICENSE_TOKEN=slp_... -- sunlicense mcpcodex mcp add sunlicense --env SUNLICENSE_TOKEN=slp_... -- sunlicense mcp{
"mcpServers": {
"sunlicense": {
"command": "sunlicense",
"args": ["mcp"],
"env": { "SUNLICENSE_TOKEN": "slp_..." }
}
}
}{
"mcpServers": {
"sunlicense": {
"command": "sunlicense",
"args": ["mcp"],
"env": { "SUNLICENSE_TOKEN": "slp_..." }
}
}
}Then ask, for example: "Issue a Pro license of Acme Editor to [email protected]", "Which licenses were checked from more than two machines?", or "Add SunLicense to this Paper plugin and test it with my license".
To use a local stack instead of production, add --env SUNLICENSE_SERVER=http://localhost. Add SUNLICENSE_API_KEY=slk_... (an API key) to let the assistant run test license checks.
Tools
| Tool | What it does |
|---|---|
list_products, list_policies | Your products and their policies (machine limits, durations) |
list_licenses, get_license | Licenses by product, status or search, one license with its machines and recent checks. Keys are masked |
reveal_license_key | One license's full key, when you ask for it |
list_customers | Your customers, searchable |
issue_license | A new license from a policy, for a customer's email |
revoke_license, suspend_license, reinstate_license | Change a license's status. Revoking and suspending are marked destructive, so assistants ask you first |
create_api_key | An slk_ key for your app, shown once |
list_access_rules, add_access_rule, delete_access_rule | Blacklists and exclusions, with hit counts |
sdk_snippet | Validation code for an official SDK, for your server |
test_validate | Checks a key the way your app does (needs SUNLICENSE_API_KEY; a new machine id takes a slot) |
integration_status | What's set up, what's missing and today's MCP calls |
search_docs | Searches this documentation |
Limits
| Free | Lite | Standard | |
|---|---|---|---|
| MCP | ✓ | ✓ | |
| Tool calls per day | 300 | 3,000 |
Every tool call counts, and the count resets at 00:00 UTC. When the day's calls are used up, tools answer with a short message instead and the dashboard, CLI and API keep working as usual. Writes still follow your plan's other limits (licenses, API keys, access rules); a limit shows up as a message with a link to upgrade. On Free, sunlicense mcp stops with the upgrade link instead of starting.
Good to know
- Keys stay masked. Answers show keys as
AX8P-XXXX-XXXX-XXXX; onlyreveal_license_keyreturns a full key, and the assistant only needs it when you ask. - Give the token only what it needs. A read-only token (
*.readscopes) can look but not change anything. Revoking the token in Settings stops the assistant within 30 seconds. - It runs on your machine. The server is the CLI calling the SunLicense API with your token: SunLicense receives those API calls, never your prompts or code.
