Implementation:21st dev Magic mcp get usage
| Knowledge Sources | |
|---|---|
| Domains | Authentication, Account |
| Last Updated | 2026-10-19 16:40 GMT |
Overview
Concrete tool for checking the authenticated account's capabilities (AI access, usage), provided by the 21st MCP server (reached through the proxy).
Description
The get_usage tool reports the account's entitlements, most importantly `aiGenerationEnabled`. Builder/component access alone does not enable hosted AI; the server lists `generate` and `iterate_generation` only when AI access is on. `get_usage.aiGenerationEnabled` reports access, not the remaining AI credit balance. Hosted server-side at `https://21st.dev/api/mcp`; this repo only forwards calls to it opaquely over the proxy.
This is an External Tool Doc: the signature below is reconstructed from `skills/21st-ui/SKILL.md` and `README.md`, not from in-repo source.
Usage
Call `get_usage` before any hosted generation to confirm AI access. Missing or unknown status is not permission to generate. Pair with Implementation:21st_dev_Magic_mcp_tools_list — the presence of `generate` in the tool list confirms AI is on.
Code Reference
Source Location
- Repository: magic-mcp (proxy; tool is server-side)
- Docs: skills/21st-ui/SKILL.md:L34, README.md:L34-48, llms-install.md:L48-54
- Transport: forwarded via Implementation:21st_dev_Magic_mcp_forward
Signature
// JSON-RPC tool call, proxied to https://21st.dev/api/mcp
get_usage(): {
aiGenerationEnabled: boolean; // gated: only true enables `generate`
// ...other account usage/entitlement fields
};
Import
// Not imported. Call as an MCP tool through the 21st MCP server:
// { "jsonrpc": "2.0", "id": <n>, "method": "tools/call",
// "params": { "name": "get_usage", "arguments": {} } }
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | — | — | No arguments; gated by authenticated `x-api-key` |
Outputs
| Name | Type | Description |
|---|---|---|
| aiGenerationEnabled | boolean | Whether hosted AI generation is available to this account |
Usage Examples
Verify AI access before generating
{
"jsonrpc": "2.0",
"id": 8,
"method": "tools/call",
"params": { "name": "get_usage", "arguments": {} }
}
Related Pages
Implements Principle
Requires Environment
Notes
- Reports access, not remaining credit balance.
- Companion: Implementation:21st_dev_Magic_mcp_tools_list confirms `generate` is listed.