Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Environment:21st dev Magic mcp AI Entitlement

From Leeroopedia
Knowledge Sources
Domains Account, AI_Generation
Last Updated 2026-10-19 16:40 GMT

Overview

Account-level entitlement (`aiGenerationEnabled === true`) gating the 21st MCP `generate` tool; separate from builder/component access.

Description

This environment is not a runtime or a host — it is an account-capability gate on the 21st MCP server. Builder/component access (free tier: catalog search + 2 installs/day) does not enable hosted AI. The server lists `generate` and `iterate_generation` in `tools/list` only when the account has AI access. The flag is reported by `get_usage.aiGenerationEnabled`, which reflects access — not the remaining AI credit balance.

A cached or legacy generation call can return `ai_subscription_required`; this is terminal for the session. Recovery is to enable AI on the account (at 21st.dev), then refresh the tool list or reconnect — do not retry through legacy builder/refiner aliases or the CLI.

Usage

Use this environment (i.e. require it) for any tool that performs hosted AI generation — currently only `generate`. Reads of existing drafts (`get_generation`, `get_take`) remain available with AI off, so they do not require this environment. Verify the gate with Implementation:21st_dev_Magic_mcp_get_usage (`aiGenerationEnabled`) and Implementation:21st_dev_Magic_mcp_tools_list (presence of `generate`) before calling.

System Requirements

Category Requirement Notes
Account A 21st.dev account with AI access enabled Builder access alone is insufficient
Network Outbound HTTPS to 21st.dev Same as Environment:21st_dev_Magic_mcp_21st_MCP_Endpoint
Hardware Any Server-side generation; the client only sends the prompt

Dependencies

Credentials

  • `x-api-key` — same valid 21st key as the base endpoint; the entitlement is a property of the account the key belongs to, not a separate secret.

Quick Install

# Enable AI on your 21st.dev account (web only — no CLI flag for entitlement):
#   1. Sign in at https://21st.dev
#   2. Enable AI generation for your account (plan-dependent).
#   3. Refresh the MCP tool list or reconnect your client:
#        { "jsonrpc": "2.0", "id": 1, "method": "tools/list" }
#      `generate` should now appear.

Code Evidence

The skill file states the gate explicitly — `skills/21st-ui/SKILL.md:34,39`:

1. Check `get_usage.aiGenerationEnabled` and the current `tools/list`. Paid component
   access alone does not enable hosted AI. Missing or unknown status is not
   permission to generate.
...
If a cached call returns `ai_subscription_required`, stop generation attempts.
After enabling AI, refresh the tool list or reconnect before trying again. The
entitlement flag does not report the remaining credit balance.

`README.md:34-45` documents the same contract:

Builder component access does not enable hosted 21st AI. The server lists
`generate` and `iterate_generation` only when AI access is enabled. Check
`get_usage.aiGenerationEnabled` ... With AI off, use `search` and `get_component`,
then adapt the code with your own coding agent. Existing drafts remain readable.

A cached or legacy generation call can return `ai_subscription_required`. Do
not retry until AI is enabled.

The `generate` tool is documented as AI-gated in `implementations/21st_dev_Magic_mcp_generate.md` — listed by `tools/list` only when AI access is on.

Common Errors

Error Message Cause Solution
`ai_subscription_required` (cached or live `generate` call) Account has no AI entitlement, or it lapsed mid-session Stop generation attempts; enable AI on the account, then refresh `tools/list` or reconnect. Do not retry through legacy aliases or the CLI.
`generate` absent from `tools/list` AI access off (by design) Use `search`/`get_component` and adapt with your own agent; reads (`get_generation`/`get_take`) still work.
`get_usage.aiGenerationEnabled` is `false` but generation attempted anyway Caller ignored the gate Always check `get_usage` + `tools/list` first — missing/unknown status is not permission.

Compatibility Notes

  • Builder vs. AI access: Independent. Builder access grants `search`/`get_component` (free tier: 2 installs/day); AI access grants `generate`/`iterate_generation`. Neither implies the other.
  • Credit balance: `aiGenerationEnabled` reports access, not remaining credits. A `true` flag does not guarantee a successful generation if credits are exhausted.
  • Reads vs. writes: `get_generation` and `get_take` remain available with AI off — only creation (`generate`) is gated.
  • Reconnect after enabling: The tool list is cached per session; refresh `tools/list` or reconnect after turning AI on, or `generate` will not appear.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment