File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,11 +19,13 @@ if (args.length === 0) {
1919 // No arguments, start MCP server
2020 const isLocal = existsSync ( join ( __dirname , '../../mcp-server/dist/index.js' ) ) ;
2121 if ( isLocal ) {
22- import ( '../../mcp-server/dist/index.js' ) ;
22+ const { startMcpServer } = await import ( '../../mcp-server/dist/index.js' ) ;
23+ await startMcpServer ( ) ;
2324 } else {
2425 // Use string literal to avoid TypeScript resolution issues
2526 const mcpServerModule = '@codemcp/workflows-server' ;
26- import ( mcpServerModule ) ;
27+ const { startMcpServer } = await import ( mcpServerModule ) ;
28+ await startMcpServer ( ) ;
2729 }
2830} else {
2931 // Any arguments, run CLI
Original file line number Diff line number Diff line change @@ -78,11 +78,14 @@ async function main() {
7878 }
7979}
8080
81+ // Export for explicit invocation by the CLI wrapper
82+ export { main as startMcpServer } ;
83+
8184// Start the server if this file is run directly
8285// More robust check that works with npx and direct execution
8386const isMainModule =
8487 import . meta. url === `file://${ process . argv [ 1 ] } ` ||
85- process . argv [ 1 ] ?. endsWith ( '@codemcp/ workflows-server' ) ||
88+ process . argv [ 1 ] ?. endsWith ( 'ade- workflows-server' ) ||
8689 process . argv [ 1 ] ?. endsWith ( 'index.js' ) ;
8790
8891if ( isMainModule ) {
You can’t perform that action at this time.
0 commit comments