Skip to main content
LibreChat is joining ClickHouse to power the open-source Agentic Data Stack 🎉 Learn more
LibreChat

配置结构

注意: 未明确说明为必填的字段均为可选字段。

version

  • 必需
KeyTypeDescriptionExample
versionString指定配置文件的版本。version: 1.3.13

cache

KeyTypeDescriptionExample
cacheBoolean开启或关闭缓存。设置为 `true` 以启用缓存(默认)。cache: true

skillSync

KeyTypeDescriptionExample
skillSyncObject配置外部 Skill 镜像。在 v1.3.13 版本中,支持 GitHub Skill 同步。

请参阅:Skill Sync 对象结构

messageFilter

KeyTypeDescriptionExample
messageFilterObject配置服务器端消息过滤器。在 v1.3.13 版本中,`messageFilter.pii` 可以在模型调用和持久化之前拒绝提交的凭据格式文本。

请参阅:Message Filter Object Structure

fileStrategy

  • 选项: "local" | "firebase" | "s3" | "azure_blob" | "cloudfront"
KeyTypeDescriptionExample
fileStrategyString确定用户上传/生成文件的保存位置。如果省略,默认为 `"local"`。fileStrategy: "firebase"
  • 注意:
    • "cloudfront" 将文件存储在 S3 中,并返回 CloudFront URL 以实现稳定的媒体分发、签名 Cookie 和签名下载。
    • "firebase" 通过 Firebase Storage 和 Firebase Hosting 边缘节点提供文件服务。
    • S3 通过会过期的 预签名 URL(临时签名令牌)提供文件服务。一旦过期,UI 中任何引用该 URL 的图像或头像都将显示为损坏。这使得 S3 不适合作为视觉资产的主要存储策略。详情请参阅 相关讨论
    • 为了获得最佳的图像和头像性能,请使用 "cloudfront""firebase",或者配置 fileStrategies 以将 avatarimage 路由到由 CDN 支持的策略。
    • 请参阅 File Storage & CDN documentation 以获取设置详情。

fileStrategies

允许对不同文件类型的文件存储策略进行细粒度控制。

  • 可用策略: "local" | "firebase" | "s3" | "azure_blob" | "cloudfront"
KeyTypeDescriptionExample
fileStrategiesObject为不同文件类型配置不同的存储策略。比单一的 fileStrategy 选项更灵活。

子键:

KeyTypeDescriptionExample
defaultString当未定义特定类型时的回退存储策略。默认为 "local"。
avatarString用户和智能体头像图片的存储策略。建议使用 CDN 支持的策略(`"cloudfront"` 或 `"firebase"`)以获得最佳性能。
imageString聊天中上传图片的存储策略。建议使用支持 CDN 的策略(`"cloudfront"` 或 `"firebase"`)以获得最佳性能。
documentString文档上传(PDF、文本文件等)的存储策略。
skillsString与 Skills 绑定的文件的存储策略。
  • 注意:
    • 此设置的优先级高于单个 fileStrategy 选项
    • 如果未配置特定的文件类型,它将回退到 default,然后是 fileStrategy,最后是 "local"
    • 图像和头像需要持久、稳定的 URL 才能在 UI 中正确渲染。S3 预签名 URL 会过期(AWS 上限:IAM 用户为 7 天,基于 STS/角色的凭证为数小时),这会导致模型选择器和聊天 UI 中的图像无法显示。请参阅相关讨论以了解完整背景。请为 avatarimage 使用 "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 local

cloudfront

密钥:

KeyTypeDescriptionExample
cloudfrontObject配置用于 S3 存储文件的 CloudFront 分发。

子键 (Subkeys):

