@@ -95,9 +95,8 @@ export class MCPToolkit extends BaseToolkit {
95
95
hasStreaming =
96
96
( capabilities as any ) ?. notifications ?. streaming === true ||
97
97
( capabilities as any ) ?. experimental ?. notifications ?. streaming === true
98
- console . log ( `🔍 [MCP Core] Server streaming capability:` , hasStreaming )
99
98
} catch ( error ) {
100
- console . log ( `⚠️ [MCP Core] Could not detect streaming capabilities, falling back to non-streaming:` , error . message )
99
+ console . error ( `⚠️ [MCP Core] Could not detect streaming capabilities, falling back to non-streaming:` , error . message )
101
100
}
102
101
103
102
return { client, hasStreaming }
@@ -126,21 +125,6 @@ export class MCPToolkit extends BaseToolkit {
126
125
throw new Error ( 'Client is not initialized' )
127
126
}
128
127
129
- // Log the incoming tool definition for debugging
130
- console . log (
131
- `📋 [MCP Tool Definition] ${ tool . name } :` ,
132
- JSON . stringify (
133
- {
134
- name : tool . name ,
135
- description : tool . description ,
136
- annotations : tool . annotations ,
137
- inputSchema : tool . inputSchema ? 'present' : 'missing'
138
- } ,
139
- null ,
140
- 2
141
- )
142
- )
143
-
144
128
return await MCPTool ( {
145
129
toolkit : this ,
146
130
name : tool . name ,
@@ -175,14 +159,9 @@ export async function MCPTool({
175
159
const { client, hasStreaming } = await toolkit . createClient ( )
176
160
await client . close ( )
177
161
178
- // Check if tool has streaming annotations
179
162
const toolHasStreaming = annotations . streaming_enabled === true
180
163
const shouldUseStreaming = hasStreaming && toolHasStreaming
181
164
182
- console . log (
183
- `🔍 [MCP Tool] ${ name } - Server streaming: ${ hasStreaming } , Tool streaming: ${ toolHasStreaming } , Using streaming: ${ shouldUseStreaming } `
184
- )
185
-
186
165
return tool (
187
166
async ( input , config ) : Promise < string > => {
188
167
return await executeMCPTool ( toolkit , name , input , config , annotations )
@@ -267,7 +246,6 @@ async function handleToolResponse(
267
246
}
268
247
269
248
// Streaming tools wait for completion
270
- console . log ( `🔄 [MCP Tool] Waiting for streaming completion for ${ name } ` )
271
249
return waitForStreamingCompletion ( contentString , sseStreamer , chatId , name , notifications )
272
250
}
273
251
@@ -286,7 +264,6 @@ function waitForStreamingCompletion(
286
264
completed = true
287
265
288
266
const fullResponse = buildFullResponse ( contentString , notifications )
289
- console . log ( `${ reason } [MCP Tool] ${ name } completed, returning full result` )
290
267
resolve ( fullResponse )
291
268
}
292
269
@@ -342,15 +319,12 @@ function setupNotificationHandlers(
342
319
343
320
// Detect completion based on tool's annotation signals
344
321
if ( completionSignals . includes ( logger ) ) {
345
- console . log ( `🎯 [MCP Tool] Completion signal detected: ${ logger } for ${ toolName } ` )
346
-
347
322
// Add visual separation before LLM response
348
323
sseStreamer . streamTokenEvent ( chatId , '\n\n' )
349
324
350
325
// Trigger cleanup after brief delay
351
326
setTimeout ( ( ) => {
352
327
sseStreamer . removeMcpConnection ( chatId , toolName )
353
- console . log ( `🔧 [MCP Tool] Auto-cleanup completed for ${ toolName } ` )
354
328
} , MCP_STREAMING_CONFIG . NOTIFICATION_DELAY )
355
329
}
356
330
} )
0 commit comments