1616
1717import type { RuntimeManager } from '@genkit-ai/tools-common/manager' ;
1818import { startServer } from '@genkit-ai/tools-common/server' ;
19- import { logger } from '@genkit-ai/tools-common/utils' ;
19+ import { findProjectRoot , logger } from '@genkit-ai/tools-common/utils' ;
2020import { spawn } from 'child_process' ;
2121import { Command } from 'commander' ;
2222import getPort , { makeRange } from 'get-port' ;
2323import open from 'open' ;
24- import { startMcpServer } from '../mcp/server' ;
2524import { startManager } from '../utils/manager-utils' ;
2625
2726interface RunOptions {
2827 noui ?: boolean ;
2928 port ?: string ;
3029 open ?: boolean ;
31- mcpExperimental ?: boolean ;
32- mcpPort ?: string ;
3330}
3431
3532/** Command to run code in dev mode and/or the Dev UI. */
@@ -38,11 +35,12 @@ export const start = new Command('start')
3835 . option ( '-n, --noui' , 'do not start the Dev UI' , false )
3936 . option ( '-p, --port <port>' , 'port for the Dev UI' )
4037 . option ( '-o, --open' , 'Open the browser on UI start up' )
41- . option ( '--mcp-experimental' , 'start MCP server (Experimental)' )
42- . option ( '--mcp-port' , 'MCP server port' )
4338 . action ( async ( options : RunOptions ) => {
4439 // Always start the manager.
45- let managerPromise : Promise < RuntimeManager > = startManager ( true ) ;
40+ let managerPromise : Promise < RuntimeManager > = startManager (
41+ await findProjectRoot ( ) ,
42+ true
43+ ) ;
4644 if ( ! options . noui ) {
4745 let port : number ;
4846 if ( options . port ) {
@@ -64,11 +62,7 @@ export const start = new Command('start')
6462 }
6563 await managerPromise . then ( ( manager : RuntimeManager ) => {
6664 const telemetryServerUrl = manager ?. telemetryServerUrl ;
67- const promises = [ startRuntime ( telemetryServerUrl ) ] ;
68- if ( options . mcpExperimental ) {
69- promises . push ( startMcpServer ( options . mcpPort , manager ) ) ;
70- }
71- return Promise . all ( promises ) ;
65+ return startRuntime ( telemetryServerUrl ) ;
7266 } ) ;
7367 } ) ;
7468
0 commit comments