mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 10:50: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
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -44008,7 +44008,7 @@
|
||||||
},
|
},
|
||||||
"packages/mcp": {
|
"packages/mcp": {
|
||||||
"name": "librechat-mcp",
|
"name": "librechat-mcp",
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.9.0",
|
"@modelcontextprotocol/sdk": "^1.9.0",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "librechat-mcp",
|
"name": "librechat-mcp",
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"description": "MCP services for LibreChat",
|
"description": "MCP services for LibreChat",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ export class MCPConnection extends EventEmitter {
|
||||||
this.client = new Client(
|
this.client = new Client(
|
||||||
{
|
{
|
||||||
name: 'librechat-mcp-client',
|
name: 'librechat-mcp-client',
|
||||||
version: '1.2.0',
|
version: '1.2.1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
capabilities: {},
|
capabilities: {},
|
||||||
|
|
@ -159,6 +159,15 @@ export class MCPConnection extends EventEmitter {
|
||||||
headers: options.headers,
|
headers: options.headers,
|
||||||
signal: abortController.signal,
|
signal: abortController.signal,
|
||||||
},
|
},
|
||||||
|
eventSourceInit: {
|
||||||
|
fetch: (url, init) => {
|
||||||
|
const headers = new Headers(Object.assign({}, init?.headers, options.headers));
|
||||||
|
return fetch(url, {
|
||||||
|
...init,
|
||||||
|
headers,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
transport.onclose = () => {
|
transport.onclose = () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue