LibreChat/api/server/services
Danny Avila d7d02766ea
🏷️ feat: Request Placeholders for Custom Endpoint & MCP Headers (#9095)
* feat: Add conversation ID support to custom endpoint headers

- Add LIBRECHAT_CONVERSATION_ID to customUserVars when provided
- Pass conversation ID to header resolution for dynamic headers
- Add comprehensive test coverage

Enables custom endpoints to access conversation context using {{LIBRECHAT_CONVERSATION_ID}} placeholder.

* fix: filter out unresolved placeholders from headers (thanks @MrunmayS)

* feat: add support for request body placeholders in custom endpoint headers

- Add {{LIBRECHAT_BODY_*}} placeholders for conversationId, parentMessageId, messageId
- Update tests to reflect new body placeholder functionality

* refactor resolveHeaders

* style: minor styling cleanup

* fix: type error in unit test

* feat: add body to other endpoints

* feat: add body for mcp tool calls

* chore: remove changes that unnecessarily increase scope after clarification of requirements

* refactor: move http.ts to packages/api and have RequestBody intersect with Express request body

* refactor: processMCPEnv now uses single object argument pattern

* refactor: update processMCPEnv to use 'options' parameter and align types across MCP connection classes

* feat: enhance MCP connection handling with dynamic request headers to pass request body fields

---------

Co-authored-by: Gopal Sharma <gopalsharma@gopal.sharma1>
Co-authored-by: s10gopal <36487439+s10gopal@users.noreply.github.com>
Co-authored-by: Dustin Healy <dustinhealy1@gmail.com>
2025-08-16 20:45:55 -04:00
..
Artifacts 🧪 fix: Editor Styling, Incomplete Artifact Editing, Optimize Artifact Context (#8953) 2025-08-08 15:49:58 -04:00
Config 🧑‍💼 feat: Add Agent Model Validation (#8995) 2025-08-11 14:26:28 -04:00
Endpoints 🏷️ feat: Request Placeholders for Custom Endpoint & MCP Headers (#9095) 2025-08-16 20:45:55 -04:00
Files 🛂 feat: Role as Permission Principal Type 2025-08-13 16:24:23 -04:00
Runs 📑 docs: Fix Typos in JSDoc and Doc Files (#8998) 2025-08-12 10:18:55 -04:00
start 🔎 feat: Add Prompt and Agent Permissions Migration Checks (#9063) 2025-08-14 17:20:00 -04:00
Threads 🔧 fix: Assistants API SDK calls to match Updated Arguments (#8818) 2025-08-02 12:19:58 -04:00
Tools 🔎 feat: Native Web Search with Citation References (#7516) 2025-05-23 17:40:40 -04:00
ActionService.js 🪐 feat: MCP OAuth 2.0 Discovery Support (#7924) 2025-06-17 13:50:33 -04:00
ActionService.spec.js 🤖 refactor: Improve Agents Memory Usage, Bump Keyv, Grok 3 (#6850) 2025-04-12 18:46:36 -04:00
AppService.interface.spec.js 🗞️ refactor: Apply Role Permissions at Startup only if Missing or Configured 2025-08-13 16:24:25 -04:00
AppService.js 🔎 feat: Add Prompt and Agent Permissions Migration Checks (#9063) 2025-08-14 17:20:00 -04:00
AppService.spec.js 🎏 refactor: Streamline Role Permissions from Interface Config 2025-08-14 02:15:33 -04:00
AssistantService.js 🔧 fix: Assistants API SDK calls to match Updated Arguments (#8818) 2025-08-02 12:19:58 -04:00
AuthService.js 🐛 fix: RAG API failing with OPENID_REUSE_TOKENS Enabled (#8090) 2025-06-26 19:10:21 -04:00
cleanup.js 🧹 fix: Resolve Unarchive Conversation Bug, Archive Pagination (#4189) 2024-09-22 17:21:50 -04:00
createRunBody.js feat: Add Current Datetime to Assistants (v1/v2) (#4952) 2024-12-11 15:26:18 -05:00
domains.js 🔐 feat: Implement Allowed Action Domains (#4964) 2024-12-12 12:52:42 -05:00
domains.spec.js 🔐 feat: Implement Allowed Action Domains (#4964) 2024-12-12 12:52:42 -05:00
GraphApiService.js 🔐 feat: Granular Role-based Permissions + Entra ID Group Discovery (#7804) 2025-08-13 16:24:17 -04:00
GraphApiService.spec.js 🔐 feat: Granular Role-based Permissions + Entra ID Group Discovery (#7804) 2025-08-13 16:24:17 -04:00
GraphTokenService.js 📁 feat: Integrate SharePoint File Picker and Download Workflow (#8651) 2025-08-13 16:24:16 -04:00
initializeMCPs.js 🚌 fix: MCP Runtime Errors while Initializing (#9046) 2025-08-13 14:41:38 -04:00
MCP.js 🏷️ feat: Request Placeholders for Custom Endpoint & MCP Headers (#9095) 2025-08-16 20:45:55 -04:00
MCP.spec.js 🏹 feat: Concurrent MCP Initialization Support (#8677) 2025-07-28 12:25:34 -04:00
ModelService.js 👁️ feat: Azure Mistral OCR Strategy (#7888) 2025-06-13 15:14:57 -04:00
ModelService.spec.js 👁️ feat: Azure Mistral OCR Strategy (#7888) 2025-06-13 15:14:57 -04:00
PermissionService.js 🛂 feat: Role as Permission Principal Type 2025-08-13 16:24:23 -04:00
PermissionService.spec.js 🛂 feat: Role as Permission Principal Type 2025-08-13 16:24:23 -04:00
PluginService.js 🔌 feat: MCP Reinitialization and OAuth in UI (#8598) 2025-07-22 22:52:45 -04:00
ToolService.js 📚 feat: Add Source Citations for File Search in Agents (#8652) 2025-08-13 16:24:16 -04:00
twoFactorService.js 🪐 feat: MCP OAuth 2.0 Discovery Support (#7924) 2025-06-17 13:50:33 -04:00
UserService.js 🪐 feat: MCP OAuth 2.0 Discovery Support (#7924) 2025-06-17 13:50:33 -04:00