hytopia 0.6.29 → 0.6.31

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/bin/scripts.mjs CHANGED
@@ -221,11 +221,11 @@ function initMcp() {
221
221
  if ([1, 2, 3].includes(selection)) { logDivider(); }
222
222
 
223
223
  if (selection === 1 || selection === 3) {
224
- initEditorMcp('Cursor', 'cursor');
224
+ initCursorLocalMcp();
225
225
  }
226
226
 
227
227
  if (selection === 2 || selection === 3) {
228
- initEditorMcp('Claude Code', 'claude');
228
+ initClaudeCodeMcp();
229
229
  }
230
230
 
231
231
  rl.close();
@@ -237,13 +237,43 @@ function initMcp() {
237
237
  });
238
238
  }
239
239
 
240
- /**
241
- * Initializes MCP for a specific editor
242
- */
243
- function initEditorMcp(editorName, editorFlag) {
244
- console.log(`🔧 Initializing HYTOPIA MCP for ${editorName}...`);
245
- execSync(`bunx topia-mcp@latest init ${editorFlag}`);
246
- console.log(`✅ ${editorName} MCP initialized successfully!`);
240
+ function initClaudeCodeMcp() {
241
+ console.log('🔧 Initializing HYTOPIA MCP for Claude Code...');
242
+ try {
243
+ execSync('claude mcp add hytopia-mcp -s project --transport http https://ai.hytopia.com/mcp');
244
+ } catch (err) {
245
+ console.log('⚠️ Could not add MCP via claude CLI, falling back to manual config...');
246
+ const claudeDir = path.join(process.cwd(), '.claude');
247
+ if (!fs.existsSync(claudeDir)) {
248
+ fs.mkdirSync(claudeDir);
249
+ }
250
+ fs.writeFileSync(path.join(claudeDir, '.mcp.json'), JSON.stringify({
251
+ mcpServers: {
252
+ 'hytopia-mcp': {
253
+ url: 'https://ai.hytopia.com/mcp'
254
+ }
255
+ }
256
+ }, null, 2));
257
+ }
258
+ console.log(`✅ Claude Code MCP initialized successfully!`);
259
+ logDivider();
260
+ }
261
+
262
+ function initCursorLocalMcp() {
263
+ console.log('🔧 Initializing HYTOPIA MCP for Cursor...');
264
+ const cursorDir = path.join(process.cwd(), '.cursor');
265
+ if (!fs.existsSync(cursorDir)) {
266
+ fs.mkdirSync(cursorDir);
267
+ }
268
+ fs.writeFileSync(path.join(cursorDir, 'mcp.json'), JSON.stringify({
269
+ mcpServers: {
270
+ 'hytopia-mcp': {
271
+ url: 'https://ai.hytopia.com/mcp'
272
+ }
273
+ }
274
+ }, null, 2));
275
+
276
+ console.log(`✅ Cursor MCP initialized successfully!`);
247
277
  logDivider();
248
278
  }
249
279