sonance-brand-mcp 1.1.1 → 1.1.3

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.
Files changed (2) hide show
  1. package/dist/index.js +72 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -109,6 +109,78 @@ if (process.argv.includes("--init") || process.argv.includes("init")) {
109
109
  runInstaller();
110
110
  process.exit(0);
111
111
  }
112
+ /**
113
+ * Run the installer for Claude Code (creates .mcp.json in current directory)
114
+ */
115
+ function runClaudeCodeInstaller() {
116
+ console.log("");
117
+ console.log(" ┌─────────────────────────────────────────────────┐");
118
+ console.log(" │ │");
119
+ console.log(" │ 🎨 Sonance Brand MCP - Claude Code Setup │");
120
+ console.log(" │ │");
121
+ console.log(" └─────────────────────────────────────────────────┘");
122
+ console.log("");
123
+ const configPath = path.join(process.cwd(), ".mcp.json");
124
+ console.log(` 📍 Config file: ${configPath}`);
125
+ console.log("");
126
+ // Read existing config or create new one
127
+ let config = {};
128
+ if (fs.existsSync(configPath)) {
129
+ try {
130
+ const content = fs.readFileSync(configPath, "utf-8");
131
+ config = JSON.parse(content);
132
+ console.log(" 📄 Found existing .mcp.json");
133
+ }
134
+ catch {
135
+ console.log(" ⚠️ Could not parse existing .mcp.json, creating new one");
136
+ }
137
+ }
138
+ else {
139
+ console.log(" 📄 Creating new .mcp.json");
140
+ }
141
+ // Initialize mcpServers if not present
142
+ if (!config.mcpServers) {
143
+ config.mcpServers = {};
144
+ }
145
+ // Check if already installed
146
+ if (config.mcpServers["sonance-brand"]) {
147
+ console.log(" ✅ sonance-brand is already configured!");
148
+ console.log("");
149
+ console.log(" To use it:");
150
+ console.log(" 1. Start Claude Code in this directory: claude");
151
+ console.log(" 2. The MCP tools will be available automatically");
152
+ console.log("");
153
+ return;
154
+ }
155
+ // Add Sonance server config (using npx for auto-updates)
156
+ config.mcpServers["sonance-brand"] = {
157
+ command: "npx",
158
+ args: ["-y", "sonance-brand-mcp"],
159
+ };
160
+ // Write updated config
161
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
162
+ console.log("");
163
+ console.log(" ✅ Sonance Brand MCP installed successfully!");
164
+ console.log("");
165
+ console.log(" ┌─────────────────────────────────────────────────┐");
166
+ console.log(" │ Next steps: │");
167
+ console.log(" │ │");
168
+ console.log(" │ 1. Start Claude Code in this directory: │");
169
+ console.log(" │ $ claude │");
170
+ console.log(" │ │");
171
+ console.log(" │ 2. The MCP tools will load automatically │");
172
+ console.log(" │ │");
173
+ console.log(" └─────────────────────────────────────────────────┘");
174
+ console.log("");
175
+ console.log(" Try asking Claude:");
176
+ console.log(" \"What are the official Sonance brand colors?\"");
177
+ console.log("");
178
+ }
179
+ // Check for --init-code flag BEFORE starting MCP server
180
+ if (process.argv.includes("--init-code") || process.argv.includes("init-code")) {
181
+ runClaudeCodeInstaller();
182
+ process.exit(0);
183
+ }
112
184
  // ============================================
113
185
  // PATH RESOLUTION
114
186
  // ============================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonance-brand-mcp",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
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",