sonance-brand-mcp 1.0.1 → 1.1.0

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.
@@ -68,3 +68,16 @@ export const CardContent = forwardRef<
68
68
 
69
69
  CardContent.displayName = "CardContent";
70
70
 
71
+ export const CardFooter = forwardRef<
72
+ HTMLDivElement,
73
+ React.HTMLAttributes<HTMLDivElement>
74
+ >(({ className, ...props }, ref) => (
75
+ <div
76
+ ref={ref}
77
+ className={cn("flex items-center p-6 pt-0", className)}
78
+ {...props}
79
+ />
80
+ ));
81
+
82
+ CardFooter.displayName = "CardFooter";
83
+
package/dist/index.js CHANGED
@@ -4,8 +4,112 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
4
4
  import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
5
5
  import * as fs from "fs";
6
6
  import * as path from "path";
7
+ import * as os from "os";
7
8
  import { fileURLToPath } from "url";
8
9
  // ============================================
10
+ // INSTALLER (--init flag)
11
+ // ============================================
12
+ /**
13
+ * Get the Claude Desktop config path based on OS
14
+ */
15
+ function getClaudeConfigPath() {
16
+ const platform = os.platform();
17
+ if (platform === "darwin") {
18
+ // macOS
19
+ return path.join(os.homedir(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
20
+ }
21
+ else if (platform === "win32") {
22
+ // Windows
23
+ return path.join(os.homedir(), "AppData", "Roaming", "Claude", "claude_desktop_config.json");
24
+ }
25
+ else {
26
+ // Linux
27
+ return path.join(os.homedir(), ".config", "Claude", "claude_desktop_config.json");
28
+ }
29
+ }
30
+ /**
31
+ * Run the installer to add sonance-brand to Claude Desktop config
32
+ */
33
+ function runInstaller() {
34
+ console.log("");
35
+ console.log(" ┌─────────────────────────────────────────────────┐");
36
+ console.log(" │ │");
37
+ console.log(" │ 🎨 Sonance Brand MCP - Installer │");
38
+ console.log(" │ │");
39
+ console.log(" └─────────────────────────────────────────────────┘");
40
+ console.log("");
41
+ const configPath = getClaudeConfigPath();
42
+ const configDir = path.dirname(configPath);
43
+ console.log(` 📍 Claude config: ${configPath}`);
44
+ console.log("");
45
+ // Create config directory if it doesn't exist
46
+ if (!fs.existsSync(configDir)) {
47
+ console.log(" 📁 Creating Claude config directory...");
48
+ fs.mkdirSync(configDir, { recursive: true });
49
+ }
50
+ // Read existing config or create new one
51
+ let config = {};
52
+ if (fs.existsSync(configPath)) {
53
+ try {
54
+ const content = fs.readFileSync(configPath, "utf-8");
55
+ config = JSON.parse(content);
56
+ console.log(" 📄 Found existing Claude config");
57
+ }
58
+ catch {
59
+ console.log(" ⚠️ Could not parse existing config, creating new one");
60
+ }
61
+ }
62
+ else {
63
+ console.log(" 📄 Creating new Claude config");
64
+ }
65
+ // Initialize mcpServers if not present
66
+ if (!config.mcpServers) {
67
+ config.mcpServers = {};
68
+ }
69
+ // Check if already installed
70
+ if (config.mcpServers["sonance-brand"]) {
71
+ console.log(" ✅ sonance-brand is already configured!");
72
+ console.log("");
73
+ console.log(" To use it:");
74
+ console.log(" 1. Restart Claude Desktop (Cmd+Q / Alt+F4, then reopen)");
75
+ console.log(" 2. Look for the 🔨 hammer icon in the chat input");
76
+ console.log("");
77
+ return;
78
+ }
79
+ // Add Sonance server config (using npx for auto-updates)
80
+ config.mcpServers["sonance-brand"] = {
81
+ command: "npx",
82
+ args: ["-y", "sonance-brand-mcp"],
83
+ };
84
+ // Write updated config
85
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
86
+ console.log("");
87
+ console.log(" ✅ Sonance Brand MCP installed successfully!");
88
+ console.log("");
89
+ console.log(" ┌─────────────────────────────────────────────────┐");
90
+ console.log(" │ Next steps: │");
91
+ console.log(" │ │");
92
+ console.log(" │ 1. Quit Claude Desktop completely │");
93
+ console.log(" │ • Mac: Press Cmd+Q │");
94
+ console.log(" │ • Windows: Press Alt+F4 │");
95
+ console.log(" │ │");
96
+ console.log(" │ 2. Reopen Claude Desktop │");
97
+ console.log(" │ │");
98
+ console.log(" │ 3. Click the 🔨 hammer icon to verify │");
99
+ console.log(" │ You should see 'sonance-brand' listed │");
100
+ console.log(" │ │");
101
+ console.log(" └─────────────────────────────────────────────────┘");
102
+ console.log("");
103
+ console.log(" Try asking Claude:");
104
+ console.log(" \"What are the official Sonance brand colors?\"");
105
+ console.log("");
106
+ }
107
+ // Check for --init flag BEFORE starting MCP server
108
+ if (process.argv.includes("--init") || process.argv.includes("init")) {
109
+ runInstaller();
110
+ process.exit(0);
111
+ }
112
+ // ============================================
9
113
  // PATH RESOLUTION
10
114
  // ============================================
11
115
  const __filename = fileURLToPath(import.meta.url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonance-brand-mcp",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "MCP Server for Sonance Brand Guidelines and Component Library - gives Claude instant access to brand colors, typography, and UI components.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",