-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Allow --mcp flag to accept URLs for streamable-http servers #8119
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -213,7 +213,7 @@ | |
|
|
||
| // MCPs from --mcp flag should be prepended (at the start) | ||
| expect(config.mcpServers).toHaveLength(2); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please fix the failing tests |
||
| expect(config.mcpServers?.[0]).toEqual({ | ||
|
Check failure on line 216 in extensions/cli/src/configEnhancer.test.ts
|
||
| name: "New-MCP", | ||
| command: "new-mcp", | ||
| }); | ||
|
|
@@ -223,6 +223,70 @@ | |
| }); | ||
| }); | ||
|
|
||
| it("should handle URLs in --mcp flag as streamable-http servers", async () => { | ||
| // Set up existing MCPs in config | ||
| mockConfig.mcpServers = [{ name: "Existing-MCP", command: "existing-mcp" }]; | ||
|
|
||
| const options: BaseCommandOptions = { | ||
| mcp: ["https://docs.continue.dev/mcp"], | ||
| }; | ||
|
|
||
| const config = await enhancer.enhanceConfig(mockConfig, options); | ||
|
|
||
| // URL should be converted to streamable-http MCP configuration | ||
| expect(config.mcpServers).toHaveLength(2); | ||
| expect(config.mcpServers?.[0]).toEqual({ | ||
| name: "docs.continue.dev", | ||
| type: "streamable-http", | ||
| url: "https://docs.continue.dev/mcp", | ||
| }); | ||
| expect(config.mcpServers?.[1]).toEqual({ | ||
| name: "Existing-MCP", | ||
| command: "existing-mcp", | ||
| }); | ||
| }); | ||
|
|
||
| it("should handle mix of URLs and hub slugs in --mcp flag", async () => { | ||
| // Mock loadPackageFromHub to return test MCP for hub slug | ||
| const { loadPackageFromHub } = await import("./hubLoader.js"); | ||
| (loadPackageFromHub as any).mockResolvedValueOnce({ | ||
| name: "Hub-MCP", | ||
| command: "hub-mcp", | ||
| }); | ||
|
|
||
| const options: BaseCommandOptions = { | ||
| mcp: ["https://example.com/mcp", "test/hub-mcp"], | ||
| }; | ||
|
|
||
| const config = await enhancer.enhanceConfig(mockConfig, options); | ||
|
|
||
| expect(config.mcpServers).toHaveLength(2); | ||
| expect(config.mcpServers?.[0]).toEqual({ | ||
| name: "example.com", | ||
| type: "streamable-http", | ||
| url: "https://example.com/mcp", | ||
| }); | ||
| expect(config.mcpServers?.[1]).toEqual({ | ||
| name: "Hub-MCP", | ||
| command: "hub-mcp", | ||
| }); | ||
| }); | ||
|
|
||
| it("should handle http:// URLs in --mcp flag", async () => { | ||
| const options: BaseCommandOptions = { | ||
| mcp: ["http://localhost:8080/mcp"], | ||
| }; | ||
|
|
||
| const config = await enhancer.enhanceConfig(mockConfig, options); | ||
|
|
||
| expect(config.mcpServers).toHaveLength(1); | ||
| expect(config.mcpServers?.[0]).toEqual({ | ||
| name: "localhost", | ||
| type: "streamable-http", | ||
| url: "http://localhost:8080/mcp", | ||
| }); | ||
| }); | ||
|
|
||
| it("should handle workflow integration gracefully when no workflow", async () => { | ||
| // The mocked service container returns null workflow state | ||
| const options: BaseCommandOptions = { | ||
|
|
||
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.
It looks like these tests failed, you need to make sure they pass