From 6a4a8f9803de8cb107ff1fad39818514cbf1f7a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 22 Oct 2025 11:14:34 +0200 Subject: [PATCH] fix: call startServer() for the cli --- .vibe/development-plan-publish-cli.md | 1 + packages/cli/src/index.ts | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.vibe/development-plan-publish-cli.md b/.vibe/development-plan-publish-cli.md index 5cf94e8..6d4856c 100644 --- a/.vibe/development-plan-publish-cli.md +++ b/.vibe/development-plan-publish-cli.md @@ -155,6 +155,7 @@ if (args.length === 0) { - [x] Update all test configurations from old format (web_sources, local_path) to new sources format - [x] Fix CLI routing issue - entry point was not properly awaiting imports - [x] Fix missing CLI dependencies in main package (commander, chalk, ora) +- [x] Fix MCP server import - call startServer() function instead of importing index.js ### Completed diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 16851c5..eaddbda 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -22,11 +22,13 @@ async function main() { join(__dirname, "../../mcp-server/dist/index.js"), ); if (isLocal) { - await import("../../mcp-server/dist/index.js"); + const { startServer } = await import("../../mcp-server/dist/cli.js"); + await startServer(); } else { // Use string literal to avoid TypeScript resolution issues const mcpServerModule = "@codemcp/knowledge-mcp-server"; - await import(mcpServerModule); + const { startServer } = await import(mcpServerModule); + await startServer(); } } else { // Any arguments, run CLI