KeyTypeDescriptionExample
domainStringCloudFront 分发域名或 CNAME。当任何文件策略使用 `"cloudfront"` 时为必填项。domain: "https://cdn.example.com"
distributionIdStringCloudFront 分发 ID。当 `invalidateOnDelete` 为 true 时必填。distributionId: "E1234ABCD"
invalidateOnDeleteBoolean为已删除的文件创建 CloudFront 失效请求。默认值:false。invalidateOnDelete: false
imageSigningString控制内联图像/头像的访问。选项:`"none"` 或 `"cookies"`。`"url"` 为保留选项,目前未针对图像实现。imageSigning: "cookies"
cookieDomainString签名 Cookie 需要共享父级 Cookie 域。必须以点号开头。cookieDomain: ".example.com"
cookieExpiryNumber签名 cookie 的有效期(以秒为单位)。默认值:1800,最大值:604800。cookieExpiry: 1800
urlExpiryNumberCloudFront 签名下载 URL 的有效期(秒)。默认值:3600。urlExpiry: 3600
storageRegionString当启用区域路径时,用于生成对象键的可选区域标签。storageRegion: "us-east-2"
includeRegionInPathBoolean在新建的对象键中包含存储区域。默认值:false。includeRegionInPath: false
requireSignedAccessBoolean当无法初始化签名 cookie CloudFront 访问时拒绝启动。默认值:false。requireSignedAccess: true

请参阅:CloudFront 对象结构配合 S3 使用 CloudFront

filteredTools

KeyTypeDescriptionExample
filteredToolsArray of Strings从 Plugins 和 OpenAI Assistants endpoint 中过滤掉特定的工具。filteredTools: ["scholarai", "calculator"]
  • 注意:
    • 如果同时指定了 includedToolsfilteredTools,则仅会识别 includedTools
    • 同时影响 gptPluginsassistants endpoint
    • 你可以在 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

KeyTypeDescriptionExample
includedToolsArray of Strings包含来自 Plugins 和 OpenAI Assistants endpoint 的特定工具。includedTools: ["calculator"]
  • 注意:
    • 如果同时指定了 includedToolsfilteredTools,则仅会识别 includedTools
    • 同时影响 gptPluginsassistants endpoint
    • 你可以在 api/app/clients/tools/manifest.json 中找到用于过滤的工具名称。
      • 使用 pluginKey
    • Also, any listed under the ".well-known" directory api/app/clients/tools/.well-known
      • 使用 name_for_model
KeyTypeDescriptionExample
secureImageLinksBoolean是否对应用本地托管的图片链接访问进行安全保护。默认值:false。secureImageLinks: true

imageOutputType

  • 注意:区分大小写。Google endpoint 仅支持 “jpeg” 和 “png” 输出类型。
  • 选项: "png" | "webp" | "jpeg"
KeyTypeDescriptionExample
imageOutputTypeString图像响应的图像输出类型。如果省略,默认为 "png"。imageOutputType: "webp"

ocr

密钥:

KeyTypeDescriptionExample
ocrObject配置用于从图像中提取文本的光学字符识别 (OCR) 设置。

子键 (Subkeys):

KeyTypeDescriptionExample
apiKeyStringOCR 服务的 API key。
baseURLStringOCR 服务 API 的基础 URL。
strategyString要使用的 OCR 策略。选项包括 "mistral_ocr"、"azure_mistral_ocr"、"vertexai_mistral_ocr"、"document_parser" 或 "custom_ocr"。
mistralModelString用于 OCR 处理的 Mistral 模型。

请参阅:OCR 配置对象结构

webSearch

密钥:

KeyTypeDescriptionExample
webSearchObject配置网页搜索功能,包括搜索提供商、内容抓取工具和结果重排序器。

子键 (Subkeys):

