@lobehub/chat 1.96.18 → 1.96.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +7 -0
- package/CHANGELOG.md +50 -0
- package/changelog/v1.json +18 -0
- package/package.json +2 -2
- package/packages/file-loaders/package.json +1 -1
- package/src/libs/mcp/client.ts +10 -2
package/.env.example
CHANGED
@@ -232,3 +232,10 @@ OPENAI_API_KEY=sk-xxxxxxxxx
|
|
232
232
|
|
233
233
|
# Specify the Embedding model and Reranker model(unImplemented)
|
234
234
|
# DEFAULT_FILES_CONFIG="embedding_model=openai/embedding-text-3-small,reranker_model=cohere/rerank-english-v3.0,query_mode=full_text"
|
235
|
+
|
236
|
+
########################################
|
237
|
+
########## MCP Service Config ##########
|
238
|
+
########################################
|
239
|
+
|
240
|
+
# MCP tool call timeout (milliseconds)
|
241
|
+
# MCP_TOOL_TIMEOUT=60000
|
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,56 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.96.20](https://github.com/lobehub/lobe-chat/compare/v1.96.19...v1.96.20)
|
6
|
+
|
7
|
+
<sup>Released on **2025-07-08**</sup>
|
8
|
+
|
9
|
+
#### 💄 Styles
|
10
|
+
|
11
|
+
- **misc**: Add `MCP_TOOL_TIMEOUT` env and improve debug usage guide.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Styles
|
19
|
+
|
20
|
+
- **misc**: Add `MCP_TOOL_TIMEOUT` env and improve debug usage guide, closes [#8357](https://github.com/lobehub/lobe-chat/issues/8357) ([d4baae5](https://github.com/lobehub/lobe-chat/commit/d4baae5))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.96.19](https://github.com/lobehub/lobe-chat/compare/v1.96.18...v1.96.19)
|
31
|
+
|
32
|
+
<sup>Released on **2025-07-07**</sup>
|
33
|
+
|
34
|
+
#### 🐛 Bug Fixes
|
35
|
+
|
36
|
+
- **misc**: Pin `officeparser@5.1.1` to fix server error.
|
37
|
+
|
38
|
+
<br/>
|
39
|
+
|
40
|
+
<details>
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
42
|
+
|
43
|
+
#### What's fixed
|
44
|
+
|
45
|
+
- **misc**: Pin `officeparser@5.1.1` to fix server error, closes [#8354](https://github.com/lobehub/lobe-chat/issues/8354) ([3f4e935](https://github.com/lobehub/lobe-chat/commit/3f4e935))
|
46
|
+
|
47
|
+
</details>
|
48
|
+
|
49
|
+
<div align="right">
|
50
|
+
|
51
|
+
[](#readme-top)
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
5
55
|
### [Version 1.96.18](https://github.com/lobehub/lobe-chat/compare/v1.96.17...v1.96.18)
|
6
56
|
|
7
57
|
<sup>Released on **2025-07-06**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"improvements": [
|
5
|
+
"Add MCP_TOOL_TIMEOUT env and improve debug usage guide."
|
6
|
+
]
|
7
|
+
},
|
8
|
+
"date": "2025-07-08",
|
9
|
+
"version": "1.96.20"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"children": {
|
13
|
+
"fixes": [
|
14
|
+
"Pin officeparser@5.1.1 to fix server error."
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"date": "2025-07-07",
|
18
|
+
"version": "1.96.19"
|
19
|
+
},
|
2
20
|
{
|
3
21
|
"children": {
|
4
22
|
"fixes": [
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.96.
|
3
|
+
"version": "1.96.20",
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
5
5
|
"keywords": [
|
6
6
|
"framework",
|
@@ -212,7 +212,7 @@
|
|
212
212
|
"nextjs-toploader": "^3.8.16",
|
213
213
|
"numeral": "^2.0.6",
|
214
214
|
"nuqs": "^2.4.3",
|
215
|
-
"officeparser": "
|
215
|
+
"officeparser": "5.1.1",
|
216
216
|
"oidc-provider": "^8.8.1",
|
217
217
|
"ollama": "^0.5.16",
|
218
218
|
"openai": "^4.104.0",
|
package/src/libs/mcp/client.ts
CHANGED
@@ -11,6 +11,12 @@ import debug from 'debug';
|
|
11
11
|
import { MCPClientParams, McpTool } from './types';
|
12
12
|
|
13
13
|
const log = debug('lobe-mcp:client');
|
14
|
+
// MCP tool call timeout (milliseconds), configurable via the environment variable MCP_TOOL_TIMEOUT, default is 60000
|
15
|
+
// Parse MCP_TOOL_TIMEOUT, only use if it's a valid positive number, otherwise fallback to default 60000
|
16
|
+
const MCP_TOOL_TIMEOUT = (() => {
|
17
|
+
const val = Number(process.env.MCP_TOOL_TIMEOUT);
|
18
|
+
return Number.isFinite(val) && val > 0 ? val : 60_000;
|
19
|
+
})();
|
14
20
|
|
15
21
|
export class MCPClient {
|
16
22
|
private mcp: Client;
|
@@ -87,8 +93,10 @@ export class MCPClient {
|
|
87
93
|
}
|
88
94
|
|
89
95
|
async callTool(toolName: string, args: any) {
|
90
|
-
log('Calling tool: %s with args: %O', toolName, args);
|
91
|
-
const result = await this.mcp.callTool({ arguments: args, name: toolName }
|
96
|
+
log('Calling tool: %s with args: %O, timeout: %O', toolName, args, MCP_TOOL_TIMEOUT);
|
97
|
+
const result = await this.mcp.callTool({ arguments: args, name: toolName }, undefined, {
|
98
|
+
timeout: MCP_TOOL_TIMEOUT,
|
99
|
+
});
|
92
100
|
log('Tool call result: %O', result);
|
93
101
|
return result;
|
94
102
|
}
|