@atomixstudio/mcp 1.0.30 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -23
- package/dist/{chunk-BXWOCXYT.js → chunk-CE6J5MJX.js} +5 -1
- package/dist/chunk-CE6J5MJX.js.map +1 -0
- package/dist/figma-bridge-protocol.d.ts +1 -1
- package/dist/figma-bridge-protocol.js +1 -1
- package/dist/index.js +411 -108
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-BXWOCXYT.js.map +0 -1
package/README.md
CHANGED
|
@@ -6,10 +6,10 @@ MCP (Model Context Protocol) server and CLI for Atomix Design System. Query and
|
|
|
6
6
|
|
|
7
7
|
## Getting Your Credentials
|
|
8
8
|
|
|
9
|
-
1. Go to [Atomix Studio](https://
|
|
9
|
+
1. Go to [Atomix Studio](https://atomix.studio)
|
|
10
10
|
2. Sign in and create/access your design system
|
|
11
11
|
3. Click **Publish** to make your DS available via API
|
|
12
|
-
4. Your **ds-id** is in the URL: `
|
|
12
|
+
4. Your **ds-id** is in the URL: `atomix.studio/ds/[ds-id]`
|
|
13
13
|
5. Your **access token**: Export modal or Settings → Regenerate Atomix access token (required for MCP)
|
|
14
14
|
|
|
15
15
|
## MCP Server Setup
|
|
@@ -62,15 +62,13 @@ Once connected, the AI can call these tools:
|
|
|
62
62
|
| `listTokens(category)` | List all tokens in a category |
|
|
63
63
|
| `searchTokens(query)` | Search tokens by name or value |
|
|
64
64
|
| `validateUsage(value)` | Check if a hardcoded value should use a token |
|
|
65
|
-
| `syncAll(options?)` | Sync tokens, AI rules, skills (.cursor/skills/atomix-ds/*), and atomix-dependencies.json. One tool for full project sync. **/--sync** invokes this. Optional: `output` (default ./tokens.css), `format` (default css), `skipTokens` (if true, only skills + manifest). |
|
|
65
|
+
| `syncAll(options?)` | Sync tokens, AI rules, skills (.cursor/skills/atomix-ds/*), and atomix-dependencies.json. One tool for full project sync. **/--sync** invokes this. Optional: `workspaceRoot` (project root so files are written in the repo; else `ATOMIX_PROJECT_ROOT` env or cwd), `output` (default ./tokens.css), `format` (default css), `skipTokens` (if true, only skills + manifest). |
|
|
66
66
|
| `getAIToolRules(tool)` | Generate AI coding rules for your design system |
|
|
67
67
|
| `exportMCPConfig(tool)` | Get MCP configuration for different tools |
|
|
68
68
|
| `getSetupInstructions(tool)` | Get detailed setup guide |
|
|
69
69
|
| `getDependencies(platform?, stack?)` | Get suggested dependencies (icons, fonts, SKILL.md, token files). Optional: `platform` (web, ios, android), `stack` (e.g. react, vue, next). Use with **/--get-started** prompt. |
|
|
70
70
|
| `syncToFigma()` | Push design system to Figma (variables, paint styles, text styles, effect styles). Uses built-in bridge + Atomix plugin. If the plugin is not connected, the response includes `agentInstruction` to connect. **Available on all tiers (Free and Pro).** |
|
|
71
71
|
|
|
72
|
-
Other Figma tools (getFigmaVariablesAndStyles, createDesignPlaceholder, resolveFigmaIdsForTokens, designCreateFrame, designCreateText, etc.) are **Pro only** — they appear when the design system owner has a Pro subscription.
|
|
73
|
-
|
|
74
72
|
### getDependencies
|
|
75
73
|
|
|
76
74
|
Returns DS-derived suggestions so the AI can build a "Suggested" vs "Already present" list and, after user approval, install or copy assets.
|
|
@@ -82,7 +80,6 @@ Returns DS-derived suggestions so the AI can build a "Suggested" vs "Already pre
|
|
|
82
80
|
- **iconLibrary** — `package`, `nativePackage`, and a performance hint (use individual imports; apply the DS icon sizing/weight token when rendering icons).
|
|
83
81
|
- **fonts** — Font family names from typography tokens + hint to link fonts via URL (e.g. Google Fonts); no need to download or add font files to the repo.
|
|
84
82
|
- **skill** — `path` (e.g. `.cursor/skills/atomix-ds/SKILL.md`) and `content` (generic, platform-agnostic SKILL.md).
|
|
85
|
-
- **skillFigmaDesign** — `path` (`.cursor/skills/atomix-ds/FIGMA-SKILL.md`) and `content` (design-in-Figma skill: principal product designer, correct token use, prefer existing Figma variables).
|
|
86
83
|
- **tokenFiles** — e.g. `["tokens.css", "tokens.json"]` with copy instructions.
|
|
87
84
|
- **meta** — `dsName`, `platform`, `stack`, `designSystemVersion`, `designSystemExportedAt`. Use `designSystemVersion` to compare with skill frontmatter `atomixDsVersion` and suggest **syncAll** when the design system is newer.
|
|
88
85
|
|
|
@@ -90,7 +87,7 @@ If the design system is unavailable, the tool may fail; the client should tell t
|
|
|
90
87
|
|
|
91
88
|
### syncAll
|
|
92
89
|
|
|
93
|
-
**syncAll** is the single sync tool: tokens file, AI rules, skills (`.cursor/skills/atomix-ds/SKILL.md
|
|
90
|
+
**syncAll** is the single sync tool: tokens file, AI rules, skills (`.cursor/skills/atomix-ds/SKILL.md`), and **atomix-dependencies.json**. The manifest records icon library, font families, and paths. The **/--sync** prompt invokes it. All paths are resolved under a project root so files are written **inside the repo** (committable). Project root is: `workspaceRoot` argument → `ATOMIX_PROJECT_ROOT` env → `process.cwd()`. Optional: `workspaceRoot` (absolute path to repo root), `output` (default `./tokens.css`), `format` (default `css`), `skipTokens` (if true, only writes skills and manifest).
|
|
94
91
|
|
|
95
92
|
**Skill versioning:** Synced skills get frontmatter `atomixDsVersion` and `atomixDsExportedAt` (from the design system at sync time). The manifest’s `skills.syncedAtVersion` matches. The AI can compare the skill’s `atomixDsVersion` to **getDependencies**’ `meta.designSystemVersion`; if the design system is newer, it can suggest running **syncAll** to update.
|
|
96
93
|
|
|
@@ -106,7 +103,6 @@ Run these prompts from your AI tool (e.g. **/--hello**, **/--get-started**):
|
|
|
106
103
|
| **/--sync** | Sync tokens, AI rules, skills files, and dependencies manifest (icons, fonts). Use **/--refactor** to migrate deprecated tokens. |
|
|
107
104
|
| **/--refactor** | Migrate deprecated tokens in codebase. Run after **/--sync**. |
|
|
108
105
|
| **/--sync-to-figma** | Push design system to Figma. Requires bridge + Atomix plugin; see [Sync to Figma](#sync-to-figma) below. **Available on all tiers (Free and Pro).** |
|
|
109
|
-
| **/--design-in-figma** | Design UI in Figma: **3 passes** (wireframe → tokens/rules → audit), **getDesignScreenshot** after each pass, then **finalizeDesignFrame** (rename + ✅, remove placeholder) and summarise. No code generation. **Pro only.** |
|
|
110
106
|
|
|
111
107
|
## --get-started (get started)
|
|
112
108
|
|
|
@@ -121,13 +117,13 @@ The **/--get-started** prompt suggests dependencies for your design system so yo
|
|
|
121
117
|
5. **Optional: suggest global typeset** — If the project has no global styles that use the design system tokens, offer to build a full typeset (Display, Heading, body, caption) from the DS typography tokens via getToken/listTokens, including fontFamily, fontSize, fontWeight, lineHeight, letterSpacing—not just font imports.
|
|
122
118
|
6. **Report what was created** — After any install/copy steps, list what was created or updated (e.g. "Installed: lucide-react. Added: .cursor/skills/atomix-ds/SKILL.md. Synced: tokens.css.").
|
|
123
119
|
|
|
124
|
-
**SKILLs:** The get-started flow suggests adding
|
|
120
|
+
**SKILLs:** The get-started flow suggests adding a generic SKILL at `.cursor/skills/atomix-ds/SKILL.md` (coding-platform agnostic; calls `getAIToolRules` for the current environment).
|
|
125
121
|
|
|
126
122
|
## Sync to Figma
|
|
127
123
|
|
|
128
124
|
**/--sync-to-figma** (or the **syncToFigma** tool) pushes your design system into the open Figma file: color variables, paint styles, number variables (spacing, radius, borders, sizing, breakpoints), text styles, and shadow effect styles. The **Figma bridge runs inside this MCP server** (no separate process). You only need the Atomix Figma plugin and "Connect to Cursor" (no Figma REST API or token).
|
|
129
125
|
|
|
130
|
-
**Tier:** Sync to Figma is available on **all tiers** (Free and Pro).
|
|
126
|
+
**Tier:** Sync to Figma is available on **all tiers** (Free and Pro).
|
|
131
127
|
|
|
132
128
|
**Flow:**
|
|
133
129
|
|
|
@@ -141,17 +137,6 @@ The **/--get-started** prompt suggests dependencies for your design system so yo
|
|
|
141
137
|
3. **Connect** — In the plugin UI, tap **Connect to Cursor** and wait until the status shows "Connected".
|
|
142
138
|
4. Run **Sync to Figma** again.
|
|
143
139
|
|
|
144
|
-
## Design in Figma
|
|
145
|
-
|
|
146
|
-
**/--design-in-figma** designs in the open Figma file using **granular MCP commands** (no script execution) and a **three-pass flow**:
|
|
147
|
-
|
|
148
|
-
1. **Setup:** **syncToFigma** → **createDesignPlaceholder** (save `frameId`) → **getAIToolRules** + **listTokens** → **resolveFigmaIdsForTokens**.
|
|
149
|
-
2. **Pass 1 — Layout and contents (wireframe):** Build structure with designCreateFrame, designCreateText, designCreateRectangle, designSetAutoLayout, designSetLayoutConstraints, designAppendChild. You must use auto-layout/fill/hug. Then **getDesignScreenshot** and check the image;
|
|
150
|
-
3. **Pass 2 — Apply design tokens and AI rules:** Set all fills and text styles from the resolved map; follow getAIToolRules for all design foundations. Prioritise colors, typography, and buttons. No hardcoded values only use Figma variables. Then **getDesignScreenshot** and verify.
|
|
151
|
-
4. **Pass 3 — Confirm no hardcoded values:** Audit that every value uses an id from resolved. **getDesignScreenshot** again, then **finalizeDesignFrame** with `frameId`, `name` (e.g. "Login card ✅"), and `fillVariableId`/`fillPaintStyleId` for surface (removes placeholder gray). Summarise what was built.
|
|
152
|
-
|
|
153
|
-
**If the bridge is not reachable:** ensure the Atomix plugin is running in Figma and **Connect to Cursor** is clicked; leave the plugin open. The MCP server (and bridge) must be running in Cursor.
|
|
154
|
-
|
|
155
140
|
## Token Categories
|
|
156
141
|
|
|
157
142
|
- **colors** — Brand, background, text, icon, border, action, feedback (light + dark)
|
|
@@ -233,7 +218,7 @@ Creates:
|
|
|
233
218
|
|--------|-------------|
|
|
234
219
|
| `--ds-id` | Design system ID (or set in .atomixrc) |
|
|
235
220
|
| `--atomix-token` | Access token (required for MCP; from Export modal or Settings → Regenerate) |
|
|
236
|
-
| `--api-base` | API base URL (default: https://
|
|
221
|
+
| `--api-base` | API base URL (default: https://atomix.studio). Use only for self-hosted instances. |
|
|
237
222
|
| `--api-key` | API key for private design systems |
|
|
238
223
|
| `--output, -o` | Output file path [./tokens.css] |
|
|
239
224
|
| `--format` | Output format (see below) |
|
|
@@ -285,7 +270,7 @@ npx heyatomix sync
|
|
|
285
270
|
|
|
286
271
|
## Links
|
|
287
272
|
|
|
288
|
-
- [Atomix Studio](https://
|
|
273
|
+
- [Atomix Studio](https://atomix.studio)
|
|
289
274
|
- [MCP Protocol](https://modelcontextprotocol.io)
|
|
290
275
|
|
|
291
276
|
## License
|
|
@@ -19,6 +19,10 @@ var BRIDGE_METHODS = [
|
|
|
19
19
|
"design_set_auto_layout",
|
|
20
20
|
"design_set_layout_constraints",
|
|
21
21
|
"design_append_child",
|
|
22
|
+
"design_resize_node",
|
|
23
|
+
"design_set_effects",
|
|
24
|
+
"design_set_strokes",
|
|
25
|
+
"design_set_layout_sizing",
|
|
22
26
|
"get_design_screenshot",
|
|
23
27
|
"finalize_design_frame"
|
|
24
28
|
];
|
|
@@ -42,4 +46,4 @@ export {
|
|
|
42
46
|
normalizeBridgeMethod,
|
|
43
47
|
isAllowedMethod
|
|
44
48
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-CE6J5MJX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/figma-bridge-protocol.ts"],"sourcesContent":["/**\n * Bridge wire protocol (merged from figma-bridge).\n * All messages are JSON. Only whitelisted methods are allowed.\n * Used by the in-process Figma bridge (WebSocket server in mcp-user).\n */\n\nexport const BRIDGE_METHODS = [\n \"get_document_info\",\n \"get_selection\",\n \"get_node_info\",\n \"get_figma_variables_and_styles\",\n \"create_color_variables\",\n \"create_paint_styles\",\n \"create_text_styles\",\n \"create_number_variables\",\n \"create_effect_styles\",\n \"apply_fill_to_selection\",\n \"create_design_placeholder\",\n \"design_create_frame\",\n \"design_create_text\",\n \"design_create_rectangle\",\n \"design_set_auto_layout\",\n \"design_set_layout_constraints\",\n \"design_append_child\",\n \"design_resize_node\",\n \"design_set_effects\",\n \"design_set_strokes\",\n \"design_set_layout_sizing\",\n \"get_design_screenshot\",\n \"finalize_design_frame\",\n] as const;\n\nexport type BridgeMethod = (typeof BRIDGE_METHODS)[number];\n\nexport interface BridgeRequest {\n id: string;\n method: string;\n params?: Record<string, unknown>;\n}\n\nexport interface BridgeSuccessResponse {\n id: string;\n result: unknown;\n}\n\nexport interface BridgeErrorResponse {\n id: string;\n error: string;\n}\n\nexport type BridgeResponse = BridgeSuccessResponse | BridgeErrorResponse;\n\nexport function isBridgeRequest(msg: unknown): msg is BridgeRequest {\n if (!msg || typeof msg !== \"object\") return false;\n const m = msg as Record<string, unknown>;\n return (\n typeof m.id === \"string\" &&\n m.id.length > 0 &&\n typeof m.method === \"string\" &&\n m.method.length > 0\n );\n}\n\n/** Convert camelCase to snake_case for bridge (e.g. getFigmaVariablesAndStyles -> get_figma_variables_and_styles). */\nexport function normalizeBridgeMethod(method: string): string {\n if (typeof method !== \"string\" || !method) return method;\n return method.replace(/[A-Z]/g, (c) => `_${c.toLowerCase()}`);\n}\n\nexport function isAllowedMethod(method: string): method is BridgeMethod {\n const normalized = normalizeBridgeMethod(method);\n return (BRIDGE_METHODS as readonly string[]).includes(normalized);\n}\n"],"mappings":";;;AAMO,IAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAsBO,SAAS,gBAAgB,KAAoC;AAClE,MAAI,CAAC,OAAO,OAAO,QAAQ,SAAU,QAAO;AAC5C,QAAM,IAAI;AACV,SACE,OAAO,EAAE,OAAO,YAChB,EAAE,GAAG,SAAS,KACd,OAAO,EAAE,WAAW,YACpB,EAAE,OAAO,SAAS;AAEtB;AAGO,SAAS,sBAAsB,QAAwB;AAC5D,MAAI,OAAO,WAAW,YAAY,CAAC,OAAQ,QAAO;AAClD,SAAO,OAAO,QAAQ,UAAU,CAAC,MAAM,IAAI,EAAE,YAAY,CAAC,EAAE;AAC9D;AAEO,SAAS,gBAAgB,QAAwC;AACtE,QAAM,aAAa,sBAAsB,MAAM;AAC/C,SAAQ,eAAqC,SAAS,UAAU;AAClE;","names":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* All messages are JSON. Only whitelisted methods are allowed.
|
|
4
4
|
* Used by the in-process Figma bridge (WebSocket server in mcp-user).
|
|
5
5
|
*/
|
|
6
|
-
declare const BRIDGE_METHODS: readonly ["get_document_info", "get_selection", "get_node_info", "get_figma_variables_and_styles", "create_color_variables", "create_paint_styles", "create_text_styles", "create_number_variables", "create_effect_styles", "apply_fill_to_selection", "create_design_placeholder", "design_create_frame", "design_create_text", "design_create_rectangle", "design_set_auto_layout", "design_set_layout_constraints", "design_append_child", "get_design_screenshot", "finalize_design_frame"];
|
|
6
|
+
declare const BRIDGE_METHODS: readonly ["get_document_info", "get_selection", "get_node_info", "get_figma_variables_and_styles", "create_color_variables", "create_paint_styles", "create_text_styles", "create_number_variables", "create_effect_styles", "apply_fill_to_selection", "create_design_placeholder", "design_create_frame", "design_create_text", "design_create_rectangle", "design_set_auto_layout", "design_set_layout_constraints", "design_append_child", "design_resize_node", "design_set_effects", "design_set_strokes", "design_set_layout_sizing", "get_design_screenshot", "finalize_design_frame"];
|
|
7
7
|
type BridgeMethod = (typeof BRIDGE_METHODS)[number];
|
|
8
8
|
interface BridgeRequest {
|
|
9
9
|
id: string;
|