@@ -11,7 +11,7 @@ const program = new Command();
1111program
1212 . name ( 'mcp-use' )
1313 . description ( 'MCP CLI tool' )
14- . version ( '0.1.0 ' ) ;
14+ . version ( '2. 0.1' ) ;
1515
1616// Helper to check if server is ready
1717async function waitForServer ( port : number , maxAttempts = 30 ) : Promise < boolean > {
@@ -35,7 +35,7 @@ function runCommand(command: string, args: string[], cwd: string): Promise<void>
3535 const proc = spawn ( command , args , {
3636 cwd,
3737 stdio : 'inherit' ,
38- shell : true ,
38+ shell : false ,
3939 } ) ;
4040
4141 proc . on ( 'error' , reject ) ;
@@ -57,10 +57,12 @@ program
5757 try {
5858 const projectPath = path . resolve ( options . path ) ;
5959
60+ console . log ( '\x1b[36m\x1b[1mmcp-use\x1b[0m \x1b[90mVersion: 2.0.1\x1b[0m\n' ) ;
61+
6062 // Run tsc first
61- console . log ( '🔨 Building TypeScript...' ) ;
63+ console . log ( 'Building TypeScript...' ) ;
6264 await runCommand ( 'npx' , [ 'tsc' ] , projectPath ) ;
63- console . log ( '✅ TypeScript build complete!' ) ;
65+ console . log ( '\x1b[32m✓\x1b[0m TypeScript build complete!' ) ;
6466
6567 // Then build widgets
6668 await buildWidgets ( projectPath , false ) ;
@@ -81,7 +83,7 @@ program
8183 const projectPath = path . resolve ( options . path ) ;
8284 const port = parseInt ( options . port , 10 ) ;
8385
84- console . log ( '🚀 Starting development mode... \n' ) ;
86+ console . log ( '\x1b[36m\x1b[1mmcp-use\x1b[0m \x1b[90mVersion: 2.0.1\x1b[0m \n' ) ;
8587
8688 // Find the main source file
8789 let serverFile = 'src/server.ts' ;
@@ -95,22 +97,20 @@ program
9597 const processes : any [ ] = [ ] ;
9698
9799 // 1. TypeScript watch
98- console . log ( '📦 Starting TypeScript compiler in watch mode...' ) ;
99100 const tscProc = spawn ( 'npx' , [ 'tsc' , '--watch' ] , {
100101 cwd : projectPath ,
101102 stdio : 'pipe' ,
102- shell : true ,
103+ shell : false ,
103104 } ) ;
104105 tscProc . stdout ?. on ( 'data' , ( data ) => {
105106 const output = data . toString ( ) ;
106107 if ( output . includes ( 'Watching for file changes' ) ) {
107- console . log ( '✅ TypeScript compiler watching...' ) ;
108+ console . log ( '\x1b[32m✓\x1b[0m TypeScript compiler watching...' ) ;
108109 }
109110 } ) ;
110111 processes . push ( tscProc ) ;
111112
112113 // 2. Widget builder watch - run in background
113- console . log ( '🎨 Starting widget builder in watch mode...' ) ;
114114 buildWidgets ( projectPath , true ) . catch ( ( error ) => {
115115 console . error ( 'Widget builder failed:' , error ) ;
116116 } ) ;
@@ -119,31 +119,34 @@ program
119119 await new Promise ( resolve => setTimeout ( resolve , 2000 ) ) ;
120120
121121 // 3. Server with tsx
122- console . log ( `🌐 Starting server at http://localhost:${ port } ...` ) ;
123122 const serverProc = spawn ( 'npx' , [ 'tsx' , 'watch' , serverFile ] , {
124123 cwd : projectPath ,
125- stdio : 'inherit ' ,
126- shell : true ,
124+ stdio : 'pipe ' ,
125+ shell : false ,
127126 env : { ...process . env , PORT : String ( port ) } ,
128127 } ) ;
129128 processes . push ( serverProc ) ;
130129
131130 // Auto-open inspector if enabled
132131 if ( options . open ) {
133- console . log ( '⏳ Waiting for server to be ready...' ) ;
132+ const startTime = Date . now ( ) ;
134133 const ready = await waitForServer ( port ) ;
135134 if ( ready ) {
136135 const inspectorUrl = `http://localhost:${ port } /inspector` ;
137- console . log ( `\n🔍 Opening inspector at ${ inspectorUrl } ...\n` ) ;
136+ const mcpUrl = `http://localhost:${ port } /mcp` ;
137+ const readyTime = Date . now ( ) - startTime ;
138+ console . log ( `\n\x1b[32m✓\x1b[0m Ready in ${ readyTime } ms` ) ;
139+ console . log ( `Local: http://localhost:${ port } ` ) ;
140+ console . log ( `Network: http://localhost:${ port } ` ) ;
141+ console . log ( `MCP: ${ mcpUrl } ` ) ;
142+ console . log ( `Inspector: ${ inspectorUrl } \n` ) ;
138143 await open ( inspectorUrl ) ;
139- } else {
140- console . log ( '\n⚠️ Server did not start in time, skipping auto-open' ) ;
141144 }
142145 }
143146
144147 // Handle cleanup
145148 const cleanup = ( ) => {
146- console . log ( '\n\n🛑 Shutting down...' ) ;
149+ console . log ( '\n\nShutting down...' ) ;
147150 processes . forEach ( proc => proc . kill ( ) ) ;
148151 process . exit ( 0 ) ;
149152 } ;
@@ -169,6 +172,8 @@ program
169172 const projectPath = path . resolve ( options . path ) ;
170173 const port = parseInt ( options . port , 10 ) ;
171174
175+ console . log ( '\x1b[36m\x1b[1mmcp-use\x1b[0m \x1b[90mVersion: 2.0.1\x1b[0m\n' ) ;
176+
172177 // Find the built server file
173178 let serverFile = 'dist/server.js' ;
174179 try {
@@ -177,7 +182,7 @@ program
177182 serverFile = 'dist/index.js' ;
178183 }
179184
180- console . log ( '🚀 Starting production server...' ) ;
185+ console . log ( 'Starting production server...' ) ;
181186 const serverProc = spawn ( 'node' , [ serverFile ] , {
182187 cwd : projectPath ,
183188 stdio : 'inherit' ,
@@ -186,7 +191,7 @@ program
186191
187192 // Handle cleanup
188193 const cleanup = ( ) => {
189- console . log ( '\n\n🛑 Shutting down...' ) ;
194+ console . log ( '\n\nShutting down...' ) ;
190195 serverProc . kill ( ) ;
191196 process . exit ( 0 ) ;
192197 } ;
0 commit comments