ropilot 0.1.36 → 0.1.37

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/setup.js +28 -22
  2. package/package.json +1 -1
package/lib/setup.js CHANGED
@@ -245,20 +245,6 @@ function getDefaultPrompts() {
245
245
  };
246
246
  }
247
247
 
248
- /**
249
- * Generate .mcp.json for Claude Code MCP server configuration
250
- */
251
- function generateMcpJson() {
252
- return JSON.stringify({
253
- mcpServers: {
254
- ropilot: {
255
- command: "npx",
256
- args: ["ropilot", "serve"]
257
- }
258
- }
259
- }, null, 2);
260
- }
261
-
262
248
  /**
263
249
  * Set up agent files in current project
264
250
  */
@@ -302,20 +288,40 @@ function setupProjectPrompts(pkg) {
302
288
  }
303
289
  }
304
290
 
305
- // Generate .mcp.json with platform-specific command
306
- const mcpJson = generateMcpJson();
291
+ // Update .mcp.json - preserve existing servers, only add/update ropilot
307
292
  const mcpPath = '.mcp.json';
293
+ const ropilotServer = {
294
+ command: "npx",
295
+ args: ["ropilot", "serve"]
296
+ };
297
+
298
+ let mcpConfig = { mcpServers: {} };
308
299
  if (existsSync(mcpPath)) {
309
- const existing = readFileSync(mcpPath, 'utf-8');
310
- if (existing !== mcpJson) {
311
- writeFileSync(mcpPath, mcpJson);
300
+ try {
301
+ const existing = readFileSync(mcpPath, 'utf-8');
302
+ mcpConfig = JSON.parse(existing);
303
+ if (!mcpConfig.mcpServers) {
304
+ mcpConfig.mcpServers = {};
305
+ }
306
+ } catch {
307
+ // Invalid JSON, start fresh but warn user
308
+ console.log('Warning: .mcp.json was invalid, recreating it');
309
+ }
310
+ }
311
+
312
+ const existingRopilot = mcpConfig.mcpServers.ropilot;
313
+ const ropilotChanged = JSON.stringify(existingRopilot) !== JSON.stringify(ropilotServer);
314
+
315
+ if (ropilotChanged) {
316
+ mcpConfig.mcpServers.ropilot = ropilotServer;
317
+ writeFileSync(mcpPath, JSON.stringify(mcpConfig, null, 2));
318
+ if (existingRopilot) {
312
319
  updated++;
313
320
  } else {
314
- skipped++;
321
+ created++;
315
322
  }
316
323
  } else {
317
- writeFileSync(mcpPath, mcpJson);
318
- created++;
324
+ skipped++;
319
325
  }
320
326
 
321
327
  console.log(`Project files: ${created} created, ${updated} updated, ${skipped} unchanged`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ropilot",
3
- "version": "0.1.36",
3
+ "version": "0.1.37",
4
4
  "description": "AI-powered Roblox development assistant - MCP CLI",
5
5
  "author": "whut",
6
6
  "license": "MIT",