This repository was archived by the owner on May 29, 2026. It is now read-only.
Fix MCP server URL-based transport support#1830
Closed
Copilot wants to merge 2 commits into
Closed
Conversation
| // Regular expression for matching GitHub Flavored Markdown style warnings. | ||
| // Example: > [!WARNING] | ||
| // > This is a warning message. | ||
| const GITHUB_MARKDOWN_WARNINGS_RX = /^\s*>\s*\[!(?<severity>NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*\n>\s*(?<message>.+)(?:\s*\n>\s*.*?)*?$/gim; |
Check failure
Code scanning / CodeQL
Inefficient regular expression High
| value = ""; | ||
| // Enclose in quotes if the value contains newlines or quotes, and escape quotes | ||
| if (value.includes("\n") || value.includes('"')) { | ||
| value = value.replace(/"/g, '\\"'); // Escape existing quotes |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
| ... | ||
| */ | ||
| if (/file=\w+\.\w+/.test(label)) { | ||
| const m = /^\s*\`{3,}\w*\r?\n((.|\s)*)\r?\n\`{3,}\s*$/.exec(text); |
Check failure
Code scanning / CodeQL
Inefficient regular expression High
Copilot
AI
changed the title
[WIP] Fix MCP server URL-based transport support
Fix MCP server URL-based transport support
Aug 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1829 where MCP servers configured with
urlparameter instead ofcommandwere throwing "Missing required parameter: command" error.Problem
Previously, GenAIScript only supported stdio-based MCP servers that required
commandandargsparameters:Attempting to configure URL-based transports resulted in validation errors:
Solution
This PR adds comprehensive support for URL-based MCP transports while maintaining full backward compatibility:
1. Enhanced Interface Definition
commandandargsoptional inMcpServerConfigurl?: stringfor HTTP/WebSocket/SSE transportstype?: "stdio" | "http" | "sse"for explicit transport specification2. Multiple Transport Support
StreamableHTTPClientTransportfor HTTP-based MCP serversSSEClientTransportfor Server-Sent EventsStdioClientTransportfunctionality3. Intelligent Configuration Validation
typeis not specified:urlprovided → defaults to HTTP transportcommandprovided → defaults to stdio transportcommandandurl)4. Updated System Scripts
Both
system.mcpandsystem.agent_mcpnow support the new parameters with proper validation.Usage Examples
Stdio Transport (existing - unchanged):
HTTP Transport (new):
SSE Transport (new):
Backward Compatibility
All existing configurations continue to work without any changes. The implementation includes comprehensive validation that provides clear error messages for invalid configurations while automatically detecting the appropriate transport type for valid ones.
This enables GenAIScript to work seamlessly with remote MCP servers over HTTP and SSE protocols, expanding the ecosystem of compatible MCP servers beyond just local stdio-based implementations.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
cdn.sheetjs.comnode /usr/local/bin/yarn install(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.