LibreChat/api/server/services/Endpoints
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
..
agents 🧑‍💼 feat: Add Agent Model Validation (#8995) 2025-08-11 14:26:28 -04:00
anthropic 🧪 feat: Claude Sonnet 4 - 1M Context Window (Beta Header) (#9093) 2025-08-16 13:36:46 -04:00
assistants 🔧 fix: Assistants API SDK calls to match Updated Arguments (#8818) 2025-08-02 12:19:58 -04:00
azureAssistants 🏷️ feat: Request Placeholders for Custom Endpoint & MCP Headers (#9095) 2025-08-16 20:45:55 -04:00
bedrock 🧠 fix: Agent Title Config & Resource Handling (#8028) 2025-06-23 19:44:24 -04:00
custom 🏷️ feat: Request Placeholders for Custom Endpoint & MCP Headers (#9095) 2025-08-16 20:45:55 -04:00
google 🗝️ refactor: loadServiceKey to Support Stringified JSON and Env Var Renaming (#8317) 2025-07-08 21:07:33 -04:00
openAI 🏷️ feat: Request Placeholders for Custom Endpoint & MCP Headers (#9095) 2025-08-16 20:45:55 -04:00
index.js 🆕 feat: Enhanced Title Generation Config Options (#8580) 2025-07-21 17:37:37 -04:00