@atomixstudio/mcp 1.0.10 → 1.0.11

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/dist/index.js CHANGED
@@ -1345,7 +1345,7 @@ var TOKEN_CATEGORIES = ["colors", "typography", "spacing", "sizing", "shadows",
1345
1345
  var server = new Server(
1346
1346
  {
1347
1347
  name: "atomix-mcp-user",
1348
- version: "1.0.10"
1348
+ version: "1.0.11"
1349
1349
  },
1350
1350
  {
1351
1351
  capabilities: {
@@ -1490,7 +1490,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
1490
1490
  },
1491
1491
  {
1492
1492
  name: "getDependencies",
1493
- description: "Get suggested dependencies for this design system (icon package, fonts, SKILL.md, MCP config, token files). Use with atomix/install. Optional platform and stack for tailored suggestions.",
1493
+ description: "Get suggested dependencies for this design system (icon package, fonts, SKILL.md, token files). Use with atomix/setup. Optional platform and stack for tailored suggestions.",
1494
1494
  inputSchema: {
1495
1495
  type: "object",
1496
1496
  properties: {
@@ -2049,18 +2049,6 @@ Last updated: ${lastUpdated}`
2049
2049
  };
2050
2050
  const lib = icons?.library || "lucide";
2051
2051
  const iconPkgs = ICON_PACKAGES[lib] || ICON_PACKAGES.lucide;
2052
- const serverName = data.meta.name.toLowerCase().replace(/[^a-z0-9]/g, "-");
2053
- const npxArgs = ["@atomixstudio/mcp@latest"];
2054
- if (dsId) npxArgs.push("--ds-id", dsId);
2055
- if (apiKey) npxArgs.push("--api-key", apiKey);
2056
- const mcpConfig = {
2057
- path: ".cursor/mcp.json",
2058
- content: JSON.stringify({
2059
- mcpServers: {
2060
- [serverName]: { command: "npx", args: npxArgs }
2061
- }
2062
- }, null, 2)
2063
- };
2064
2052
  const payload = {
2065
2053
  iconLibrary: {
2066
2054
  package: iconPkgs.web,
@@ -2075,10 +2063,9 @@ Last updated: ${lastUpdated}`
2075
2063
  path: ".cursor/skills/atomix-ds/SKILL.md",
2076
2064
  content: GENERIC_SKILL_MD
2077
2065
  },
2078
- mcpConfig,
2079
2066
  tokenFiles: {
2080
2067
  files: ["tokens.css", "tokens.json"],
2081
- copyInstructions: "Copy tokens.css and tokens.json from the design system export (or use syncTokens) into your project."
2068
+ copyInstructions: "Call the syncTokens MCP tool to create the token file; do not only suggest the user run sync later."
2082
2069
  },
2083
2070
  meta: { dsName: data.meta.name, platform: platform ?? void 0, stack: stack ?? void 0 }
2084
2071
  };
@@ -2323,8 +2310,8 @@ server.setRequestHandler(ListPromptsRequestSchema, async () => {
2323
2310
  description: "Migrate deprecated tokens in codebase. Scans for deprecated tokens marked by /sync and suggests replacements. Run after /sync to update code."
2324
2311
  },
2325
2312
  {
2326
- name: "install",
2327
- description: "Suggest dependencies for this design system (icons, fonts, SKILL.md, MCP config, tokens). Asks before installing. Run getDependencies then follow phased instructions.",
2313
+ name: "setup",
2314
+ description: "Suggest dependencies for this design system (icons, fonts, SKILL.md, tokens). Three phases: scan, report and ask, then create only after approval.",
2328
2315
  arguments: [
2329
2316
  { name: "platform", description: "Target platform (web, ios, android). Optional; ask user if unknown.", required: false },
2330
2317
  { name: "stack", description: "Stack or framework (e.g. react, vue, next, swift, kotlin). Optional.", required: false }
@@ -2448,13 +2435,6 @@ Configure the MCP server in your Cursor settings, then restart Cursor.`
2448
2435
  messages: [
2449
2436
  {
2450
2437
  role: "user",
2451
- content: {
2452
- type: "text",
2453
- text: "Show me the design system overview and available tools."
2454
- }
2455
- },
2456
- {
2457
- role: "assistant",
2458
2438
  content: {
2459
2439
  type: "text",
2460
2440
  text: welcome
@@ -2763,54 +2743,48 @@ Use \`/color\`, \`/spacing\`, \`/radius\`, \`/typography\`, \`/shadow\`, \`/bord
2763
2743
  ]
2764
2744
  };
2765
2745
  }
2766
- case "install": {
2767
- const installInstructions = `You are running **atomix/install**. Follow these phases in order; do not skip any phase.
2768
-
2769
- ## Phase 1 \u2013 Resolve platform and stack
2770
-
2771
- - If the project clearly indicates platform (e.g. package.json + web deps, or build.gradle / Android, or Xcode / iOS), infer \`platform\` (e.g. web, ios, android) and optionally \`stack\` (e.g. react, next, vue, swift, kotlin).
2772
- - If the project gives **no hint** (blank repo, empty folder, or ambiguous): **Ask the user:** "Which platform are you building for? (e.g. web, Android, iOS)" and, if relevant, "Which stack or framework? (e.g. React, Vue, Next, Swift, Kotlin)." Do **not** assume web or any default.
2773
- - Proceed only once platform (and optionally stack) is known or confirmed.
2774
-
2775
- ## Phase 2 \u2013 Get suggested dependencies
2776
-
2777
- - Call MCP tool **getDependencies** with the resolved \`platform\` (and optional \`stack\`). Use the parameter names the tool expects (e.g. platform, stack).
2778
- - If the call fails (e.g. MCP not connected or no ds-id), tell the user: "Atomix MCP is not connected or design system ID is missing. Configure MCP with --ds-id and try again."
2779
-
2780
- ## Phase 3 \u2013 Scan codebase and build suggestion list
2781
-
2782
- - Scan the repo for: package.json (or equivalent), existing skill path (e.g. .cursor/skills), presence of tokens.css or project token file, font imports/config, icon package usage.
2783
- - Build two lists: **Suggested dependencies** (from getDependencies, minus what is already present) and **Already present**. Include: icon package, fonts, SKILL path, MCP config, token files.
2784
- - Do **not** install, copy, or write any file in this phase.
2785
-
2786
- ## Phase 4 \u2013 Present list and ask before install
2787
-
2788
- - Reply with: "Suggested dependencies: \u2026" and "Already present: \u2026" and state: "Do not install or copy anything until you confirm. Would you like me to install or add these?"
2789
- - If the user says yes, perform only the steps they approved. If no or only part, perform only that.
2746
+ case "setup": {
2747
+ const setupInstructions = `You are running **atomix/setup**. Three phases only. Do not create, write, or modify any file until Phase 3 and only after the user has approved.
2790
2748
 
2791
- ## Phase 5 \u2013 Optional: suggest global styles (if missing)
2749
+ ## Phase 1 \u2013 Scan
2792
2750
 
2793
- - After presenting the dependency list (Phase 4), or after the user has approved install, check whether the project has **global styles that use the design system tokens** (e.g. typography scale, semantic color classes, or theme file referencing DS tokens). If **not** (e.g. no globals.css using tokens, or blank project), ask the user **verbatim**:
2751
+ - Resolve platform/stack: infer from the project (e.g. package.json, build.gradle, Xcode) or ask the user once: "Which platform? (e.g. web, Android, iOS)" and if relevant "Which stack? (e.g. React, Vue, Next, Swift, Kotlin)." Do not assume a default.
2752
+ - Call MCP tool **getDependencies** with \`platform\` and optional \`stack\`. If it fails, tell the user: "Atomix MCP is not connected or design system ID is missing. Configure MCP with --ds-id and try again."
2753
+ - Scan the repo for what already exists: .cursor/skills/atomix-ds/SKILL.md, a tokens file (e.g. tokens.css or src/tokens.css), icon package from getDependencies, font setup. Do **not** include or check for MCP config; MCP is already configured for this session.
2754
+ - **Web:** Scan for any existing CSS (e.g. globals.css, main.css, App.css, index.css, Tailwind entry, framework styles). Note whether at least one CSS file exists.
2755
+ - **Native (iOS/Android):** Scan for existing theme or style files (e.g. SwiftUI theme/asset catalog, Android themes.xml/styles.xml, Compose theme). Note whether the project already has a theme or style setup.
2756
+ - Build two lists: **Suggested** (from getDependencies minus what exists) and **Already present**. Only include: icon package, fonts, skill (.cursor/skills/atomix-ds/SKILL.md), token files. No MCP.
2757
+ - Do not write, create, or add anything in Phase 1.
2794
2758
 
2795
- "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?"
2759
+ ## Phase 2 \u2013 Report and ask for permission
2796
2760
 
2797
- - If the user says yes, suggest or generate a minimal set; do not overwrite existing global styles without confirmation.
2761
+ - Reply with: **Suggested:** [list] and **Already present:** [list].
2762
+ - Ask exactly once: "Do you want me to add the suggested items? (Yes for all, or say which ones.)" (Integration with existing CSS or theme is recommended after Phase 3; new global CSS/theme is only suggested when none exists.)
2763
+ - **Stop.** Do not run Phase 3 in this response. Wait for the user to reply.
2798
2764
 
2799
- ## Phase 6 \u2013 Report what was created
2765
+ ## Phase 3 \u2013 Create or add (only after user approval)
2800
2766
 
2801
- - After any install or copy steps (and optional global-styles step), list **what was created or updated** (e.g. "Installed: lucide-react. Added: .cursor/skills/atomix-ds/SKILL.md. Updated: .cursor/mcp.json. Copied: tokens.css."). If global styles were added, include that.
2767
+ - Run only when the user has said yes (all or specific items).
2768
+ - For each approved item:
2769
+ - **Skill:** Write the skill content from getDependencies to .cursor/skills/atomix-ds/SKILL.md.
2770
+ - **Token file:** Call the **syncTokens** MCP tool with \`output\` set to the path (e.g. "./src/tokens.css" or "./tokens.css"). You must call syncTokens; do not only suggest the user run sync later.
2771
+ - **Icon package / fonts:** Add per getDependencies (e.g. install package, add font config). Do not overwrite existing.
2772
+ - Report only what you actually created or updated (e.g. "Added: .cursor/skills/atomix-ds/SKILL.md. Synced: src/tokens.css."). Do not claim the token file was added if you did not call syncTokens.
2773
+ - **After reporting \u2013 styles/theme (per platform):**
2774
+ - **Web:** If the project **already has** at least one CSS file: recommend how to integrate Atomix (e.g. import the synced tokens file, use \`var(--atomix-*)\` or semantic classes). Do **not** suggest creating a new global CSS. Only if the project has **no** CSS file at all, ask once: "There are no CSS files yet. Do you want a minimal global CSS (typography + semantic utilities from the design system)?" and add it only if the user says yes.
2775
+ - **iOS/Android:** If the project **already has** theme or style files: recommend how to integrate Atomix tokens (e.g. use synced DesignTokens.swift / Kotlin tokens in existing theme). Do **not** suggest creating a new global theme file. Only if the project has **no** theme/style setup at all, ask once: "There's no theme/style setup yet. Do you want a minimal token-based theme (colors, typography, spacing from the design system)?" and add it only if the user says yes.
2802
2776
 
2803
2777
  ---
2804
2778
 
2805
- Execute Phase 1 now (resolve or ask platform/stack), then Phase 2 (call getDependencies), then continue through Phase 6.`;
2779
+ Execute Phase 1 now (resolve platform/stack, call getDependencies, scan, build lists). Then Phase 2 (report lists and ask). Do not perform Phase 3 until the user replies.`;
2806
2780
  return {
2807
- description: "Suggest dependencies for this design system (atomix/install)",
2781
+ description: "Setup design system in project (atomix/setup). Phase 1 scan, Phase 2 report and ask, Phase 3 create only after user approval.",
2808
2782
  messages: [
2809
2783
  {
2810
2784
  role: "user",
2811
2785
  content: {
2812
2786
  type: "text",
2813
- text: installInstructions
2787
+ text: setupInstructions
2814
2788
  }
2815
2789
  }
2816
2790
  ]
@@ -2874,7 +2848,7 @@ ${tokenSummary}
2874
2848
 
2875
2849
  | Command | What to expect |
2876
2850
  |---------|----------------|
2877
- | **install** | Scans your repo to set up global styles (if none), icons and fonts. Safe: Won't install until you confirm. |
2851
+ | **setup** | Scans your repo to set up global styles (if none), icons and fonts. Safe: Won't add anything until you confirm. |
2878
2852
  | **sync** | Syncs tokens to a local file. Adds new, updates existing, marks deprecated. Safe: No changes until you confirm. |
2879
2853
  | **refactor** | Scans codebase for deprecated tokens (after sync), suggests replacements. Run after sync to migrate code. |
2880
2854
 
@@ -2892,7 +2866,7 @@ ${tokenSummary}
2892
2866
  | **sizing** | Table of height and icon size tokens. |
2893
2867
  | **motion** | Table of duration and easing tokens. |
2894
2868
 
2895
- **Suggested next step:** Run **install** to set up global styles, icons, fonts, and token files; the AI will list options and ask before adding anything.
2869
+ **Suggested next step:** Run **setup** to set up global styles, icons, fonts, and token files; the AI will list options and ask before adding anything.
2896
2870
 
2897
2871
  ---
2898
2872