Make MCPStdioServerConfig.args optional across all SDKs#1347
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the public SDK surface area (and accompanying E2E scenarios) to align with the updated runtime schema allowing MCPStdioServerConfig.args to be omitted for stdio/local MCP server configurations.
Changes:
- Made
argsoptional/omittable in user-facing MCP stdio config types across Node.js, Go, Python, Rust, and .NET. - Added cross-SDK E2E tests validating session creation and basic prompting works when
argsis omitted. - Added new replay snapshots supporting the new E2E scenarios.
Show a summary per file
| File | Description |
|---|---|
| test/snapshots/mcp_and_agents/should_accept_mcp_server_configuration_without_args.yaml | New replay snapshot for “should accept … without args” scenario. |
| test/snapshots/mcp_and_agents/accept_mcp_server_config_without_args.yaml | New replay snapshot for “accept … without args” scenario. |
| rust/tests/e2e/mcp_and_agents.rs | Adds Rust E2E coverage for omitted args. |
| rust/src/types.rs | Omits args from serialization when empty (treats omitted as default empty). |
| python/e2e/test_mcp_and_agents_e2e.py | Adds Python E2E coverage for omitted args. |
| python/copilot/session.py | Updates Python MCP stdio config typing to reflect optional args. |
| nodejs/test/e2e/mcp_and_agents.e2e.test.ts | Adds Node.js E2E coverage for omitted args. |
| nodejs/src/types.ts | Makes MCPStdioServerConfig.args optional in TS types. |
| go/types.go | Adds omitempty to omit args when unset/empty during JSON marshaling. |
| go/internal/e2e/mcp_and_agents_e2e_test.go | Adds Go E2E coverage for omitted args. |
| dotnet/test/E2E/SessionMcpAndAgentConfigE2ETests.cs | Adds .NET E2E coverage for omitted args. |
| dotnet/src/Types.cs | Makes Args nullable so it can be omitted on the wire when unset. |
Copilot's findings
- Files reviewed: 12/12 changed files
- Comments generated: 1
This comment has been minimized.
This comment has been minimized.
08deeff to
f8795d9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The runtime schema now allows args to be omitted from stdio MCP server configs. Update user-facing types to match: - Node.js: args: string[] -> args?: string[] - Go: add omitempty to Args json tag (nil/empty not serialized) - Python: mark args as NotRequired[list[str]] - Rust: add skip_serializing_if = Vec::is_empty - .NET: make Args nullable (IList<string>? with no lazy init) Add an E2E test for each SDK that creates a session with an MCPStdioServerConfig that omits args entirely, verifying the optional field works end-to-end. Fixes #1231 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Cross-SDK Consistency Review ✅This PR does an excellent job maintaining feature parity across all five SDK implementations. Here's a summary of the consistency analysis: Changes Reviewed
All five implementations now correctly omit E2E CoverageE2E tests were added for all five SDKs, and the two snapshot YAML files correctly cover all test naming patterns:
Notes
No cross-SDK inconsistencies found. 🎉
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The runtime schema (
@github/copilot1.0.51-2) now allowsargsto be omitted from stdio MCP server configurations. This PR updates the user-facing types across all five SDKs to match, and adds E2E test coverage for the omitted-args case.Changes
Type changes:
args: string[]args?: string[]json:"args"json:"args,omitempty"args: list[str]args: NotRequired[list[str]]#[serde(default)]#[serde(default, skip_serializing_if = "Vec::is_empty")]IList<string> Args { get => field ??= []; set; }IList<string>? Args { get; set; }E2E tests: Each SDK now has a test that creates a session with
MCPStdioServerConfigomittingargsentirely, verifying the session creates and responds successfully.Validation
argsas optional — this aligns user-facing typesFixes #1231