KeyTypeDescriptionExample
serperApiKeyStringSerper API 密钥的环境变量名称。如果未在 .env 中设置,系统将提示用户通过 UI 提供。
searxngInstanceUrlStringSearXNG 实例 URL 的环境变量名称。如果未在 .env 中设置,系统将提示用户通过 UI 提供。
searxngApiKeyStringSearXNG API 密钥的环境变量名称。如果未在 .env 中设置,系统将提示用户通过 UI 提供。
tavilyApiKeyStringTavily API 密钥的环境变量名称。同时用于搜索和抓取。如果未在 .env 中设置,系统将提示用户通过 UI 提供。
tavilySearchUrlString用于自定义 Tavily Search API URL 的环境变量名称。可选;未设置时默认为 Tavily 托管搜索。
tavilyExtractUrlString用于自定义 Tavily Extract API URL 的环境变量名称。可选;未设置时默认为 Tavily 托管的 extract。
firecrawlApiKeyStringFirecrawl API 密钥的环境变量名称。如果未在 .env 中设置,系统将提示用户通过 UI 提供。
firecrawlApiUrlStringFirecrawl API URL 的环境变量名称。如果未在 .env 中设置,系统将提示用户通过 UI 提供。
jinaApiKeyStringJina API 密钥的环境变量名称。如果未在 .env 中设置,系统将提示用户通过 UI 提供。
cohereApiKeyStringCohere API 密钥的环境变量名称。如果未在 .env 中设置,系统将提示用户通过 UI 提供。
searchProviderString指定要使用的搜索提供程序。选项:"serper", "searxng", "tavily"。
scraperProviderString指定要使用的抓取服务。选项:"firecrawl", "serper", "tavily"。
firecrawlVersionString指定 Firecrawl API 版本(v0 或 v1)。
rerankerTypeString指定要使用的重排序(reranker)服务。设置为 "none" 以跳过重排序。选项包括:"jina"、"cohere"、"none"。
scraperTimeoutInteger爬虫请求的超时时间(以毫秒为单位)。必须是非负整数。
safeSearchNumber安全搜索过滤级别。0 = 关闭,1 = 中等(默认),2 = 严格。

请参阅:Web Search Object Structure

fileConfig

密钥:

KeyTypeDescriptionExample
fileConfigObject配置应用程序的文件处理设置,包括大小限制和 MIME 类型限制。

子键 (Subkeys):

KeyTypeDescriptionExample
endpointsRecord/Object为各个 endpoint 指定文件处理配置,允许按 endpoint 进行自定义。
serverFileSizeLimitNumber服务器将接受的最大文件大小(以 MB 为单位)。除非被特定 endpoint 的设置覆盖,否则全局适用于所有 endpoint。
avatarSizeLimitNumber用户头像图片的最大尺寸(以 MB 为单位)。
clientImageResizeObject配置客户端图像缩放,以优化文件上传并防止因图像过大导致的上传错误。
ocrObject用于光学字符识别 (OCR) 文件处理的设置。
textObject直接文本文件解析的设置。
sttObject用于语音转文字 (STT) 音频文件处理的设置。
fileTokenLimitNumber在截断前包含在提示词中的文本文件最大 Token 数。fileTokenLimit: 100000

clientImageResize

密钥:

KeyTypeDescriptionExample
clientImageResizeObject配置客户端图像缩放,以优化文件上传并防止因图像过大导致的上传错误。

子键 (Subkeys):

KeyTypeDescriptionExample
enabledBoolean启用或禁用客户端图像调整大小功能。默认值:false。enabled: true
maxWidthNumber调整后图像的最大宽度(以像素为单位)。超过此宽度的图像将被调整大小。默认值:1920。maxWidth: 1024
maxHeightNumber调整大小后的图像最大高度(像素)。超过此高度的图像将被调整大小。默认值:1080。maxHeight: 768
qualityNumberJPEG 压缩质量(0.1 到 1.0)。数值越高,质量越好,但文件体积越大。默认值:0.8。quality: 0.9
compressFormatString压缩图像的输出格式。选项:"jpeg", "webp"。默认:"jpeg"。compressFormat: "webp"

描述:

clientImageResize 配置支持在上传前自动进行客户端图像缩放。此功能有助于:

  • 防止上传失败,避免因图片文件过大而超出服务器限制
  • 减少带宽使用,通过在传输前压缩图像
  • 提升上传性能,减小文件大小
  • 保持图像质量的同时优化文件大小

启用后,超过指定 maxWidthmaxHeight 尺寸的图像会在上传到服务器之前在客户端自动调整大小。调整大小时会保持原始宽高比,同时确保图像符合指定的边界。

示例:

fileConfig:
  clientImageResize:
    enabled: true
    maxWidth: 1920
    maxHeight: 1080
    quality: 0.8
    compressFormat: 'jpeg'

注意:

  • 仅适用于图像文件(JPEG、PNG、WebP 等)
  • 当图片超过指定尺寸时,会自动进行调整大小。
  • 调整大小时保留原始宽高比
  • 此功能适用于所有受支持的图像上传 endpoint。
  • 质量设置仅适用于 JPEG 和 WebP 格式
  • 将质量设置得过低(< 0.5)可能会导致明显的图像质量下降

