MCP Settings Object Structure
Overview
The mcpSettings configuration provides global settings for MCP (Model Context Protocol) server security and behavior. This configuration is separate from mcpServers and controls how MCP servers can connect to certain domains and IP addresses.
Example
# Example MCP Settings Configuration
mcpSettings:
allowedDomains:
- "example.com" # Specific domain
- "*.example.com" # All subdomains using wildcard
- "mcp-server" # Local Docker domain
- "172.24.1.165" # Internal network IPConfiguration
Subkeys
| Key | Type | Description | Example |
|---|---|---|---|
| allowedDomains | Array of Strings | A list specifying allowed domains for MCP server connections. | MCP servers with domains not listed will be restricted from connecting. |
Security Context
By default, LibreChat restricts MCP servers from connecting to internal, local, or private network addresses to prevent potential security risks. This means that MCP servers using:
- Internal IP addresses (e.g.,
172.24.1.165,192.168.1.100) - Local Docker domains (e.g.,
mcp-server,localhost) - Private network ranges (e.g.,
10.0.0.0/8)
must be explicitly allowed in the allowedDomains configuration.
Pattern Formats
The allowedDomains array supports several pattern formats:
-
Exact Domain Match
allowedDomains: - "example.com"Only allows connections to exactly
example.com -
Wildcard Subdomain Match
allowedDomains: - "*.example.com"Allows connections to all subdomains of
example.com(e.g.,api.example.com,mcp.example.com) -
Specific IP Address
allowedDomains: - "192.168.1.100" - "172.24.1.165"Allows connections to specific IP addresses
-
Local Docker Domains
allowedDomains: - "mcp-server" - "host.docker.internal"Allows connections to Docker container names or special Docker domains
Error Messages
If you see errors like:
error: [MCPServersRegistry] Failed to inspect server "my-mcp": Domain "http://172.24.1.165:8000" is not allowed
error: [MCP][my-mcp] Failed to initialize: Domain "http://172.24.1.165:8000" is not allowedThis likely indicates that the MCP serverβs domain needs to be added to allowedDomains:
mcpSettings:
allowedDomains:
- "172.24.1.165" # Add the IP address or domainReferences
- MCP Servers Configuration
- MCP Features
- Actions allowedDomains (similar concept for Actions)