LibreChat/api
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
..
app 🏷️ feat: Request Placeholders for Custom Endpoint & MCP Headers (#9095) 2025-08-16 20:45:55 -04:00
cache 🌐 feat: Configurable Redis Cluster Mode with Single URI Support (#9039) 2025-08-16 14:41:53 -04:00
config ♻️ refactor: MCPManager for Scalability, Fix App-Level Detection, Add Lazy Connections (#8930) 2025-08-13 11:45:06 -04:00
db 🍃 feat: Add MongoDB Connection Pool Configuration Options (#8537) 2025-08-13 16:24:17 -04:00
lib/utils 🏗️ refactor: Extract DB layers to data-schemas for shared use (#7650) 2025-05-30 22:18:13 -04:00
models 🗨️ refactor: Optimize Prompt Queries 2025-08-13 16:24:25 -04:00
server 🏷️ feat: Request Placeholders for Custom Endpoint & MCP Headers (#9095) 2025-08-16 20:45:55 -04:00
strategies 🛠️ fix: Workaround for Federated OpenID Nonce Validation Issues (#9067) 2025-08-16 13:14:01 -04:00
test 🔗 fix: File Citation Processing to Use Tool Artifacts 2025-08-13 16:24:21 -04:00
utils 🧪 feat: Claude Sonnet 4 - 1M Context Window (Beta Header) (#9093) 2025-08-16 13:36:46 -04:00
jest.config.js 🏪 feat: Agent Marketplace 2025-08-13 16:24:18 -04:00
jsconfig.json feat(api): initial Redis support; fix(SearchBar): proper debounce (#1039) 2023-10-11 17:05:47 -04:00
package.json 🪙 refactor: Remove Title maxTokens & Support New LMStudio/Ollama Reasoning Format (#9085) 2025-08-15 15:29:16 -04:00
typedefs.js 🗞️ refactor: Apply Role Permissions at Startup only if Missing or Configured 2025-08-13 16:24:25 -04:00