@mandujs/cli 0.9.44 → 0.9.45

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mandujs/cli",
3
- "version": "0.9.44",
3
+ "version": "0.9.45",
4
4
  "description": "Agent-Native Fullstack Framework - 에이전트가 코딩해도 아키텍처가 무너지지 않는 개발 OS",
5
5
  "type": "module",
6
6
  "main": "./src/main.ts",
@@ -215,6 +215,9 @@ export async function init(options: InitOptions = {}): Promise<boolean> {
215
215
  await updatePackageJson(targetDir, css, ui);
216
216
  }
217
217
 
218
+ // Setup .mcp.json for AI agent integration
219
+ const mcpResult = await setupMcpConfig(targetDir);
220
+
218
221
  console.log(`\n✅ 프로젝트 생성 완료!\n`);
219
222
  console.log(`📍 위치: ${targetDir}`);
220
223
  console.log(`\n🚀 시작하기:`);
@@ -241,6 +244,15 @@ export async function init(options: InitOptions = {}): Promise<boolean> {
241
244
  console.log(` src/client/shared/lib/utils.ts → 유틸리티 (cn 함수)`);
242
245
  }
243
246
 
247
+ // MCP 설정 안내
248
+ console.log(`\n🤖 AI 에이전트 통합:`);
249
+ if (mcpResult.created) {
250
+ console.log(` .mcp.json 생성됨 (Claude Code 자동 연결)`);
251
+ } else if (mcpResult.updated) {
252
+ console.log(` .mcp.json에 mandu 서버 추가됨`);
253
+ }
254
+ console.log(` AGENTS.md → 에이전트 가이드 (Bun 사용 명시)`);
255
+
244
256
  return true;
245
257
  }
246
258
 
@@ -343,3 +355,51 @@ async function updatePackageJson(
343
355
 
344
356
  await fs.writeFile(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
345
357
  }
358
+
359
+ interface McpConfigResult {
360
+ created: boolean;
361
+ updated: boolean;
362
+ }
363
+
364
+ /**
365
+ * .mcp.json 설정 (AI 에이전트 통합)
366
+ * - 파일 없으면 새로 생성
367
+ * - 파일 있으면 mandu 서버만 추가/업데이트 (다른 설정 유지)
368
+ */
369
+ async function setupMcpConfig(targetDir: string): Promise<McpConfigResult> {
370
+ const mcpPath = path.join(targetDir, ".mcp.json");
371
+
372
+ const manduServer = {
373
+ command: "bunx",
374
+ args: ["@mandujs/mcp"],
375
+ };
376
+
377
+ try {
378
+ // 기존 파일 확인
379
+ const existingContent = await fs.readFile(mcpPath, "utf-8");
380
+ const existing = JSON.parse(existingContent);
381
+
382
+ // 기존 설정에 mandu 서버 추가/업데이트
383
+ if (!existing.mcpServers) {
384
+ existing.mcpServers = {};
385
+ }
386
+
387
+ const hadMandu = !!existing.mcpServers.mandu;
388
+ existing.mcpServers.mandu = manduServer;
389
+
390
+ await fs.writeFile(mcpPath, JSON.stringify(existing, null, 2) + "\n");
391
+
392
+ return { created: false, updated: true };
393
+ } catch {
394
+ // 파일 없음 - 새로 생성
395
+ const newConfig = {
396
+ mcpServers: {
397
+ mandu: manduServer,
398
+ },
399
+ };
400
+
401
+ await fs.writeFile(mcpPath, JSON.stringify(newConfig, null, 2) + "\n");
402
+
403
+ return { created: true, updated: false };
404
+ }
405
+ }