mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 02:40:14 +01:00
🔖 fix: Custom Headers for Initial MCP SSE Connection (#7246)
* refactor: add custom to as workaround to include custom headers to the initial connection request * chore: bump MCP client version to 1.2.1 in package-lock and package.json for librechat-mcp
This commit is contained in:
parent
4fbb81c774
commit
7c92cef2b7
3 changed files with 12 additions and 3 deletions
|
|
@ -68,7 +68,7 @@ export class MCPConnection extends EventEmitter {
|
|||
this.client = new Client(
|
||||
{
|
||||
name: 'librechat-mcp-client',
|
||||
version: '1.2.0',
|
||||
version: '1.2.1',
|
||||
},
|
||||
{
|
||||
capabilities: {},
|
||||
|
|
@ -159,6 +159,15 @@ export class MCPConnection extends EventEmitter {
|
|||
headers: options.headers,
|
||||
signal: abortController.signal,
|
||||
},
|
||||
eventSourceInit: {
|
||||
fetch: (url, init) => {
|
||||
const headers = new Headers(Object.assign({}, init?.headers, options.headers));
|
||||
return fetch(url, {
|
||||
...init,
|
||||
headers,
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
transport.onclose = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue