@atomixstudio/mcp 1.0.15 → 1.0.16
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 +103 -124
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
# @atomixstudio/mcp
|
|
2
2
|
|
|
3
|
-
MCP (Model Context Protocol) server and CLI for Atomix Design System. Query and sync design tokens
|
|
4
|
-
|
|
5
|
-
## Quick Start (CLI)
|
|
6
|
-
|
|
7
|
-
The easiest way to use Atomix is via the CLI:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
# Sync tokens + AI rules (default behavior)
|
|
11
|
-
npx heyatomix sync
|
|
12
|
-
|
|
13
|
-
# Sync tokens only (skip AI rules)
|
|
14
|
-
npx heyatomix sync --no-rules
|
|
15
|
-
|
|
16
|
-
# Create config file
|
|
17
|
-
npx heyatomix init
|
|
18
|
-
```
|
|
3
|
+
MCP (Model Context Protocol) server and CLI for Atomix Design System. Query and sync design tokens from AI coding tools (Cursor, Claude Desktop, Windsurf, etc.) or from the command line.
|
|
19
4
|
|
|
20
5
|
## Getting Your Credentials
|
|
21
6
|
|
|
@@ -24,79 +9,9 @@ npx heyatomix init
|
|
|
24
9
|
3. Click **Publish** to make your DS available via API
|
|
25
10
|
4. Your `ds-id` is in the URL: `atomixstudio.eu/ds/[ds-id]`
|
|
26
11
|
|
|
27
|
-
## CLI Commands
|
|
28
|
-
|
|
29
|
-
### `heyatomix sync`
|
|
30
|
-
|
|
31
|
-
Sync design tokens and AI rules to your project. **Both tokens and AI guidance rules sync by default** since the rules reference tokens.
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npx heyatomix sync # Sync tokens + AI rules
|
|
35
|
-
npx heyatomix sync --no-rules # Sync tokens only
|
|
36
|
-
npx heyatomix sync -o src/tokens.css # Custom output path
|
|
37
|
-
npx heyatomix sync --format scss # Output as SCSS
|
|
38
|
-
npx heyatomix sync -y # Auto-confirm changes
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**⚠️ Important: File Structure**
|
|
42
|
-
|
|
43
|
-
The output file (e.g., `tokens.css`) is **completely rewritten** on each sync:
|
|
44
|
-
|
|
45
|
-
- ✅ **Preserved**: CSS custom properties (variables) - both design system tokens and custom variables
|
|
46
|
-
- ❌ **Lost**: Regular CSS rules (selectors, classes, media queries, etc.)
|
|
47
|
-
|
|
48
|
-
**Best Practice**: Keep your tokens file separate from custom CSS. Use a separate file (e.g., `custom.css` or `styles.css`) for custom styles.
|
|
49
|
-
|
|
50
|
-
### `heyatomix init`
|
|
51
|
-
|
|
52
|
-
Create a `.atomixrc` config file:
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npx heyatomix init
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
This creates:
|
|
59
|
-
|
|
60
|
-
```json
|
|
61
|
-
{
|
|
62
|
-
"dsId": "your-design-system-id",
|
|
63
|
-
"output": "./tokens.css",
|
|
64
|
-
"format": "css"
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### CLI Options
|
|
69
|
-
|
|
70
|
-
| Option | Description |
|
|
71
|
-
|--------|-------------|
|
|
72
|
-
| `--ds-id` | Design system ID (or set in .atomixrc) |
|
|
73
|
-
| `--api-key` | API key for private design systems |
|
|
74
|
-
| `--output, -o` | Output file path [./tokens.css] |
|
|
75
|
-
| `--format` | Output format (see below) |
|
|
76
|
-
| `--no-rules` | Skip syncing AI rules (tokens + rules sync by default) |
|
|
77
|
-
| `--rules-dir` | Directory for rules files [project root] |
|
|
78
|
-
| `-y, --yes` | Auto-confirm changes |
|
|
79
|
-
|
|
80
|
-
### Output Formats
|
|
81
|
-
|
|
82
|
-
**Web:**
|
|
83
|
-
- `css` — CSS custom properties (`:root { --var: value }`)
|
|
84
|
-
- `scss` — CSS vars + SCSS variables (`$var: value`)
|
|
85
|
-
- `less` — CSS vars + Less variables (`@var: value`)
|
|
86
|
-
- `json` — Raw token JSON
|
|
87
|
-
- `ts` — TypeScript with types
|
|
88
|
-
- `js` — JavaScript module
|
|
89
|
-
|
|
90
|
-
**Native:**
|
|
91
|
-
- `swift` — Swift/SwiftUI for iOS
|
|
92
|
-
- `kotlin` — Kotlin/Compose for Android
|
|
93
|
-
- `dart` — Dart for Flutter
|
|
94
|
-
|
|
95
|
-
All formats include **light and dark mode** values.
|
|
96
|
-
|
|
97
12
|
## MCP Server Setup
|
|
98
13
|
|
|
99
|
-
|
|
14
|
+
Connect your AI tool so it can query your design system directly.
|
|
100
15
|
|
|
101
16
|
### Cursor IDE
|
|
102
17
|
|
|
@@ -134,7 +49,7 @@ Create `.windsurf/mcp.json` in your project root (same format as Cursor).
|
|
|
134
49
|
|
|
135
50
|
## MCP Tools
|
|
136
51
|
|
|
137
|
-
Once connected, AI
|
|
52
|
+
Once connected, the AI can call these tools:
|
|
138
53
|
|
|
139
54
|
| Tool | Description |
|
|
140
55
|
|------|-------------|
|
|
@@ -146,55 +61,49 @@ Once connected, AI tools can use these:
|
|
|
146
61
|
| `getAIToolRules(tool)` | Generate AI coding rules for your design system |
|
|
147
62
|
| `exportMCPConfig(tool)` | Get MCP configuration for different tools |
|
|
148
63
|
| `getSetupInstructions(tool)` | Get detailed setup guide |
|
|
149
|
-
| `getDependencies(platform?, stack?)` | Get suggested dependencies (icons, fonts, SKILL.md,
|
|
64
|
+
| `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 **/--getstarted** prompt. |
|
|
150
65
|
|
|
151
66
|
### getDependencies
|
|
152
67
|
|
|
153
|
-
Returns DS-derived suggestions so the
|
|
68
|
+
Returns DS-derived suggestions so the AI can build a "Suggested" vs "Already present" list and, after user approval, install or copy assets.
|
|
154
69
|
|
|
155
|
-
**Parameters (optional):**
|
|
156
|
-
|
|
157
|
-
| Parameter | Description |
|
|
158
|
-
|-----------|-------------|
|
|
159
|
-
| `platform` | `web`, `ios`, or `android` |
|
|
160
|
-
| `stack` | e.g. `react`, `vue`, `next`, `swift`, `kotlin` |
|
|
70
|
+
**Parameters (optional):** `platform` — `web`, `ios`, or `android`; `stack` — e.g. `react`, `vue`, `next`, `swift`, `kotlin`.
|
|
161
71
|
|
|
162
72
|
**Returns (JSON):**
|
|
163
73
|
|
|
164
|
-
- **iconLibrary** — `package`, `nativePackage`, and a
|
|
165
|
-
- **fonts** — Font family names from typography tokens +
|
|
74
|
+
- **iconLibrary** — `package`, `nativePackage`, and a performance hint (use individual SVG imports for tree-shaking).
|
|
75
|
+
- **fonts** — Font family names from typography tokens + performance hint (self-hosted `@font-face`, `font-display: swap`).
|
|
166
76
|
- **skill** — `path` (e.g. `.cursor/skills/atomix-ds/SKILL.md`) and `content` (generic, platform-agnostic SKILL.md).
|
|
167
|
-
- **
|
|
168
|
-
- **tokenFiles** — e.g. `["tokens.css", "tokens.json"]` with short copy instructions.
|
|
77
|
+
- **tokenFiles** — e.g. `["tokens.css", "tokens.json"]` with copy instructions.
|
|
169
78
|
|
|
170
|
-
If the design system
|
|
79
|
+
If the design system is unavailable, the tool may fail; the client should tell the user the design system could not be reached.
|
|
171
80
|
|
|
172
81
|
## MCP Prompts
|
|
173
82
|
|
|
174
|
-
|
|
83
|
+
Run these prompts from your AI tool (e.g. **/--hello**, **/--getstarted**):
|
|
175
84
|
|
|
176
85
|
| Prompt | Description |
|
|
177
86
|
|--------|-------------|
|
|
178
87
|
| **/--hello** | Get started — overview, tokens, and tools. Run this first. |
|
|
179
|
-
| **/--
|
|
88
|
+
| **/--getstarted** | Get started with design system in project. Three phases; creates files only after you approve. |
|
|
180
89
|
| **/--rules** | Governance rules for your AI tool (Cursor, Copilot, Windsurf, etc.). |
|
|
181
90
|
| **/--sync** | Sync tokens to a local file. Use **/--refactor** to migrate deprecated tokens. |
|
|
182
91
|
| **/--refactor** | Migrate deprecated tokens in codebase. Run after **/--sync**. |
|
|
183
92
|
|
|
184
|
-
## --
|
|
93
|
+
## --getstarted (get started)
|
|
185
94
|
|
|
186
|
-
The
|
|
95
|
+
The **/--getstarted** prompt suggests dependencies for your design system so you can get up and running quickly. It does **not** install anything by default; the AI presents a list and asks before making changes.
|
|
187
96
|
|
|
188
97
|
**Flow (phased instructions):**
|
|
189
98
|
|
|
190
99
|
1. **Resolve platform and stack** — Infer from the project (e.g. `package.json`, `build.gradle`) or **ask the user** if the project gives no hint (e.g. blank repo). Do not assume web or any default.
|
|
191
|
-
2. **Get suggested dependencies** — Call `getDependencies(platform, stack)`. If the call fails
|
|
100
|
+
2. **Get suggested dependencies** — Call `getDependencies(platform, stack)`. If the call fails, tell the user the design system could not be reached and stop.
|
|
192
101
|
3. **Scan codebase and build suggestion list** — Scan for `package.json` (or equivalent), existing skill path, token files, font/icon usage. Build **Suggested dependencies** (from getDependencies minus what's present) and **Already present**. Do not install or copy anything in this phase.
|
|
193
102
|
4. **Present list and ask before install** — Reply with "Suggested dependencies: …" and "Already present: …" and state: "Do not install or copy anything until you confirm. Would you like me to install or add these?" Only perform steps the user approves.
|
|
194
103
|
5. **Optional: suggest global styles** — If the project has no global styles that use the design system tokens, ask verbatim: "Your project doesn't appear to have global styles that use the design system tokens (e.g. semantic typography scale or semantic color classes). Would you like me to suggest or generate a minimal set (e.g. typography scale + semantic utilities) so you can develop consistently with the DS?"
|
|
195
|
-
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.
|
|
104
|
+
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.").
|
|
196
105
|
|
|
197
|
-
**Single SKILL.md:** The
|
|
106
|
+
**Single SKILL.md:** The getstarted flow suggests adding a generic, coding-platform agnostic SKILL at `.cursor/skills/atomix-ds/SKILL.md`. It instructs the AI to call `getAIToolRules({ tool: "<tool>" })` where `<tool>` matches the current environment (cursor, windsurf, copilot, cline, continue, zed, generic).
|
|
198
107
|
|
|
199
108
|
## Token Categories
|
|
200
109
|
|
|
@@ -208,9 +117,91 @@ The **--setup** prompt suggests dependencies for your design system so you can g
|
|
|
208
117
|
- **motion** — Duration and easing tokens
|
|
209
118
|
- **zIndex** — Layer tokens
|
|
210
119
|
|
|
211
|
-
##
|
|
120
|
+
## Example Usage (MCP)
|
|
121
|
+
|
|
122
|
+
Once MCP is connected, you can say:
|
|
123
|
+
|
|
124
|
+
> "Sync my design tokens to tokens.css"
|
|
125
|
+
|
|
126
|
+
> "What color tokens are available?"
|
|
127
|
+
|
|
128
|
+
> "Use the correct spacing token for 16px padding"
|
|
129
|
+
|
|
130
|
+
> "Validate this: style={{ backgroundColor: '#007061' }}"
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## CLI
|
|
135
|
+
|
|
136
|
+
Use the CLI when you prefer commands over the AI, or in scripts/CI.
|
|
137
|
+
|
|
138
|
+
### Quick Start (CLI)
|
|
212
139
|
|
|
213
|
-
|
|
140
|
+
```bash
|
|
141
|
+
# Sync tokens + AI rules (default behavior)
|
|
142
|
+
npx heyatomix sync
|
|
143
|
+
|
|
144
|
+
# Sync tokens only (skip AI rules)
|
|
145
|
+
npx heyatomix sync --no-rules
|
|
146
|
+
|
|
147
|
+
# Create config file
|
|
148
|
+
npx heyatomix init
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### `heyatomix sync`
|
|
152
|
+
|
|
153
|
+
Sync design tokens and AI rules to your project. **Both tokens and AI guidance rules sync by default** since the rules reference tokens.
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npx heyatomix sync # Sync tokens + AI rules
|
|
157
|
+
npx heyatomix sync --no-rules # Sync tokens only
|
|
158
|
+
npx heyatomix sync -o src/tokens.css # Custom output path
|
|
159
|
+
npx heyatomix sync --format scss # Output as SCSS
|
|
160
|
+
npx heyatomix sync -y # Auto-confirm changes
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**File structure:** The output file (e.g., `tokens.css`) is **completely rewritten** on each sync. Preserved: CSS custom properties (variables). Lost: regular CSS rules (selectors, classes, media queries). Keep your tokens file separate from custom CSS (e.g. use `custom.css` for custom styles).
|
|
164
|
+
|
|
165
|
+
### `heyatomix init`
|
|
166
|
+
|
|
167
|
+
Create a `.atomixrc` config file:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
npx heyatomix init
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Creates:
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"dsId": "your-design-system-id",
|
|
178
|
+
"output": "./tokens.css",
|
|
179
|
+
"format": "css"
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### CLI Options
|
|
184
|
+
|
|
185
|
+
| Option | Description |
|
|
186
|
+
|--------|-------------|
|
|
187
|
+
| `--ds-id` | Design system ID (or set in .atomixrc) |
|
|
188
|
+
| `--api-key` | API key for private design systems |
|
|
189
|
+
| `--output, -o` | Output file path [./tokens.css] |
|
|
190
|
+
| `--format` | Output format (see below) |
|
|
191
|
+
| `--no-rules` | Skip syncing AI rules (tokens + rules sync by default) |
|
|
192
|
+
| `--rules-dir` | Directory for rules files [project root] |
|
|
193
|
+
| `-y, --yes` | Auto-confirm changes |
|
|
194
|
+
|
|
195
|
+
### Output Formats
|
|
196
|
+
|
|
197
|
+
**Web:** `css`, `scss`, `less`, `json`, `ts`, `js`
|
|
198
|
+
**Native:** `swift`, `kotlin`, `dart`
|
|
199
|
+
|
|
200
|
+
All formats include **light and dark mode** values.
|
|
201
|
+
|
|
202
|
+
### AI Rules Files (CLI)
|
|
203
|
+
|
|
204
|
+
By default, `sync` also updates AI rules files:
|
|
214
205
|
|
|
215
206
|
| File | AI Tool |
|
|
216
207
|
|------|---------|
|
|
@@ -221,25 +212,13 @@ By default, `sync` also updates AI rules files based on which AI tools you use:
|
|
|
221
212
|
| `.github/copilot-instructions.md` | Copilot |
|
|
222
213
|
| `AI_GUIDELINES.md` | Generic |
|
|
223
214
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
## Example Usage
|
|
227
|
-
|
|
228
|
-
**CLI:**
|
|
215
|
+
### Example Usage (CLI)
|
|
229
216
|
|
|
230
217
|
```bash
|
|
231
218
|
npx heyatomix sync
|
|
232
219
|
```
|
|
233
220
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
> "Sync my design tokens to tokens.css"
|
|
237
|
-
|
|
238
|
-
> "What color tokens are available?"
|
|
239
|
-
|
|
240
|
-
> "Use the correct spacing token for 16px padding"
|
|
241
|
-
|
|
242
|
-
> "Validate this: style={{ backgroundColor: '#007061' }}"
|
|
221
|
+
---
|
|
243
222
|
|
|
244
223
|
## Package Aliases
|
|
245
224
|
|
package/package.json
CHANGED