@@ -112,6 +112,7 @@ public StdioClientTransport(ServerParameters params, ObjectMapper objectMapper)
112112 @ Override
113113 public Mono <Void > connect (Function <Mono <JSONRPCMessage >, Mono <JSONRPCMessage >> handler ) {
114114 return Mono .<Void >fromRunnable (() -> {
115+ logger .info ("MCP server starting." );
115116 handleIncomingMessages (handler );
116117 handleIncomingErrors ();
117118
@@ -124,15 +125,13 @@ public Mono<Void> connect(Function<Mono<JSONRPCMessage>, Mono<JSONRPCMessage>> h
124125 processBuilder .command (fullCommand );
125126 processBuilder .environment ().putAll (params .getEnv ());
126127
127- measureTime (() -> {
128- // Start the process
129- try {
130- this .process = processBuilder .start ();
131- }
132- catch (IOException e ) {
133- throw new RuntimeException ("Failed to start process with command: " + fullCommand , e );
134- }
135- }, "Process start" );
128+ // Start the process
129+ try {
130+ this .process = processBuilder .start ();
131+ }
132+ catch (IOException e ) {
133+ throw new RuntimeException ("Failed to start process with command: " + fullCommand , e );
134+ }
136135
137136 // Validate process streams
138137 if (this .process .getInputStream () == null || process .getOutputStream () == null ) {
@@ -144,6 +143,7 @@ public Mono<Void> connect(Function<Mono<JSONRPCMessage>, Mono<JSONRPCMessage>> h
144143 startInboundProcessing ();
145144 startOutboundProcessing ();
146145 startErrorProcessing ();
146+ logger .info ("MCP server started" );
147147 }).subscribeOn (Schedulers .boundedElastic ());
148148 }
149149
@@ -367,6 +367,8 @@ public Mono<Void> closeGracefully() {
367367 })).doOnNext (process -> {
368368 if (process .exitValue () != 0 ) {
369369 logger .warn ("Process terminated with code " + process .exitValue ());
370+ } else {
371+ logger .info ("MCP server process stopped" );
370372 }
371373 }).then (Mono .fromRunnable (() -> {
372374 try {
0 commit comments