-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: add support for SSE MCP servers #5517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add support for SSE MCP servers #5517
Conversation
…t) in the YAML configuration schema, ensuring backward compatibility with legacy configurations
✅ Deploy Preview for continuedev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Thanks @04cfb1ed I closed my PR to avoid confusion as it was just a quick draft I didn't spend much time on, and yours is more complete. |
Hi @04cfb1ed, Following @nejch's suggestion on the now-closed PR #5511, I wanted to reach out here. Thank you for picking this up and creating a more complete implementation for SSE/WebSocket MCP server support! This is a feature I was really looking forward to for my own setup. Since the original PR was a draft and I was eager to test this out, I quickly put together a working version (for my specific SSE use case) in my fork: It mainly involved completing the URL handling in Please feel free to reference it if any part might be helpful for finalizing this PR (#5517). No pressure at all, just wanted to share my work in case it's useful. Thanks again for implementing this much-needed feature, and looking forward to seeing this merged! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks solid, thanks for adding the tests as well! Just had a few small comments.
Is there an SSE server you could point me towards to test this locally?
@@ -378,21 +378,33 @@ prompts, context, and tool use. Continue supports any MCP server with the MCP co | |||
**Properties:** | |||
|
|||
- `name` (**required**): The name of the MCP server. | |||
- `type"` (**required**): The type of the MCP server. Can be "stdio", "sse", or "websocket. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `type"` (**required**): The type of the MCP server. Can be "stdio", "sse", or "websocket. | |
- `type"` (**required**): The type of the MCP server. Can be "stdio", "sse", or "websocket". |
@@ -63,6 +80,17 @@ export const blockOrSchema = <T extends z.AnyZodObject>( | |||
usesSchema: z.ZodTypeAny = defaultUsesSchema, | |||
) => z.union([schema, blockItemWrapperSchema(schema, usesSchema)]); | |||
|
|||
export const blockOrDiscriminatedUnionSchema = <T extends z.ZodType>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way we can use the existing blockOrSchema
instead of creating the new type? This will likely break typings in our repo for hub.continue.dev and in general will complicate things a lot.
Generally speaking I'd rather have a not-100%-perfect-schema rather than create a new wrapper here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this acceptable? (adding an optional parameter to change the override parameter)
export const blockOrSchema = <T extends z.AnyZodObject>(
schema: T,
usesSchema: z.ZodTypeAny = defaultUsesSchema,
isDiscriminatedUnion?: boolean,
) => {
if (isDiscriminatedUnion) {
return z.union([schema, z.object({
uses: usesSchema,
with: z.record(z.string()).optional(),
override: z.any().optional(),
})]);
}
return z.union([schema, blockItemWrapperSchema(schema, usesSchema)]);
};
// Sample
mcpServers: z.array(blockOrSchema(mcpServerSchema as any, defaultUsesSchema, true)).optional(),
@04cfb1ed waiting for your powers for this megical feature :) |
Description
Add support for multiple MCP server types (stdio, sse, websocket) in the YAML configuration schema, ensuring backward compatibility with legacy configurations).
I just saw the #5511 I was working on this PR a few days ago, I leave here, but I don't know how to proceed
Closes #5359
Checklist
Screenshots
[ For visual changes, include screenshots. Screen recordings are particularly helpful, and appreciated! ]
Testing instructions
[ For new or modified features, provide step-by-step testing instructions to validate the intended behavior of the change, including any relevant tests to run. ]