Skip to Content
SDKInstallation

Installation

@majico/sdk

Requires Node.js 18+.

npm install @majico/sdk

Credentials

Create a project API key on Account → Integrations  (Pro or Creator). Set:

VariableDescription
MAJICO_API_KEYProject API key
MAJICO_PROJECT_IDProject UUID (also in your guidelines URL)
MAJICO_API_URLOptional — defaults to https://api.majico.xyz
import { MajicoClient } from "@majico/sdk"; const client = new MajicoClient({ apiKey: process.env.MAJICO_API_KEY!, projectId: process.env.MAJICO_PROJECT_ID!, baseUrl: process.env.MAJICO_API_URL ?? "https://api.majico.xyz", });

Verify

const tokens = await client.tokens.get(); console.log(tokens.headingFont, Object.keys(tokens.tokens.light).length);

user-majico-mcp

No global install required — Cursor runs it via npx:

npx -y user-majico-mcp@0.5.0

Set the same env vars in your MCP config (MAJICO_API_URL, MAJICO_PROJECT_ID, MAJICO_API_KEY). Full setup: MCP server.

Errors

The SDK throws MajicoError with status, code, and isRetryable:

import { MajicoError } from "@majico/sdk"; try { await client.guidelines.get(); } catch (err) { if (err instanceof MajicoError) { console.error(err.status, err.code, err.isRetryable); } }

401 usually means a bad or revoked API key. 403 often means the project tier does not include API access.


Next: API reference · MCP server