You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -303,6 +309,12 @@ LibreChat has built-in central logging, see [Logging System](/docs/configuration
303
309
'Enable verbose console/stdout logs in the same format as file debug logs.',
304
310
'DEBUG_CONSOLE=false',
305
311
],
312
+
[
313
+
'LOG_TO_FILE',
314
+
'boolean',
315
+
'Set to false to disable file-backed Winston transports while keeping console logging available.',
316
+
'LOG_TO_FILE=true',
317
+
],
306
318
[
307
319
'CONSOLE_JSON',
308
320
'boolean',
@@ -356,6 +368,65 @@ Note: `DEBUG_CONSOLE` is not recommended, as the outputs can be quite verbose, a
356
368
]}
357
369
/>
358
370
371
+
### OpenTelemetry Tracing
372
+
373
+
LibreChat can emit backend OpenTelemetry traces for general API, HTTP, MongoDB, Mongoose, Redis, and outbound request visibility. Use Langfuse for GenAI-specific prompt/model observability.
374
+
375
+
<OptionTable
376
+
options={[
377
+
[
378
+
'OTEL_TRACING_ENABLED',
379
+
'boolean',
380
+
'Enable backend OpenTelemetry tracing. Tracing remains disabled when OTEL_SDK_DISABLED=true.',
381
+
'# OTEL_TRACING_ENABLED=false',
382
+
],
383
+
[
384
+
'OTEL_SERVICE_NAME',
385
+
'string',
386
+
'Service name reported to OpenTelemetry. Default: librechat.',
387
+
'# OTEL_SERVICE_NAME=librechat',
388
+
],
389
+
[
390
+
'OTEL_SERVICE_VERSION',
391
+
'string',
392
+
'Service version reported to OpenTelemetry. Defaults to the package version when unset.',
['PROXY', 'string', 'Proxy setting for all endpoints.', 'PROXY='],
505
+
[
506
+
'PROXY',
507
+
'string',
508
+
'Outbound proxy for server-side requests, including endpoint calls and remote MCP HTTP/SSE transports. Remote MCP transports also honor HTTP_PROXY, HTTPS_PROXY, and NO_PROXY when PROXY is unset.',
509
+
'PROXY=',
510
+
],
435
511
['TITLE_CONVO', 'boolean', 'Enable titling for all endpoints.', 'TITLE_CONVO=true'],
'Overrides the Secure attribute for session/auth cookies. Leave unset to use the default NODE_ENV/DOMAIN_SERVER heuristic.',
1849
+
'# SESSION_COOKIE_SECURE=false',
1850
+
],
1769
1851
]}
1770
1852
/>
1771
1853
@@ -2007,7 +2089,7 @@ For more information:
2007
2089
[
2008
2090
'OPENID_USE_PKCE',
2009
2091
'boolean',
2010
-
'Use PKCE (Proof Key for Code Exchange) for OpenID authentication.',
2092
+
'Use PKCE (Proof Key for Code Exchange) for OpenID authentication. For public clients without a client secret, leave OPENID_CLIENT_SECRET empty and set this to true.',
2011
2093
'# OPENID_USE_PKCE=true',
2012
2094
],
2013
2095
[
@@ -2706,6 +2788,18 @@ Configure Model Context Protocol settings for enhanced server management and OAu
2706
2788
'Skip code challenge method validation. When set to true, forces S256 code challenge even if not advertised in .well-known/openid-configuration',
2707
2789
'MCP_SKIP_CODE_CHALLENGE_CHECK=false',
2708
2790
],
2791
+
[
2792
+
'MCP_STREAMABLE_HTTP_MAX_RESPONSE_BYTES',
2793
+
'number',
2794
+
'Maximum bytes allowed in a non-GET streamable HTTP MCP response before rejecting it. Set to 0 to disable. Default: 16777216 (16 MiB).',
'Maximum bytes allowed in one SSE line for non-GET streamable HTTP MCP responses. Set to 0 to disable. Default: 5242880 (5 MiB).',
2801
+
'# MCP_STREAMABLE_HTTP_MAX_LINE_BYTES=5242880',
2802
+
],
2709
2803
]}
2710
2804
/>
2711
2805
@@ -2747,6 +2841,12 @@ For detailed configuration and examples, see: **[Redis Configuration Guide](/doc
2747
2841
'Enable Redis cluster mode when using a single URI',
2748
2842
'# USE_REDIS_CLUSTER="true"',
2749
2843
],
2844
+
[
2845
+
'REDIS_CLUSTER_SAFE_DELETE',
2846
+
'boolean',
2847
+
'Delete Redis cache keys individually to avoid CROSSSLOT errors on single-endpoint managed Redis services that shard keys internally.',
2848
+
'# REDIS_CLUSTER_SAFE_DELETE=true',
2849
+
],
2750
2850
[
2751
2851
'REDIS_USERNAME',
2752
2852
'string',
@@ -2808,6 +2908,7 @@ Notes:
2808
2908
2809
2909
- When `USE_REDIS=true`, you must provide `REDIS_URI` or the application will throw an error.
2810
2910
- For Redis Cluster mode, provide multiple URIs: `redis://node1:7001,redis://node2:7002,redis://node3:7003` (cluster mode is auto-detected).
2911
+
- For single-endpoint managed Redis services that shard keys internally, keep `USE_REDIS_CLUSTER=false` and set `REDIS_CLUSTER_SAFE_DELETE=true` if cache clears fail with `CROSSSLOT` errors.
2811
2912
- Use `rediss://` protocol for TLS connections and set `REDIS_CA` if your CA is not publicly trusted.
2812
2913
-`REDIS_KEY_PREFIX_VAR` and `REDIS_KEY_PREFIX` are mutually exclusive.
2813
2914
-**AWS Elasticache with TLS**: Elasticache may need to use an alternate dnsLookup for TLS connections. Set `REDIS_USE_ALTERNATIVE_DNS_LOOKUP=true` if using Elasticache with TLS. See [ioredis documentation](https://www.npmjs.com/package/ioredis) for more details.
temporaryChatRetention: 168 # Retain temporary chats for 7 days
495
+
retentionMode: "temporary"
494
496
```
495
497
496
498
**Common Retention Periods:**
@@ -500,6 +502,30 @@ interface:
500
502
- **720 hours**: `temporaryChatRetention: 720` (30 days - default)
501
503
- **8760 hours**: `temporaryChatRetention: 8760` (1 year - maximum)
502
504
505
+
## retentionMode
506
+
507
+
Controls which data receives retention deadlines.
508
+
509
+
**Key:**
510
+
<OptionTable
511
+
options={[
512
+
['retentionMode', 'String', 'Set to "temporary" to apply retention only to temporary chats, or "all" to apply retention to all supported retained data, including persistent agent resource files.', 'retentionMode: "temporary"'],
513
+
]}
514
+
/>
515
+
516
+
**Default:** `temporary`
517
+
518
+
<Callout type="warning">
519
+
`retentionMode: "all"` applies retention deadlines beyond temporary chats, including persistent agent resource files. Confirm your retention policy before enabling it.
520
+
</Callout>
521
+
522
+
**Example:**
523
+
```yaml filename="interface / retentionMode"
524
+
interface:
525
+
temporaryChatRetention: 168
526
+
retentionMode: "all"
527
+
```
528
+
503
529
## autoSubmitFromUrl
504
530
505
531
Controls whether a prompt supplied via URL query parameters on `/c/new` is auto-submitted to the model.
@@ -622,7 +648,7 @@ Controls the global availability of file citations functionality. When disabled,
622
648
623
649
> **Deprecated for permission management.** Seeds/globally gates the `FILE_CITATIONS` role permission at startup. Prefer the [Admin Panel](/docs/features/admin_panel) for managing citations permissions per role/group/user.
624
650
625
-
**Note:**
651
+
**Note:**
626
652
- This setting acts as a global toggle for the `FILE_CITATIONS` permission system-wide.
627
653
- When set to `false`, no users will see file citations, even if they have been granted the permission through roles.
628
654
- File citations require the `fileSearch` feature to be enabled.
Copy file name to clipboardExpand all lines: content/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx
+21-4Lines changed: 21 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,7 @@ mcpServers:
44
44
streamable-http-server:
45
45
type: streamable-http
46
46
url: https://example.com/api/
47
+
proxy: "${MCP_PROXY_URL}"
47
48
per-user-credentials-example:
48
49
type: streamable-http
49
50
url: "https://example.com/api/"
@@ -84,6 +85,7 @@ mcpServers:
84
85
['command', 'String', '(For `stdio` type) The command or executable to run to start the MCP server.', 'command: "npx"'],
85
86
['args', 'Array of Strings', '(For `stdio` type) Command line arguments to pass to the `command`.', 'args: ["-y", "@modelcontextprotocol/server-puppeteer"]'],
86
87
['url', 'String', '(For `websocket`, `streamable-http`, or `sse` type) The URL to connect to the MCP server.', 'url: "http://localhost:3001/sse"'],
88
+
['proxy', 'String', '(Optional, for `sse` and `streamable-http` types) Outbound proxy URL for this remote MCP server. Supports `http://`, `https://`, `socks://`, and `socks5://` URLs.', 'proxy: "${MCP_PROXY_URL}"'],
87
89
['headers', 'Object', '(Optional, for `sse` and `streamable-http` types) Custom headers to send with the request. Supports dynamic user field substitution with `{{LIBRECHAT_USER_*}}` placeholders and environment variables with `${ENV_VAR}`.', 'headers:\n X-User-ID: "{{LIBRECHAT_USER_ID}}"\n X-API-Key: "${SOME_API_KEY}"'],
88
90
['apiKey', 'Object', '(Optional, for `sse` and `streamable-http` types) API key authentication configuration for the MCP server.', 'See apiKey section below'],
89
91
['iconPath', 'String', '(Optional) Defines the tool\'s display icon shown in the tool selection dialog.', 'iconPath: "/path/to/icon.svg"'],
@@ -150,6 +152,21 @@ mcpServers:
150
152
- For `streamable-http` type, the URL must start with `http://` or `https://`.
151
153
- For `websocket` type, the URL must start with `ws://` or `wss://`.
152
154
155
+
#### `proxy`
156
+
157
+
- **Type:** String (Optional, for `sse` and `streamable-http` types)
158
+
- **Description:** Outbound proxy URL for this remote MCP server. The value can reference environment variables with `${ENV_VAR}`.
159
+
- **Supported protocols:** `http://`, `https://`, `socks://`, and `socks5://`
160
+
- **Security note:** `proxy` is admin-controlled. It resolves environment variables, but does not resolve user-controlled placeholders such as `{{LIBRECHAT_USER_ID}}` or `customUserVars`.
161
+
- **Example:**
162
+
```yaml
163
+
mcpServers:
164
+
remote-api:
165
+
type: streamable-http
166
+
url: https://api.example.com/mcp
167
+
proxy: "${MCP_PROXY_URL}"
168
+
```
169
+
153
170
#### `headers`
154
171
155
172
- **Type:** Object (Optional, for `sse` and `streamable-http` types)
@@ -254,13 +271,13 @@ mcpServers:
254
271
```yaml
255
272
# Use server-provided instructions
256
273
serverInstructions: true
257
-
274
+
258
275
# Use custom instructions
259
276
serverInstructions: |
260
277
When using this filesystem server:
261
278
1. Always use absolute paths for file operations
262
279
2. Check file permissions before attempting write operations
263
-
280
+
264
281
# Explicitly disable instructions
265
282
serverInstructions: false
266
283
```
@@ -351,7 +368,7 @@ mcpServers:
351
368
- **Description:** OAuth2 configuration for authenticating with the MCP server. When configured, users will be prompted to authenticate via OAuth flow before the MCP server can be used. If no client id & client secret is provided, Dynamic Client Registration (DCR) will be used.
352
369
- **Required Subkeys:**
353
370
- `authorization_url`: String - The OAuth authorization endpoint URL
354
-
- `token_url`: String - The OAuth token endpoint URL
371
+
- `token_url`: String - The OAuth token endpoint URL
0 commit comments