⏱ feat: Add Timeout Options and Update Agent Chain Image (#265)

* fix: Update Agent Chain Image to External Source and Remove Local File

* 📝 feat: Add timeout and initTimeout configuration options for MCP server requests

* WIP: Add `timeout` and `initTimeout` options for MCP server configuration
This commit is contained in:
Danny Avila
2025-03-19 02:00:31 -04:00
committed by GitHub
parent 34bef24e0b
commit 6e07c668e4
5 changed files with 23 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
- Added `timeout` to [MCP Servers](/docs/configuration/librechat_yaml/object_structure/mcp_servers)
- Controls how long to wait for a response from MCP server tool requests (in milliseconds)
- Provides better control over MCP server request behavior
- Allows adjusting timeouts based on expected response times for different MCP servers
- Added `initTimeout` to [MCP Servers](/docs/configuration/librechat_yaml/object_structure/mcp_servers)
- Controls how long to wait for MCP server initialization (in milliseconds)
- Allows configuration of initialization timeouts for servers that may take longer to start up
- Helps fine-tune performance for specific environments and use cases

View File

@@ -341,6 +341,9 @@ see: [Model Specs Object Structure](/docs/configuration/librechat_yaml/object_st
- If `url` is specified and starts with `http` or `https`, `type` defaults to `sse`. - If `url` is specified and starts with `http` or `https`, `type` defaults to `sse`.
- If `url` is specified and starts with `ws` or `wss`, `type` defaults to `websocket`. - If `url` is specified and starts with `ws` or `wss`, `type` defaults to `websocket`.
- If `command` is specified, `type` defaults to `stdio`. - If `command` is specified, `type` defaults to `stdio`.
- Additional configuration options include:
- `timeout`: Timeout in milliseconds for MCP server requests. Determines how long to wait for a response for tool requests.
- `initTimeout`: Timeout in milliseconds for MCP server initialization. Determines how long to wait for the server to initialize.
- see: [MCP Servers Object Structure](/docs/configuration/librechat_yaml/object_structure/mcp_servers) - see: [MCP Servers Object Structure](/docs/configuration/librechat_yaml/object_structure/mcp_servers)
**Example:** **Example:**
@@ -350,12 +353,16 @@ mcpServers:
everything: everything:
# type: sse # type can optionally be omitted # type: sse # type can optionally be omitted
url: http://localhost:3001/sse url: http://localhost:3001/sse
timeout: 30000
initTimeout: 10000
puppeteer: puppeteer:
type: stdio type: stdio
command: npx command: npx
args: args:
- -y - -y
- "@modelcontextprotocol/server-puppeteer" - "@modelcontextprotocol/server-puppeteer"
timeout: 30000
initTimeout: 10000
filesystem: filesystem:
# type: stdio # type: stdio
command: npx command: npx

View File

@@ -48,6 +48,8 @@ mcpServers:
['args', 'Array of Strings', '(For `stdio` type) Command line arguments to pass to the `command`.', 'args: ["-y", "@modelcontextprotocol/server-puppeteer"]'], ['args', 'Array of Strings', '(For `stdio` type) Command line arguments to pass to the `command`.', 'args: ["-y", "@modelcontextprotocol/server-puppeteer"]'],
['url', 'String', '(For `websocket` or `sse` type) The URL to connect to the MCP server.', 'url: "http://localhost:3001/sse"'], ['url', 'String', '(For `websocket` or `sse` type) The URL to connect to the MCP server.', 'url: "http://localhost:3001/sse"'],
['iconPath', 'String', '(Optional) Defines the tool\'s display icon shown in the tool selection dialog.', 'iconPath: "/path/to/icon.svg"'], ['iconPath', 'String', '(Optional) Defines the tool\'s display icon shown in the tool selection dialog.', 'iconPath: "/path/to/icon.svg"'],
['timeout', 'Number', '(Optional) Timeout in milliseconds for MCP server requests. Determines how long to wait for a response for tool requests.', 'timeout: 30000'],
['initTimeout', 'Number', '(Optional) Timeout in milliseconds for MCP server initialization. Determines how long to wait for the server to initialize.', 'initTimeout: 10000'],
['env', 'Object', '(Optional, `stdio` type only) Environment variables to use when spawning the process.', 'env:\n NODE_ENV: "production"'], ['env', 'Object', '(Optional, `stdio` type only) Environment variables to use when spawning the process.', 'env:\n NODE_ENV: "production"'],
['stderr', 'String or Stream or Number', '(Optional, `stdio` type only) How to handle `stderr` of the child process. Defaults to `"inherit"`.', 'stderr: "inherit"'], ['stderr', 'String or Stream or Number', '(Optional, `stdio` type only) How to handle `stderr` of the child process. Defaults to `"inherit"`.', 'stderr: "inherit"'],
]} ]}
@@ -116,6 +118,8 @@ puppeteer:
args: args:
- -y - -y
- "@modelcontextprotocol/server-puppeteer" - "@modelcontextprotocol/server-puppeteer"
timeout: 30000
initTimeout: 10000
env: env:
NODE_ENV: "production" NODE_ENV: "production"
stderr: inherit stderr: inherit

View File

@@ -3,6 +3,8 @@ title: AI Agents - LibreChat's No-Code Agentic Framework
description: Learn how to create, customize, and leverage LibreChat's AI Agents - a powerful framework for building custom AI assistants with any model provider. description: Learn how to create, customize, and leverage LibreChat's AI Agents - a powerful framework for building custom AI assistants with any model provider.
--- ---
import Image from 'next/image'
# Agents: Build Custom AI Assistants # Agents: Build Custom AI Assistants
LibreChat's AI Agents feature provides a flexible framework for creating custom AI assistants powered by various model providers. LibreChat's AI Agents feature provides a flexible framework for creating custom AI assistants powered by various model providers.
@@ -151,7 +153,7 @@ The Agent Chain capability enables a Mixture-of-Agents (MoA) approach, allowing
- **Note:** This feature is currently in beta and may be subject to change - **Note:** This feature is currently in beta and may be subject to change
- The current maximum of agents that can be chained is 10, but this may be configurable in the future - The current maximum of agents that can be chained is 10, but this may be configurable in the future
![Agent Chain](/images/agents/agent_chain.png) <Image src="https://firebasestorage.googleapis.com/v0/b/superb-reporter-407417.appspot.com/o/agent_chain.png?alt=media&token=bfa209b9-d2ab-403f-b097-6300b4017fc8" alt="Agent Chain" width={488} height={269}/>
This feature introduces a layered Mixture-of-Agents architecture to LibreChat, where each agent takes all the outputs from agents in the previous layer as auxiliary information in generating its response, as described in [the eponymous "Mixture-of-Agents" paper](https://arxiv.org/abs/2406.04692). This feature introduces a layered Mixture-of-Agents architecture to LibreChat, where each agent takes all the outputs from agents in the previous layer as auxiliary information in generating its response, as described in [the eponymous "Mixture-of-Agents" paper](https://arxiv.org/abs/2406.04692).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB