From 15c13a4b2f73e4337987ce3c18843eb7f25f8dd9 Mon Sep 17 00:00:00 2001 From: Federico Ruggi Date: Wed, 8 Oct 2025 10:44:11 +0200 Subject: [PATCH 1/4] add oauth headers sections --- .../object_structure/mcp_servers.mdx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx b/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx index 28cef5aa7..d596282c6 100644 --- a/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx +++ b/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx @@ -90,6 +90,7 @@ mcpServers: ['stderr', 'String or Stream or Number', '(Optional, `stdio` type only) How to handle `stderr` of the child process. Defaults to `"inherit"`.', 'stderr: "inherit"'], ['customUserVars', 'Object', '(Optional) Defines custom variables that users can set for this MCP server, allowing for per-user credentials or configurations (e.g., API keys). These variables can then be referenced in `headers` or `env` fields.', 'customUserVars:\n API_KEY:\n title: "API Key"\n description: "Your personal API key."'], ['oauth', 'Object', '(Optional) OAuth2 configuration for authenticating with the MCP server. When configured, users will be prompted to authenticate via OAuth flow.', 'oauth:\n authorization_url: "https://example.com/oauth/authorize"\n token_url: "https://example.com/oauth/token"'], + ['oauth_headers', 'Object', '(Optional) Map of header names and values to be used for OAuth requests (e.g., when registering a new client). Each key-value pair represents a header name and its corresponding value.', 'oauth_headers:\n X-Custom-Header-1: "custom_value_1"\n X-Custom-Header-2: "custom_value_2"'], ['startup', 'Boolean', '(Optional) When set to false, this MCP server will not be connected at application startup.', 'startup: false'], ]} /> @@ -306,6 +307,17 @@ mcpServers: code_challenge_methods_supported: ["S256", "plain"] ``` +#### `oauth_headers` + +- **Type:** Object (Optional) +- **Description:** Map of header names and values to be used for OAuth requests (e.g., when registering a new client). Each key-value pair represents a header name and its corresponding value. This is useful when OAuth providers require specific headers for client registration or token requests. +- **Example:** + ```yaml + oauth_headers: + X-Custom-Header-1: "custom_value_1" + X-Custom-Header-2: "custom_value_2" + ``` + #### `startup` - **Type:** Boolean (Optional) @@ -438,6 +450,8 @@ oauth-api-server: client_secret: your_client_secret redirect_uri: http://localhost:3080/oauth/callback scope: "read execute" + oauth_headers: + X-Custom-Header: "custom_value" ``` ### MCP Server with Server Instructions From 940fb4f827ef247eadcc1b73120ae90fd2a103d1 Mon Sep 17 00:00:00 2001 From: Federico Ruggi Date: Thu, 9 Oct 2025 17:51:13 +0200 Subject: [PATCH 2/4] update copy --- .../librechat_yaml/object_structure/mcp_servers.mdx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx b/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx index d596282c6..b8b90c0d9 100644 --- a/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx +++ b/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx @@ -310,12 +310,19 @@ mcpServers: #### `oauth_headers` - **Type:** Object (Optional) -- **Description:** Map of header names and values to be used for OAuth requests (e.g., when registering a new client). Each key-value pair represents a header name and its corresponding value. This is useful when OAuth providers require specific headers for client registration or token requests. +- **Description:** Headers specifically for OAuth-related requests, such as client registration (Dynamic Client Registration/DCR) and token exchange. These headers are sent during the OAuth authentication flow, not during regular MCP server communication. +- **Common Use Cases:** + - Adding authentication to DCR endpoints (e.g., `Authorization: Bearer ${DCR_API_KEY}`) + - Including custom provider-specific headers required for OAuth flows + - Setting content-type or other headers needed for OAuth token endpoints +- **Key Differences from `headers`:** + - **`headers`**: Used for regular MCP server requests (tool calls, server communication) after authentication is complete + - **`oauth_headers`**: Used exclusively during OAuth authentication flows (client registration, token requests) - **Example:** ```yaml oauth_headers: - X-Custom-Header-1: "custom_value_1" - X-Custom-Header-2: "custom_value_2" + Authorization: "Bearer ${DCR_API_KEY}" + X-Custom-Header: "custom_value" ``` #### `startup` From ae7f41e53bcbaee96c042bb3430090e2b33e5388 Mon Sep 17 00:00:00 2001 From: Federico Ruggi Date: Thu, 9 Oct 2025 18:03:21 +0200 Subject: [PATCH 3/4] tweak copy for clarity --- .../librechat_yaml/object_structure/mcp_servers.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx b/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx index b8b90c0d9..3b0e85a71 100644 --- a/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx +++ b/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx @@ -310,7 +310,7 @@ mcpServers: #### `oauth_headers` - **Type:** Object (Optional) -- **Description:** Headers specifically for OAuth-related requests, such as client registration (Dynamic Client Registration/DCR) and token exchange. These headers are sent during the OAuth authentication flow, not during regular MCP server communication. +- **Description:** Headers specifically for OAuth flow requests. These headers are **only** used during the OAuth authentication flow (client registration, token exchange, etc.) and **not** during regular MCP server communication - **Common Use Cases:** - Adding authentication to DCR endpoints (e.g., `Authorization: Bearer ${DCR_API_KEY}`) - Including custom provider-specific headers required for OAuth flows From 5638de067926b44f519d063a94b156920f692e3d Mon Sep 17 00:00:00 2001 From: Federico Ruggi Date: Thu, 9 Oct 2025 18:04:14 +0200 Subject: [PATCH 4/4] add trailing period --- .../librechat_yaml/object_structure/mcp_servers.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx b/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx index 3b0e85a71..20c78d018 100644 --- a/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx +++ b/pages/docs/configuration/librechat_yaml/object_structure/mcp_servers.mdx @@ -310,7 +310,7 @@ mcpServers: #### `oauth_headers` - **Type:** Object (Optional) -- **Description:** Headers specifically for OAuth flow requests. These headers are **only** used during the OAuth authentication flow (client registration, token exchange, etc.) and **not** during regular MCP server communication +- **Description:** Headers specifically for OAuth flow requests. These headers are **only** used during the OAuth authentication flow (client registration, token exchange, etc.) and **not** during regular MCP server communication. - **Common Use Cases:** - Adding authentication to DCR endpoints (e.g., `Authorization: Bearer ${DCR_API_KEY}`) - Including custom provider-specific headers required for OAuth flows