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
- **Common internal service names** (`redis`, `mongodb`, `postgres`, `api`, etc.)
54
57
55
-
If your actions need to access internal services, you **must explicitly add them** to `allowedDomains`.
58
+
If your actions need to access internal services, either add them to the strict `allowedDomains` whitelist, or leave `allowedDomains` unset and add the exact private service to `allowedAddresses`.
56
59
57
60
### Pattern Formats
58
61
@@ -95,37 +98,38 @@ allowedDomains:
95
98
96
99
## allowedAddresses
97
100
98
-
`allowedAddresses`is an **exemption list** for the SSRF private-IP block — not a domain whitelist. It is the right tool when you want to permit one or two specific private/internal hosts without restricting what your Actions can reach in the public internet.
101
+
`allowedAddresses`is an **exemption list** for the SSRF private-IP block — not a domain whitelist. It is the right tool when you want to permit one or two specific private/internal services without restricting what your Actions can reach in the public internet.
99
102
100
103
### When to use it instead of `allowedDomains`
101
104
102
105
`allowedDomains` is a strict whitelist: when it is set, **only** listed entries are reachable. Adding a private IP there to permit, say, a self-hosted internal API also blocks every public action endpoint that you didn't also list.
103
106
104
-
`allowedAddresses` is orthogonal: it permits specific private targets while leaving the rest of the public internet reachable through the default SSRF policy.
107
+
`allowedAddresses`is used only when `allowedDomains` is not configured. It permits specific private `host:port` targets while leaving the rest of the public internet reachable through the default SSRF policy.
# allowedDomains is intentionally not set — public destinations
112
-
# remain reachable, only listed private hosts are exempted.
115
+
# remain reachable, only listed private host:port services are exempted.
113
116
```
114
117
115
-
You can also combine both: use `allowedDomains` as your strict whitelist and `allowedAddresses` to permit specific private hosts not covered by the domain rules.
118
+
If `allowedDomains` is configured, it is authoritative: private services must be listed there instead of relying on `allowedAddresses`.
- **Host with port**: `localhost:8080`, `[::1]:8080` — list the bare hostname or IP only
127
-
- **Public IP literals**: `8.8.8.8`, `1.1.1.1`, `2001:4860::` — the field is scoped to private IP space; public IPs are not SSRF targets and a public-IP exemption has no defensive purpose
129
+
- **Bare hostnames or IPs**: `localhost`, `10.0.0.5`, `::1`, `[::1]` — every entry must include a port
- **Public IP literals**: `8.8.8.8:53`, `1.1.1.1:53`, `[2001:4860::8888]:443` — the field is scoped to private IP space; public IPs are not SSRF targets and a public-IP exemption has no defensive purpose
128
132
129
133
### Hostname trust
130
134
131
-
A hostname entry trusts whatever IP that hostname resolves to at runtime. If the DNS for a listed hostname is rotated or hijacked to point at a different private IP, the exemption follows. Only list hostnames whose DNS you control. **Prefer literal IPs when you can.**
135
+
A hostname entry trusts whatever IP that hostname resolves to at runtime on the listed port. If the DNS for a listed hostname is rotated or hijacked to point at a different private IP, the exemption follows. Only list hostnames whose DNS you control. **Prefer literal IPs when you can.**
['allowedDomains', 'Array of Strings', 'Strict whitelist of domains for actions. When set, only listed domains are reachable.', ''],
444
-
['allowedAddresses', 'Array of Strings', 'SSRF exemption list (private IP space only). Permits specific private hosts without restricting public destinations.', ''],
444
+
['allowedAddresses', 'Array of Strings', 'SSRF exemption list (private IP space only). Permits specific private host:port services without restricting public destinations when `allowedDomains` is not configured.', ''],
['all', 'Object', 'Global endpoint settings that apply to all endpoints. See Shared Endpoint Settings.', ''],
529
-
['allowedAddresses', 'Array of Strings', 'SSRF exemption list (private IP space only). Permits user-provided baseURLs to point at specific private hosts (e.g. self-hosted Ollama) without disabling SSRF protection for everything else.', ''],
529
+
['allowedAddresses', 'Array of Strings', 'SSRF exemption list (private IP space only). Permits user-provided baseURLs to point at specific private host:port services (e.g. self-hosted Ollama) without disabling SSRF protection for everything else.', ''],
530
530
]}
531
531
/>
532
532
533
533
> **Note:** All endpoints support [Shared Endpoint Settings](/docs/configuration/librechat_yaml/object_structure/shared_endpoint_settings) which include `streamRate`, `titleModel`, `titleMethod`, `titlePrompt`, `titlePromptTemplate`, `titleEndpoint`, and `maxToolResultChars`. These can be configured individually per endpoint or globally using the `all` key. The `all` key does not accept `baseURL`.
534
534
535
-
> **Note:** `endpoints.allowedAddresses` applies to user-provided `baseURL` values (when an admin configures a custom endpoint with `apiKey: 'user_provided'` and `baseURL: 'user_provided'`). Each user-supplied baseURL is validated against the SSRF block at request time; entries listed here are exempted. See [`mcpSettings.allowedAddresses`](/docs/configuration/librechat_yaml/object_structure/mcp_settings#allowedaddresses) for the field semantics — same rules apply (private IP space only, no URLs/CIDR/ports).
535
+
> **Note:** `endpoints.allowedAddresses` applies to user-provided `baseURL` values (when an admin configures a custom endpoint with `apiKey: 'user_provided'` and `baseURL: 'user_provided'`). Each user-supplied baseURL is validated against the SSRF block at request time; entries listed here are exempted. See [`mcpSettings.allowedAddresses`](/docs/configuration/librechat_yaml/object_structure/mcp_settings#allowedaddresses) for the field semantics — same rules apply (private IP space only, port required, no URLs/paths/CIDR/bare hosts/public IP literals).
['allowedDomains', 'Array of Strings', 'Strict whitelist of domains for MCP server connections. When set, only listed entries are reachable.', ''],
550
-
['allowedAddresses', 'Array of Strings', 'SSRF exemption list (private IP space only). Permits specific private hosts without flipping `allowedDomains` into strict-whitelist mode.', ''],
550
+
['allowedAddresses', 'Array of Strings', 'SSRF exemption list (private IP space only). Permits specific private host:port services without flipping `allowedDomains` into strict-whitelist mode.', ''],
551
551
]}
552
552
/>
553
553
554
554
- **Notes**:
555
555
- This is a security feature to protect against abuse / misuse of internal addresses via MCP servers
556
556
- By default, LibreChat restricts MCP servers from connecting to internal, local, or private network addresses
557
-
- MCP servers using local IP addresses or domains can either be added to the strict `allowedDomains` whitelist (which then becomes the only reachable set), or — to keep public destinations reachable — exempted via `allowedAddresses`
557
+
- MCP servers using local IP addresses or domains can either be added to the strict `allowedDomains` whitelist (which then becomes the only reachable set), or — to keep public destinations reachable — exempted as exact host:port services via `allowedAddresses`
558
558
- As with all yaml configuration changes, a LibreChat restart is required to take effect
559
559
- Supports domains, wildcard subdomains (`*.example.com`), docker domains, and IP addresses
Copy file name to clipboardExpand all lines: content/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -403,22 +403,22 @@ mcpServers:
403
403
- **`sse`**: Connects to an external MCP server via Server-Sent Events (SSE).
404
404
- **`streamable-http`**: Connects to an external MCP server via HTTP with support for streaming responses.
405
405
- **Internal/Local Addresses:**
406
-
- **Important**: MCP servers using internal IP addresses (e.g., `172.24.1.165`, `192.168.1.100`), or local domains (e.g., `mcp-server`, `host.docker.internal`) **must** be explicitly allowed in [`mcpSettings.allowedDomains`](/docs/configuration/librechat_yaml/object_structure/mcp_settings).
406
+
- **Important**: MCP servers using internal IP addresses (e.g., `172.24.1.165`, `192.168.1.100`), or local domains (e.g., `mcp-server`, `host.docker.internal`) **must** be explicitly allowed. Use [`mcpSettings.allowedAddresses`](/docs/configuration/librechat_yaml/object_structure/mcp_settings#allowedaddresses) for exact private host:port services when you want public destinations to remain reachable, or [`mcpSettings.allowedDomains`](/docs/configuration/librechat_yaml/object_structure/mcp_settings#alloweddomains) when you want a strict whitelist.
407
407
- See [MCP Settings](/docs/configuration/librechat_yaml/object_structure/mcp_settings) for configuration details.
408
408
409
409
## Examples
410
410
411
411
### Configuration with Internal Addresses
412
412
413
-
When using internal/local MCP servers, you must configure `mcpSettings.allowedDomains`:
413
+
When using internal/local MCP servers and no strict domain whitelist is needed, configure `mcpSettings.allowedAddresses` with the exact host and port:
414
414
415
415
```yaml filename="Complete MCP Configuration with Internal Servers"
416
416
# MCP Settings - Required for internal/local addresses
417
417
mcpSettings:
418
-
allowedDomains:
419
-
- "172.24.1.165" # Internal IP
420
-
- "mcp-prod" # Docker container
421
-
- "host.docker.internal" # Docker host
418
+
allowedAddresses:
419
+
- "172.24.1.165:8000" # Internal IP and port
420
+
- "mcp-prod:8001" # Docker container and port
421
+
- "host.docker.internal:8080" # Docker host and port
0 commit comments