mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
🎏 feat: Add MCP support for Streamable HTTP Transport (#7353)
This commit is contained in:
parent
502617db24
commit
0b44142383
6 changed files with 185 additions and 11 deletions
|
|
@ -82,10 +82,25 @@ export const SSEOptionsSchema = BaseOptionsSchema.extend({
|
|||
),
|
||||
});
|
||||
|
||||
export const StreamableHTTPOptionsSchema = BaseOptionsSchema.extend({
|
||||
type: z.literal('streamable-http'),
|
||||
headers: z.record(z.string(), z.string()).optional(),
|
||||
url: z.string().url().refine(
|
||||
(val) => {
|
||||
const protocol = new URL(val).protocol;
|
||||
return protocol !== 'ws:' && protocol !== 'wss:';
|
||||
},
|
||||
{
|
||||
message: 'Streamable HTTP URL must not start with ws:// or wss://',
|
||||
},
|
||||
),
|
||||
});
|
||||
|
||||
export const MCPOptionsSchema = z.union([
|
||||
StdioOptionsSchema,
|
||||
WebSocketOptionsSchema,
|
||||
SSEOptionsSchema,
|
||||
StreamableHTTPOptionsSchema,
|
||||
]);
|
||||
|
||||
export const MCPServersSchema = z.record(z.string(), MCPOptionsSchema);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue