@axiomatic-labs/claudeflow 2.9.77 → 2.9.79

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/lib/install.js +54 -38
  2. package/package.json +1 -1
package/lib/install.js CHANGED
@@ -268,55 +268,71 @@ function installAnalysisTools() {
268
268
  }
269
269
  }
270
270
 
271
- // 3. Serena MCP
272
- if (hasUv) {
273
- let serenaConfigured = false;
274
- try {
275
- const mcpList = execSync('claude mcp list', { stdio: 'pipe', encoding: 'utf8', timeout: 10000 });
276
- serenaConfigured = mcpList.includes('serena');
277
- } catch {
278
- // claude CLI not available or mcp list failed — skip Serena
279
- ui.warn('Could not check MCP servers — Serena setup skipped');
280
- return;
281
- }
271
+ // 3. Write MCP servers directly to .mcp.json (more reliable than claude mcp add)
272
+ configureMcpServers(hasUv);
273
+ }
274
+
275
+ // Write Serena and context7 MCP configs directly to .mcp.json.
276
+ // This is more reliable than `claude mcp add` which can misparse flags.
277
+ function configureMcpServers(hasUv) {
278
+ const cwd = process.cwd();
279
+ const mcpPath = path.join(cwd, '.mcp.json');
280
+
281
+ // Read existing .mcp.json or start fresh
282
+ let mcpConfig = { mcpServers: {} };
283
+ try {
284
+ const existing = fs.readFileSync(mcpPath, 'utf8');
285
+ mcpConfig = JSON.parse(existing);
286
+ if (!mcpConfig.mcpServers) mcpConfig.mcpServers = {};
287
+ } catch {
288
+ // File doesn't exist or is invalid — start fresh
289
+ }
290
+
291
+ let changed = false;
282
292
 
283
- if (serenaConfigured) {
293
+ // Serena MCP (requires uv)
294
+ if (hasUv) {
295
+ if (mcpConfig.mcpServers.serena) {
284
296
  ui.success('Serena MCP already configured');
285
297
  } else {
286
298
  ui.step('Adding Serena MCP for semantic code analysis...');
287
- try {
288
- const projectPath = process.cwd();
289
- const uvBin = resolveUvBin();
290
- execSync(
291
- `claude mcp add serena -- ${uvBin} -p 3.13 --from git+https://github.com/oraios/serena serena start-mcp-server --context claude-code --project "${projectPath}"`,
292
- { stdio: 'pipe', timeout: 30000 }
293
- );
294
- ui.success('Serena MCP configured');
295
- } catch {
296
- ui.warn('Serena MCP setup failed — code exploration will use Grep fallback');
297
- }
299
+ const uvBin = resolveUvBin();
300
+ mcpConfig.mcpServers.serena = {
301
+ type: 'stdio',
302
+ command: uvBin,
303
+ args: [
304
+ '-p', '3.13',
305
+ '--from', 'git+https://github.com/oraios/serena',
306
+ 'serena', 'start-mcp-server',
307
+ '--context', 'claude-code',
308
+ '--project', cwd,
309
+ ],
310
+ };
311
+ changed = true;
312
+ ui.success('Serena MCP configured');
298
313
  }
299
314
  }
300
315
 
301
- // 4. context7 MCP (library documentation for research)
302
- let context7Configured = false;
303
- try {
304
- const mcpList = execSync('claude mcp list', { stdio: 'pipe', encoding: 'utf8', timeout: 10000 });
305
- context7Configured = mcpList.includes('context7');
306
- } catch {}
307
-
308
- if (context7Configured) {
316
+ // context7 MCP
317
+ if (mcpConfig.mcpServers.context7) {
309
318
  ui.success('context7 MCP already configured');
310
319
  } else {
311
320
  ui.step('Adding context7 MCP for library documentation...');
321
+ mcpConfig.mcpServers.context7 = {
322
+ type: 'stdio',
323
+ command: 'npx',
324
+ args: ['-y', '@upstash/context7-mcp@latest'],
325
+ };
326
+ changed = true;
327
+ ui.success('context7 MCP configured');
328
+ }
329
+
330
+ // Write .mcp.json if anything changed
331
+ if (changed) {
312
332
  try {
313
- execSync('claude mcp add context7 -- npx -y @upstash/context7-mcp@latest', {
314
- stdio: 'pipe',
315
- timeout: 30000,
316
- });
317
- ui.success('context7 MCP configured');
318
- } catch {
319
- ui.warn('context7 setup failed — research will use WebSearch fallback');
333
+ fs.writeFileSync(mcpPath, JSON.stringify(mcpConfig, null, 2) + '\n');
334
+ } catch (e) {
335
+ ui.warn(`Could not write .mcp.json: ${e.message}`);
320
336
  }
321
337
  }
322
338
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiomatic-labs/claudeflow",
3
- "version": "2.9.77",
3
+ "version": "2.9.79",
4
4
  "description": "Claudeflow — AI-powered development toolkit for Claude Code. Skills, agents, hooks, and quality gates that ship production apps.",
5
5
  "bin": {
6
6
  "claudeflow": "./bin/cli.js"