🔁 feat: Allow "http" as Alias for "streamable-http" in MCP Options (#8624)

- Updated StreamableHTTPOptionsSchema to accept "http" alongside "streamable-http".
- Enhanced isStreamableHTTPOptions function to handle both types and validate URLs accordingly.
- Added tests to ensure correct processing of "http" type options and rejection of websocket URLs.
This commit is contained in:
Danny Avila 2025-07-23 10:26:40 -04:00 committed by GitHub
parent a01536ddb7
commit 365e3bca95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 65 additions and 4 deletions

View file

@ -125,7 +125,7 @@ export const SSEOptionsSchema = BaseOptionsSchema.extend({
});
export const StreamableHTTPOptionsSchema = BaseOptionsSchema.extend({
type: z.literal('streamable-http'),
type: z.union([z.literal('streamable-http'), z.literal('http')]),
headers: z.record(z.string(), z.string()).optional(),
url: z
.string()