请参阅:文件配置对象结构

rateLimits

密钥:

KeyTypeDescriptionExample
rateLimitsObject定义速率限制策略,通过限制请求数量来防止滥用。

子键 (Subkeys):

KeyTypeDescriptionExample
fileUploadsObject专门为文件上传操作配置速率限制。
conversationsImportObject专门为对话导入操作配置速率限制。
sttObject专门为语音转文字 (stt) 请求配置速率限制
ttsObject专门为文本转语音 (tts) 请求配置速率限制

fileUploads 子键:

KeyTypeDescriptionExample
ipMaxNumber每个 IP 地址在每个时间窗口内允许的最大上传次数。
ipWindowInMinutesNumber基于 IP 的上传限制的时间窗口(以分钟为单位)。
userMaxNumber每个用户在每个时间窗口内允许上传的最大数量。
userWindowInMinutesNumber基于用户的上传限制的时间窗口(以分钟为单位)。

conversationsImport 子键:

KeyTypeDescriptionExample
ipMaxNumber每个 IP 地址在每个时间窗口内允许的最大导入次数。
ipWindowInMinutesNumber基于 IP 的导入限制的时间窗口(以分钟为单位)。
userMaxNumber每个用户在每个窗口中的最大导入次数。
userWindowInMinutesNumber基于用户的导入限制的时间窗口(以分钟为单位)。

tts 子键:

KeyTypeDescriptionExample
ipMaxNumber每个 IP 地址在每个时间窗口内允许的最大请求数。
ipWindowInMinutesNumber基于 IP 的请求限制的时间窗口(以分钟为单位)。
userMaxNumber每个用户在每个时间窗口内的最大请求数。
userWindowInMinutesNumber基于用户的请求限制的时间窗口(以分钟为单位)。

stt 子键:

KeyTypeDescriptionExample
ipMaxNumber每个 IP 地址在每个时间窗口内允许的最大请求数。
ipWindowInMinutesNumber基于 IP 的请求限制的时间窗口(以分钟为单位)。
userMaxNumber每个用户在每个时间窗口内的最大请求数。
userWindowInMinutesNumber基于用户的请求限制的时间窗口(以分钟为单位)。
  • 示例:
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: 1

registration

密钥:

KeyTypeDescriptionExample
registrationObject配置应用程序的注册相关设置。

子键 (Subkeys):

KeyTypeDescriptionExample
socialLogins社交登录配置。
allowedDomains指定允许注册的域名。

另请参阅:

memory

密钥:

KeyTypeDescriptionExample
memoryObject配置应用程序的对话记忆和个性化功能。

子键 (Subkeys):

KeyTypeDescriptionExample
disabledBoolean设置为 true 时禁用记忆功能。
validKeysArray of Strings指定哪些键对于内存存储是有效的。
tokenLimitNumber设置用于内存存储和处理的最大令牌数。
charLimitNumber设置内存存储的最大字符数。默认值:10000。
maxInputTokensNumber限制在提取前发送给自动记忆代理的最近聊天 token 数量。默认值:12000。
personalizeBoolean启用或禁用个性化功能。
messageWindowSizeNumber指定包含在记忆上下文中的最近消息数量。
agentObject | Union配置负责记忆处理的智能体。

请参阅:Memory Object Structure

summarization

密钥:

KeyTypeDescriptionExample
summarizationObject配置对话摘要和上下文修剪。取代了每个 endpoint 中的 `summarize` 和 `summaryModel` 字段。

子键 (Subkeys):

KeyTypeDescriptionExample
providerString用于摘要调用的 LLM 提供商。默认为智能体自身的提供商。
modelString用于摘要调用的模型。默认为智能体自身的模型。
parametersObject用于摘要请求的额外 LLM 参数。
promptString用于初始摘要的自定义提示词。
updatePromptString当存在先前的摘要时,用于重新压缩的自定义提示词。
triggerObject定义触发摘要的时机(按 Token 比例、剩余 Token 数或消息数量)。
maxSummaryTokensNumber用于总结模型响应的最大输出 token 数。
reserveRatioNumber保留作为余量的 Token 配额比例 (0–1)。默认值:0.05。
contextPruningObject配置针对旧消息基于位置的工具结果降级。

请参阅:Summarization Object Structure

actions

密钥:

KeyTypeDescriptionExample
actionsObject配置与操作相关的设置,供 Agents 和 Assistants 使用

子键 (Subkeys):

KeyTypeDescriptionExample
allowedDomainsArray of Strings用于 Actions 的严格域名白名单。设置后,仅可访问所列域名。
allowedAddressesArray of StringsSSRF 免除列表(仅限私有 IP 空间)。在未配置 `allowedDomains` 时,允许特定的私有 host:port 服务,而不限制公共目标。

另请参阅:

interface

密钥:

KeyTypeDescriptionExample
interfaceObject配置应用程序内的用户界面元素,允许自定义各种组件的可见性和行为。

子键 (Subkeys):

KeyTypeDescriptionExample
privacyPolicyObject包含与所提供的隐私政策链接相关的设置。
termsOfServiceObject包含与所提供的服务条款链接相关的设置。
modelSelectBoolean确定模型选择功能是否可用。
parametersBoolean切换参数配置选项(即对话设置)的可见性。
presetsBoolean启用或禁用预设菜单
promptsBoolean or Object启用或禁用所有用户的所有提示词相关功能
bookmarksBoolean启用或禁用所有用户的所有书签相关功能
memoriesBoolean启用或禁用所有用户的记忆功能
multiConvoBoolean启用或禁用所有用户的所有“多重对话”(即多重响应流)相关功能
agentsBoolean or Object启用或禁用所有用户的全部智能体功能
temporaryChatBoolean启用或禁用临时聊天功能
temporaryChatRetentionNumber配置临时聊天的保留时长(以小时为单位)。最小值为 1,最大值为 8760。默认值为 720(30 天)。
autoSubmitFromUrlBoolean控制 `/c/new?prompt=…&submit=true` 是否自动提交给模型。当设为 `false` 时,提示词会被预填但不会自动提交。
mcpServersObject包含与 MCP 服务器选择和访问控制相关的设置。
customWelcomeString在聊天界面中显示的自定义欢迎消息。
runCodeBoolean启用或禁用 Markdown 代码块的“运行代码”按钮
webSearchBoolean启用或禁用聊天界面中的网页搜索按钮
fileSearchBoolean启用或禁用聊天界面中的文件搜索按钮
fileCitationsBoolean全局启用或禁用所有用户的文件引用功能
peoplePickerObject配置在人员选择器界面中可用的主体类型控件
marketplaceObject启用或禁用对 Agent Marketplace 的访问

请参阅:Interface Object Structure

modelSpecs

密钥:

KeyTypeDescriptionExample
modelSpecsObject配置 Model Specs,允许对应用程序内的 AI 模型及其行为进行详细设置和自定义。

子键 (Subkeys):

KeyTypeDescriptionExample
enforceBoolean确定模型规范是否应严格覆盖其他配置设置。
prioritizeBoolean指定当 Model Specs 和默认配置同时适用时,是否应优先使用 Model Specs。
listArray of Objects包含一系列详细说明各种配置和行为的独立 Model Specs 列表。

请参阅:Model Specs 对象结构

endpoints

密钥:

KeyTypeDescriptionExample
endpointsObject定义应用程序的自定义 API endpoint。

子键 (Subkeys):

KeyTypeDescriptionExample
customArray of Objects数组中的每个对象都代表一个唯一的 endpoint 配置。
azureOpenAIObjectAzure OpenAI endpoint-specific configuration
assistantsObjectAssistants endpoint 特定配置。
azureAssistantsObjectAzure Assistants 端点特定配置。
agentsObjectAgents 端点特定配置。
allObject适用于所有 endpoint 的全局 endpoint 设置。请参阅 Shared Endpoint Settings。
allowedAddressesArray of StringsSSRF 免除列表(仅限私有 IP 空间)。允许用户提供的 baseURL 指向特定的私有 host:port 服务(例如自托管的 Ollama),而无需禁用其他所有内容的 SSRF 保护。

注意: 端点支持 Shared Endpoint Settings,例如 streamRateheaderstitleModeltitleMethodtitlePrompttitlePromptTemplatetitleEndpointmaxToolResultChars。这些设置可以针对每个端点单独配置,也可以使用 all 键进行全局配置。headers 会进行合并,当键冲突时,端点级别的设置值优先。all 键不支持 baseURL

注意: endpoints.allowedAddresses 适用于用户提供的 baseURL 值(当管理员配置了 apiKey: 'user_provided'baseURL: 'user_provided' 的自定义 endpoint 时)。每个用户提供的 baseURL 都会在请求时根据 SSRF 拦截规则进行验证;此处列出的条目将被豁免。有关字段语义,请参阅 mcpSettings.allowedAddresses —— 适用相同的规则(仅限私有 IP 空间、必须包含端口、不支持 URL/路径/CIDR/裸主机名/公网 IP 字面量)。

mcpSettings

密钥:

KeyTypeDescriptionExample
mcpSettingsObject定义 Model Context Protocol (MCP) 服务器的全局设置

子键 (Subkeys):

KeyTypeDescriptionExample
allowedDomainsArray of StringsMCP 服务器连接的严格域名白名单。设置后,仅允许访问列表中的条目。
allowedAddressesArray of StringsSSRF 免除列表(仅限私有 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

密钥:

KeyTypeDescriptionExample
mcpServersObject定义 Model Context Protocol (MCP) 服务器的配置,允许在应用程序中动态集成 MCP 服务器。

子键 (Subkeys):

KeyTypeDescriptionExample
<serverName>Object`mcpServers` 下的每个键都代表一个独立的 MCP 服务器配置,并由一个唯一的名称标识。
  • 注意:
    • 初始化在启动时进行,必须重启应用才能使更改生效。
    • <serverName> 是每个 MCP 服务器配置的唯一标识符。
    • 每个 MCP server 都可以使用四种连接类型之一进行配置:
      • stdio
      • websocket
      • sse
      • streamable-http
    • type 字段指定了连接到 MCP server 的连接类型。
    • 如果省略 type,它将根据 urlcommand 的存在与否及其格式进行默认设置:
      • 如果指定了 url 且以 httphttps 开头,则 type 默认为 sse
      • 如果指定了 url 且以 wswss 开头,则 type 默认为 websocket
      • 如果指定了 commandtype 将默认为 stdio
    • 其他配置选项包括:
      • timeout: MCP 服务器请求的超时时间(以毫秒为单位)。决定了等待工具请求响应的时长。
      • initTimeout: MCP 服务器初始化的超时时间(以毫秒为单位)。决定了等待服务器初始化的时长。
      • serverInstructions: 控制是否将服务器指令包含在 Agent 上下文中。可以是 true(使用服务器提供的指令)、false(禁用)或自定义字符串(覆盖服务器提供的指令)。
      • customUserVars: (可选)定义用户可以为 MCP 服务器设置的自定义变量(例如 API 密钥、URL)。这些通过 UI 提供的用户专属值,随后可以在服务器的 headersenv 配置中使用 {{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

密钥:

KeyTypeDescriptionExample
speechObject配置应用程序的文本转语音 (TTS) 和语音转文本 (STT) 提供商。

子键 (Subkeys):

KeyTypeDescriptionExample
ttsObjectText-to-Speech 提供商配置 (OpenAI, Azure OpenAI, ElevenLabs, LocalAI)。
sttObjectSpeech-to-Text 提供商配置 (OpenAI, Azure OpenAI)。
speechTabObject语音功能的默认 UI 设置。

请参阅:Speech Object Structure

turnstile

密钥:

KeyTypeDescriptionExample
turnstileObject为注册和登录表单配置 Cloudflare Turnstile 以实现机器人防护。

子键 (Subkeys):

KeyTypeDescriptionExample
siteKeyString您的 Cloudflare Turnstile 站点密钥(必填)。
optionsObject其他 Turnstile 小部件选项(可选)。

请参阅:Turnstile 对象结构

transactions

密钥:

KeyTypeDescriptionExample
transactionsObject控制事务日志记录和可见性功能。

子键 (Subkeys):

KeyTypeDescriptionExample
enabledBoolean启用或禁用事务日志记录。默认值:true。

请参阅:Transactions Object Structure

这篇指南怎么样?