File tree Expand file tree Collapse file tree 4 files changed +8
-2
lines changed Expand file tree Collapse file tree 4 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -113,12 +113,14 @@ mcpServers:
113
113
everything :
114
114
# type: sse # type can optionally be omitted
115
115
url : http://localhost:3001/sse
116
+ timeout : 60000 # 1 minute timeout for this server, this is the default timeout for MCP servers.
116
117
puppeteer :
117
118
type : stdio
118
119
command : npx
119
120
args :
120
121
- -y
121
122
- " @modelcontextprotocol/server-puppeteer"
123
+ timeout : 300000 # 5 minutes timeout for this server
122
124
filesystem :
123
125
# type: stdio
124
126
command : npx
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { extractEnvVariable } from './utils';
3
3
4
4
const BaseOptionsSchema = z . object ( {
5
5
iconPath : z . string ( ) . optional ( ) ,
6
+ timeout : z . number ( ) . optional ( ) ,
6
7
} ) ;
7
8
8
9
export const StdioOptionsSchema = BaseOptionsSchema . extend ( {
Original file line number Diff line number Diff line change @@ -43,12 +43,14 @@ export class MCPConnection extends EventEmitter {
43
43
private isInitializing = false ;
44
44
private reconnectAttempts = 0 ;
45
45
iconPath ?: string ;
46
+ timeout ?: number ;
46
47
47
48
constructor ( serverName : string , private readonly options : t . MCPOptions , private logger ?: Logger ) {
48
49
super ( ) ;
49
50
this . serverName = serverName ;
50
51
this . logger = logger ;
51
52
this . iconPath = options . iconPath ;
53
+ this . timeout = options . timeout ;
52
54
this . client = new Client (
53
55
{
54
56
name : 'librechat-mcp-client' ,
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ export class MCPManager {
159
159
} ;
160
160
}
161
161
} catch ( error ) {
162
- this . logger . warn ( `[MCP][${ serverName } ] Not connected, skipping tool fetch` ) ;
162
+ this . logger . warn ( `[MCP][${ serverName } ] Error fetching tools:` , error ) ;
163
163
}
164
164
}
165
165
}
@@ -183,7 +183,7 @@ export class MCPManager {
183
183
} ) ;
184
184
}
185
185
} catch ( error ) {
186
- this . logger . error ( `[MCP][${ serverName } ] Error fetching tools` , error ) ;
186
+ this . logger . error ( `[MCP][${ serverName } ] Error fetching tools: ` , error ) ;
187
187
}
188
188
}
189
189
}
@@ -209,6 +209,7 @@ export class MCPManager {
209
209
} ,
210
210
} ,
211
211
CallToolResultSchema ,
212
+ { timeout : connection . timeout } ,
212
213
) ;
213
214
return formatToolContent ( result , provider ) ;
214
215
}
You can’t perform that action at this time.
0 commit comments