配置结构
注意: 未明确说明为必填的字段均为可选字段。
version
- 必需
| Key | Type | Description | Example |
|---|---|---|---|
| version | String | 指定配置文件的版本。 | version: 1.3.13 |
cache
| Key | Type | Description | Example |
|---|---|---|---|
| cache | Boolean | 开启或关闭缓存。设置为 `true` 以启用缓存(默认)。 | cache: true |
skillSync
| Key | Type | Description | Example |
|---|---|---|---|
| skillSync | Object | 配置外部 Skill 镜像。在 v1.3.13 版本中,支持 GitHub Skill 同步。 |
请参阅:Skill Sync 对象结构
messageFilter
| Key | Type | Description | Example |
|---|---|---|---|
| messageFilter | Object | 配置服务器端消息过滤器。在 v1.3.13 版本中,`messageFilter.pii` 可以在模型调用和持久化之前拒绝提交的凭据格式文本。 |
请参阅:Message Filter Object Structure
fileStrategy
- 选项: "local" | "firebase" | "s3" | "azure_blob" | "cloudfront"
| Key | Type | Description | Example |
|---|---|---|---|
| fileStrategy | String | 确定用户上传/生成文件的保存位置。如果省略,默认为 `"local"`。 | fileStrategy: "firebase" |
- 注意:
"cloudfront"将文件存储在 S3 中,并返回 CloudFront URL 以实现稳定的媒体分发、签名 Cookie 和签名下载。"firebase"通过 Firebase Storage 和 Firebase Hosting 边缘节点提供文件服务。- S3 通过会过期的 预签名 URL(临时签名令牌)提供文件服务。一旦过期,UI 中任何引用该 URL 的图像或头像都将显示为损坏。这使得 S3 不适合作为视觉资产的主要存储策略。详情请参阅 相关讨论。
- 为了获得最佳的图像和头像性能,请使用
"cloudfront"或"firebase",或者配置fileStrategies以将avatar和image路由到由 CDN 支持的策略。 - 请参阅 File Storage & CDN documentation 以获取设置详情。
fileStrategies
允许对不同文件类型的文件存储策略进行细粒度控制。
- 可用策略: "local" | "firebase" | "s3" | "azure_blob" | "cloudfront"
| Key | Type | Description | Example |
|---|---|---|---|
| fileStrategies | Object | 为不同文件类型配置不同的存储策略。比单一的 fileStrategy 选项更灵活。 |
子键:
| Key | Type | Description | Example |
|---|---|---|---|
| default | String | 当未定义特定类型时的回退存储策略。默认为 "local"。 | |
| avatar | String | 用户和智能体头像图片的存储策略。建议使用 CDN 支持的策略(`"cloudfront"` 或 `"firebase"`)以获得最佳性能。 | |
| image | String | 聊天中上传图片的存储策略。建议使用支持 CDN 的策略(`"cloudfront"` 或 `"firebase"`)以获得最佳性能。 | |
| document | String | 文档上传(PDF、文本文件等)的存储策略。 | |
| skills | String | 与 Skills 绑定的文件的存储策略。 |
- 注意:
- 此设置的优先级高于单个
fileStrategy选项 - 如果未配置特定的文件类型,它将回退到
default,然后是fileStrategy,最后是"local" - 图像和头像需要持久、稳定的 URL 才能在 UI 中正确渲染。S3 预签名 URL 会过期(AWS 上限:IAM 用户为 7 天,基于 STS/角色的凭证为数小时),这会导致模型选择器和聊天 UI 中的图像无法显示。请参阅相关讨论以了解完整背景。请为
avatar和image使用"cloudfront"或"firebase"以避免此问题。 - S3 和 Azure Blob Storage 非常适合用于
document存储,在这种场景下,使用短时效的预签名下载 URL 是合适的。 - 请参阅 File Storage & CDN documentation 以获取各存储提供商的设置详情。
- 此设置的优先级高于单个
示例:
# Use a single strategy for all file types
fileStrategies:
default: 's3'# Route images and avatars to CDN, keep documents in object storage
fileStrategies:
avatar: 'cloudfront' # CDN delivery for avatars
image: 'cloudfront' # CDN delivery for generated/uploaded images
document: 's3' # Object storage for documents# Only configure specific types, others use default
fileStrategies:
default: 'local'
avatar: 'firebase' # Only avatars use Firebase CDN, everything else is localcloudfront
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| cloudfront | Object | 配置用于 S3 存储文件的 CloudFront 分发。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| domain | String | CloudFront 分发域名或 CNAME。当任何文件策略使用 `"cloudfront"` 时为必填项。 | domain: "https://cdn.example.com" |
| distributionId | String | CloudFront 分发 ID。当 `invalidateOnDelete` 为 true 时必填。 | distributionId: "E1234ABCD" |
| invalidateOnDelete | Boolean | 为已删除的文件创建 CloudFront 失效请求。默认值:false。 | invalidateOnDelete: false |
| imageSigning | String | 控制内联图像/头像的访问。选项:`"none"` 或 `"cookies"`。`"url"` 为保留选项,目前未针对图像实现。 | imageSigning: "cookies" |
| cookieDomain | String | 签名 Cookie 需要共享父级 Cookie 域。必须以点号开头。 | cookieDomain: ".example.com" |
| cookieExpiry | Number | 签名 cookie 的有效期(以秒为单位)。默认值:1800,最大值:604800。 | cookieExpiry: 1800 |
| urlExpiry | Number | CloudFront 签名下载 URL 的有效期(秒)。默认值:3600。 | urlExpiry: 3600 |
| storageRegion | String | 当启用区域路径时,用于生成对象键的可选区域标签。 | storageRegion: "us-east-2" |
| includeRegionInPath | Boolean | 在新建的对象键中包含存储区域。默认值:false。 | includeRegionInPath: false |
| requireSignedAccess | Boolean | 当无法初始化签名 cookie CloudFront 访问时拒绝启动。默认值:false。 | requireSignedAccess: true |
请参阅:CloudFront 对象结构 和 配合 S3 使用 CloudFront
filteredTools
| Key | Type | Description | Example |
|---|---|---|---|
| filteredTools | Array of Strings | 从 Plugins 和 OpenAI Assistants endpoint 中过滤掉特定的工具。 | filteredTools: ["scholarai", "calculator"] |
- 注意:
- 如果同时指定了
includedTools和filteredTools,则仅会识别includedTools。 - 同时影响
gptPlugins和assistantsendpoint - 你可以在
api/app/clients/tools/manifest.json中找到用于过滤的工具名称。- 使用
pluginKey值
- 使用
- Also, any listed under the ".well-known" directory
api/app/clients/tools/.well-known- 使用
name_for_model值
- 使用
- 如果同时指定了
includedTools
| Key | Type | Description | Example |
|---|---|---|---|
| includedTools | Array of Strings | 包含来自 Plugins 和 OpenAI Assistants endpoint 的特定工具。 | includedTools: ["calculator"] |
- 注意:
- 如果同时指定了
includedTools和filteredTools,则仅会识别includedTools。 - 同时影响
gptPlugins和assistantsendpoint - 你可以在
api/app/clients/tools/manifest.json中找到用于过滤的工具名称。- 使用
pluginKey值
- 使用
- Also, any listed under the ".well-known" directory
api/app/clients/tools/.well-known- 使用
name_for_model值
- 使用
- 如果同时指定了
secureImageLinks
| Key | Type | Description | Example |
|---|---|---|---|
| secureImageLinks | Boolean | 是否对应用本地托管的图片链接访问进行安全保护。默认值:false。 | secureImageLinks: true |
imageOutputType
- 注意:区分大小写。Google endpoint 仅支持 “jpeg” 和 “png” 输出类型。
- 选项: "png" | "webp" | "jpeg"
| Key | Type | Description | Example |
|---|---|---|---|
| imageOutputType | String | 图像响应的图像输出类型。如果省略,默认为 "png"。 | imageOutputType: "webp" |
ocr
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| ocr | Object | 配置用于从图像中提取文本的光学字符识别 (OCR) 设置。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| apiKey | String | OCR 服务的 API key。 | |
| baseURL | String | OCR 服务 API 的基础 URL。 | |
| strategy | String | 要使用的 OCR 策略。选项包括 "mistral_ocr"、"azure_mistral_ocr"、"vertexai_mistral_ocr"、"document_parser" 或 "custom_ocr"。 | |
| mistralModel | String | 用于 OCR 处理的 Mistral 模型。 |
请参阅:OCR 配置对象结构
webSearch
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| webSearch | Object | 配置网页搜索功能,包括搜索提供商、内容抓取工具和结果重排序器。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| serperApiKey | String | Serper API 密钥的环境变量名称。如果未在 .env 中设置,系统将提示用户通过 UI 提供。 | |
| searxngInstanceUrl | String | SearXNG 实例 URL 的环境变量名称。如果未在 .env 中设置,系统将提示用户通过 UI 提供。 | |
| searxngApiKey | String | SearXNG API 密钥的环境变量名称。如果未在 .env 中设置,系统将提示用户通过 UI 提供。 | |
| tavilyApiKey | String | Tavily API 密钥的环境变量名称。同时用于搜索和抓取。如果未在 .env 中设置,系统将提示用户通过 UI 提供。 | |
| tavilySearchUrl | String | 用于自定义 Tavily Search API URL 的环境变量名称。可选;未设置时默认为 Tavily 托管搜索。 | |
| tavilyExtractUrl | String | 用于自定义 Tavily Extract API URL 的环境变量名称。可选;未设置时默认为 Tavily 托管的 extract。 | |
| firecrawlApiKey | String | Firecrawl API 密钥的环境变量名称。如果未在 .env 中设置,系统将提示用户通过 UI 提供。 | |
| firecrawlApiUrl | String | Firecrawl API URL 的环境变量名称。如果未在 .env 中设置,系统将提示用户通过 UI 提供。 | |
| jinaApiKey | String | Jina API 密钥的环境变量名称。如果未在 .env 中设置,系统将提示用户通过 UI 提供。 | |
| cohereApiKey | String | Cohere API 密钥的环境变量名称。如果未在 .env 中设置,系统将提示用户通过 UI 提供。 | |
| searchProvider | String | 指定要使用的搜索提供程序。选项:"serper", "searxng", "tavily"。 | |
| scraperProvider | String | 指定要使用的抓取服务。选项:"firecrawl", "serper", "tavily"。 | |
| firecrawlVersion | String | 指定 Firecrawl API 版本(v0 或 v1)。 | |
| rerankerType | String | 指定要使用的重排序(reranker)服务。设置为 "none" 以跳过重排序。选项包括:"jina"、"cohere"、"none"。 | |
| scraperTimeout | Integer | 爬虫请求的超时时间(以毫秒为单位)。必须是非负整数。 | |
| safeSearch | Number | 安全搜索过滤级别。0 = 关闭,1 = 中等(默认),2 = 严格。 |
请参阅:Web Search Object Structure
fileConfig
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| fileConfig | Object | 配置应用程序的文件处理设置,包括大小限制和 MIME 类型限制。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| endpoints | Record/Object | 为各个 endpoint 指定文件处理配置,允许按 endpoint 进行自定义。 | |
| serverFileSizeLimit | Number | 服务器将接受的最大文件大小(以 MB 为单位)。除非被特定 endpoint 的设置覆盖,否则全局适用于所有 endpoint。 | |
| avatarSizeLimit | Number | 用户头像图片的最大尺寸(以 MB 为单位)。 | |
| clientImageResize | Object | 配置客户端图像缩放,以优化文件上传并防止因图像过大导致的上传错误。 | |
| ocr | Object | 用于光学字符识别 (OCR) 文件处理的设置。 | |
| text | Object | 直接文本文件解析的设置。 | |
| stt | Object | 用于语音转文字 (STT) 音频文件处理的设置。 | |
| fileTokenLimit | Number | 在截断前包含在提示词中的文本文件最大 Token 数。 | fileTokenLimit: 100000 |
clientImageResize
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| clientImageResize | Object | 配置客户端图像缩放,以优化文件上传并防止因图像过大导致的上传错误。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| enabled | Boolean | 启用或禁用客户端图像调整大小功能。默认值:false。 | enabled: true |
| maxWidth | Number | 调整后图像的最大宽度(以像素为单位)。超过此宽度的图像将被调整大小。默认值:1920。 | maxWidth: 1024 |
| maxHeight | Number | 调整大小后的图像最大高度(像素)。超过此高度的图像将被调整大小。默认值:1080。 | maxHeight: 768 |
| quality | Number | JPEG 压缩质量(0.1 到 1.0)。数值越高,质量越好,但文件体积越大。默认值:0.8。 | quality: 0.9 |
| compressFormat | String | 压缩图像的输出格式。选项:"jpeg", "webp"。默认:"jpeg"。 | compressFormat: "webp" |
描述:
clientImageResize 配置支持在上传前自动进行客户端图像缩放。此功能有助于:
- 防止上传失败,避免因图片文件过大而超出服务器限制
- 减少带宽使用,通过在传输前压缩图像
- 提升上传性能,减小文件大小
- 保持图像质量的同时优化文件大小
启用后,超过指定 maxWidth 或 maxHeight 尺寸的图像会在上传到服务器之前在客户端自动调整大小。调整大小时会保持原始宽高比,同时确保图像符合指定的边界。
示例:
fileConfig:
clientImageResize:
enabled: true
maxWidth: 1920
maxHeight: 1080
quality: 0.8
compressFormat: 'jpeg'注意:
- 仅适用于图像文件(JPEG、PNG、WebP 等)
- 当图片超过指定尺寸时,会自动进行调整大小。
- 调整大小时保留原始宽高比
- 此功能适用于所有受支持的图像上传 endpoint。
- 质量设置仅适用于 JPEG 和 WebP 格式
- 将质量设置得过低(< 0.5)可能会导致明显的图像质量下降
请参阅:文件配置对象结构
rateLimits
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| rateLimits | Object | 定义速率限制策略,通过限制请求数量来防止滥用。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| fileUploads | Object | 专门为文件上传操作配置速率限制。 | |
| conversationsImport | Object | 专门为对话导入操作配置速率限制。 | |
| stt | Object | 专门为语音转文字 (stt) 请求配置速率限制 | |
| tts | Object | 专门为文本转语音 (tts) 请求配置速率限制 |
fileUploads 子键:
| Key | Type | Description | Example |
|---|---|---|---|
| ipMax | Number | 每个 IP 地址在每个时间窗口内允许的最大上传次数。 | |
| ipWindowInMinutes | Number | 基于 IP 的上传限制的时间窗口(以分钟为单位)。 | |
| userMax | Number | 每个用户在每个时间窗口内允许上传的最大数量。 | |
| userWindowInMinutes | Number | 基于用户的上传限制的时间窗口(以分钟为单位)。 |
conversationsImport 子键:
| Key | Type | Description | Example |
|---|---|---|---|
| ipMax | Number | 每个 IP 地址在每个时间窗口内允许的最大导入次数。 | |
| ipWindowInMinutes | Number | 基于 IP 的导入限制的时间窗口(以分钟为单位)。 | |
| userMax | Number | 每个用户在每个窗口中的最大导入次数。 | |
| userWindowInMinutes | Number | 基于用户的导入限制的时间窗口(以分钟为单位)。 |
tts 子键:
| Key | Type | Description | Example |
|---|---|---|---|
| ipMax | Number | 每个 IP 地址在每个时间窗口内允许的最大请求数。 | |
| ipWindowInMinutes | Number | 基于 IP 的请求限制的时间窗口(以分钟为单位)。 | |
| userMax | Number | 每个用户在每个时间窗口内的最大请求数。 | |
| userWindowInMinutes | Number | 基于用户的请求限制的时间窗口(以分钟为单位)。 |
stt 子键:
| Key | Type | Description | Example |
|---|---|---|---|
| ipMax | Number | 每个 IP 地址在每个时间窗口内允许的最大请求数。 | |
| ipWindowInMinutes | Number | 基于 IP 的请求限制的时间窗口(以分钟为单位)。 | |
| userMax | Number | 每个用户在每个时间窗口内的最大请求数。 | |
| userWindowInMinutes | Number | 基于用户的请求限制的时间窗口(以分钟为单位)。 |
- 示例:
rateLimits:
fileUploads:
ipMax: 100
ipWindowInMinutes: 60
userMax: 50
userWindowInMinutes: 60
conversationsImport:
ipMax: 100
ipWindowInMinutes: 60
userMax: 50
userWindowInMinutes: 60
stt:
ipMax: 100
ipWindowInMinutes: 1
userMax: 50
userWindowInMinutes: 1
tts:
ipMax: 100
ipWindowInMinutes: 1
userMax: 50
userWindowInMinutes: 1registration
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| registration | Object | 配置应用程序的注册相关设置。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| socialLogins | 社交登录配置。 | ||
| allowedDomains | 指定允许注册的域名。 |
另请参阅:
memory
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| memory | Object | 配置应用程序的对话记忆和个性化功能。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| disabled | Boolean | 设置为 true 时禁用记忆功能。 | |
| validKeys | Array of Strings | 指定哪些键对于内存存储是有效的。 | |
| tokenLimit | Number | 设置用于内存存储和处理的最大令牌数。 | |
| charLimit | Number | 设置内存存储的最大字符数。默认值:10000。 | |
| maxInputTokens | Number | 限制在提取前发送给自动记忆代理的最近聊天 token 数量。默认值:12000。 | |
| personalize | Boolean | 启用或禁用个性化功能。 | |
| messageWindowSize | Number | 指定包含在记忆上下文中的最近消息数量。 | |
| agent | Object | Union | 配置负责记忆处理的智能体。 |
summarization
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| summarization | Object | 配置对话摘要和上下文修剪。取代了每个 endpoint 中的 `summarize` 和 `summaryModel` 字段。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| provider | String | 用于摘要调用的 LLM 提供商。默认为智能体自身的提供商。 | |
| model | String | 用于摘要调用的模型。默认为智能体自身的模型。 | |
| parameters | Object | 用于摘要请求的额外 LLM 参数。 | |
| prompt | String | 用于初始摘要的自定义提示词。 | |
| updatePrompt | String | 当存在先前的摘要时,用于重新压缩的自定义提示词。 | |
| trigger | Object | 定义触发摘要的时机(按 Token 比例、剩余 Token 数或消息数量)。 | |
| maxSummaryTokens | Number | 用于总结模型响应的最大输出 token 数。 | |
| reserveRatio | Number | 保留作为余量的 Token 配额比例 (0–1)。默认值:0.05。 | |
| contextPruning | Object | 配置针对旧消息基于位置的工具结果降级。 |
请参阅:Summarization Object Structure
actions
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| actions | Object | 配置与操作相关的设置,供 Agents 和 Assistants 使用 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| allowedDomains | Array of Strings | 用于 Actions 的严格域名白名单。设置后,仅可访问所列域名。 | |
| allowedAddresses | Array of Strings | SSRF 免除列表(仅限私有 IP 空间)。在未配置 `allowedDomains` 时,允许特定的私有 host:port 服务,而不限制公共目标。 |
另请参阅:
interface
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| interface | Object | 配置应用程序内的用户界面元素,允许自定义各种组件的可见性和行为。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| privacyPolicy | Object | 包含与所提供的隐私政策链接相关的设置。 | |
| termsOfService | Object | 包含与所提供的服务条款链接相关的设置。 | |
| modelSelect | Boolean | 确定模型选择功能是否可用。 | |
| parameters | Boolean | 切换参数配置选项(即对话设置)的可见性。 | |
| presets | Boolean | 启用或禁用预设菜单 | |
| prompts | Boolean or Object | 启用或禁用所有用户的所有提示词相关功能 | |
| bookmarks | Boolean | 启用或禁用所有用户的所有书签相关功能 | |
| memories | Boolean | 启用或禁用所有用户的记忆功能 | |
| multiConvo | Boolean | 启用或禁用所有用户的所有“多重对话”(即多重响应流)相关功能 | |
| agents | Boolean or Object | 启用或禁用所有用户的全部智能体功能 | |
| temporaryChat | Boolean | 启用或禁用临时聊天功能 | |
| temporaryChatRetention | Number | 配置临时聊天的保留时长(以小时为单位)。最小值为 1,最大值为 8760。默认值为 720(30 天)。 | |
| autoSubmitFromUrl | Boolean | 控制 `/c/new?prompt=…&submit=true` 是否自动提交给模型。当设为 `false` 时,提示词会被预填但不会自动提交。 | |
| mcpServers | Object | 包含与 MCP 服务器选择和访问控制相关的设置。 | |
| customWelcome | String | 在聊天界面中显示的自定义欢迎消息。 | |
| runCode | Boolean | 启用或禁用 Markdown 代码块的“运行代码”按钮 | |
| webSearch | Boolean | 启用或禁用聊天界面中的网页搜索按钮 | |
| fileSearch | Boolean | 启用或禁用聊天界面中的文件搜索按钮 | |
| fileCitations | Boolean | 全局启用或禁用所有用户的文件引用功能 | |
| peoplePicker | Object | 配置在人员选择器界面中可用的主体类型控件 | |
| marketplace | Object | 启用或禁用对 Agent Marketplace 的访问 |
请参阅:Interface Object Structure
modelSpecs
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| modelSpecs | Object | 配置 Model Specs,允许对应用程序内的 AI 模型及其行为进行详细设置和自定义。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| enforce | Boolean | 确定模型规范是否应严格覆盖其他配置设置。 | |
| prioritize | Boolean | 指定当 Model Specs 和默认配置同时适用时,是否应优先使用 Model Specs。 | |
| list | Array of Objects | 包含一系列详细说明各种配置和行为的独立 Model Specs 列表。 |
请参阅:Model Specs 对象结构
endpoints
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| endpoints | Object | 定义应用程序的自定义 API endpoint。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| custom | Array of Objects | 数组中的每个对象都代表一个唯一的 endpoint 配置。 | |
| azureOpenAI | Object | Azure OpenAI endpoint-specific configuration | |
| assistants | Object | Assistants endpoint 特定配置。 | |
| azureAssistants | Object | Azure Assistants 端点特定配置。 | |
| agents | Object | Agents 端点特定配置。 | |
| all | Object | 适用于所有 endpoint 的全局 endpoint 设置。请参阅 Shared Endpoint Settings。 | |
| allowedAddresses | Array of Strings | SSRF 免除列表(仅限私有 IP 空间)。允许用户提供的 baseURL 指向特定的私有 host:port 服务(例如自托管的 Ollama),而无需禁用其他所有内容的 SSRF 保护。 |
注意: 端点支持 Shared Endpoint Settings,例如
streamRate、headers、titleModel、titleMethod、titlePrompt、titlePromptTemplate、titleEndpoint和maxToolResultChars。这些设置可以针对每个端点单独配置,也可以使用all键进行全局配置。headers会进行合并,当键冲突时,端点级别的设置值优先。all键不支持baseURL。
注意:
endpoints.allowedAddresses适用于用户提供的baseURL值(当管理员配置了apiKey: 'user_provided'和baseURL: 'user_provided'的自定义 endpoint 时)。每个用户提供的 baseURL 都会在请求时根据 SSRF 拦截规则进行验证;此处列出的条目将被豁免。有关字段语义,请参阅mcpSettings.allowedAddresses—— 适用相同的规则(仅限私有 IP 空间、必须包含端口、不支持 URL/路径/CIDR/裸主机名/公网 IP 字面量)。
mcpSettings
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| mcpSettings | Object | 定义 Model Context Protocol (MCP) 服务器的全局设置 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| allowedDomains | Array of Strings | MCP 服务器连接的严格域名白名单。设置后,仅允许访问列表中的条目。 | |
| allowedAddresses | Array of Strings | SSRF 免除列表(仅限私有 IP 空间)。允许特定的私有 host:port 服务,而无需将 `allowedDomains` 切换为严格白名单模式。 |
- 注意:
- 这是一个旨在防止通过 MCP 服务器滥用/误用内部地址的安全功能。
- 默认情况下,LibreChat 会限制 MCP 服务器连接到内部、本地或私有网络地址。
- 使用本地 IP 地址或域名的 MCP 服务器,既可以添加到严格的
allowedDomains白名单中(此时该列表将成为唯一可访问的集合),也可以为了保持对公共目标的访问权限,通过allowedAddresses将其作为精确的 host:port 服务进行豁免。 - 与所有 yaml 配置更改一样,需要重启 LibreChat 才能生效。
- 支持域名、通配符子域名 (
*.example.com)、Docker 域名以及 IP 地址
示例:
mcpSettings:
# Strict whitelist mode:
# allowedDomains:
# - "example.com" # Specific domain
# - "*.example.com" # All subdomains
# - "http://mcp-server:3000" # Internal service, explicitly whitelisted
# Default SSRF mode with private service exemptions:
allowedAddresses:
- 'host.docker.internal:8080' # Permit one private host on one port
- '10.0.0.5:8000' # Permit one private IP on one port请参阅:MCP Settings Object Structure
mcpServers
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| mcpServers | Object | 定义 Model Context Protocol (MCP) 服务器的配置,允许在应用程序中动态集成 MCP 服务器。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| <serverName> | Object | `mcpServers` 下的每个键都代表一个独立的 MCP 服务器配置,并由一个唯一的名称标识。 |
- 注意:
- 初始化在启动时进行,必须重启应用才能使更改生效。
<serverName>是每个 MCP 服务器配置的唯一标识符。- 每个 MCP server 都可以使用四种连接类型之一进行配置:
stdiowebsocketssestreamable-http
type字段指定了连接到 MCP server 的连接类型。- 如果省略
type,它将根据url或command的存在与否及其格式进行默认设置:- 如果指定了
url且以http或https开头,则type默认为sse。 - 如果指定了
url且以ws或wss开头,则type默认为websocket。 - 如果指定了
command,type将默认为stdio。
- 如果指定了
- 其他配置选项包括:
timeout: MCP 服务器请求的超时时间(以毫秒为单位)。决定了等待工具请求响应的时长。initTimeout: MCP 服务器初始化的超时时间(以毫秒为单位)。决定了等待服务器初始化的时长。serverInstructions: 控制是否将服务器指令包含在 Agent 上下文中。可以是true(使用服务器提供的指令)、false(禁用)或自定义字符串(覆盖服务器提供的指令)。customUserVars: (可选)定义用户可以为 MCP 服务器设置的自定义变量(例如 API 密钥、URL)。这些通过 UI 提供的用户专属值,随后可以在服务器的headers或env配置中使用{{VARIABLE_NAME}}语法进行引用。这允许针对 MCP 工具进行用户级的身份验证或自定义。
- 请参阅:MCP Servers Object Structure
示例:
mcpServers:
everything:
# type: sse # type can optionally be omitted
url: http://localhost:3001/sse
timeout: 30000
initTimeout: 10000
serverInstructions: true # Use server-provided instructions
puppeteer:
type: stdio
command: npx
args:
- -y
- '@modelcontextprotocol/server-puppeteer'
timeout: 30000
initTimeout: 10000
serverInstructions: 'Do not access any local files or local/internal IP addresses'
filesystem:
# type: stdio
command: npx
args:
- -y
- '@modelcontextprotocol/server-filesystem'
- /home/user/LibreChat/
iconPath: /home/user/LibreChat/client/public/assets/logo.svg
mcp-obsidian:
command: npx
args:
- -y
- 'mcp-obsidian'
- /path/to/obsidian/vault
streamable-http-example:
type: streamable-http
url: https://example.com/mcp
headers:
Authorization: 'Bearer ${API_TOKEN}'
timeout: 30000
per-user-crendentials-example:
type: sse
url: 'https//some.mcp/sse'
headers:
X-Custom-Auth-Token: '{{USER_API_KEY}}' # Placeholder for the user-provided API key, defined in `customUserVars` below.
customUserVars:
USER_API_KEY:
title: 'Service API Key'
description: "Your personal API key for this service. You can get it <a href='https://example.com/api-keys' target='_blank'>here</a>."
serverInstructions: true请参阅:MCP Servers Object Structure
speech
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| speech | Object | 配置应用程序的文本转语音 (TTS) 和语音转文本 (STT) 提供商。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| tts | Object | Text-to-Speech 提供商配置 (OpenAI, Azure OpenAI, ElevenLabs, LocalAI)。 | |
| stt | Object | Speech-to-Text 提供商配置 (OpenAI, Azure OpenAI)。 | |
| speechTab | Object | 语音功能的默认 UI 设置。 |
turnstile
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| turnstile | Object | 为注册和登录表单配置 Cloudflare Turnstile 以实现机器人防护。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| siteKey | String | 您的 Cloudflare Turnstile 站点密钥(必填)。 | |
| options | Object | 其他 Turnstile 小部件选项(可选)。 |
请参阅:Turnstile 对象结构
transactions
密钥:
| Key | Type | Description | Example |
|---|---|---|---|
| transactions | Object | 控制事务日志记录和可见性功能。 |
子键 (Subkeys):
| Key | Type | Description | Example |
|---|---|---|---|
| enabled | Boolean | 启用或禁用事务日志记录。默认值:true。 |
请参阅:Transactions Object Structure
其他链接
这篇指南怎么样?