You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCPStdioServerConfig.args should be optional #1231
A stdio MCP server invoked with no arguments is a valid configuration per the spec, and omitting args is explicitly supported by the reference implementation.
Observed behaviour: Omitting args from a stdio server config causes the SDK's schema validation to reject the entire config with an invalid_union error (Invalid MCP config … args: Required).
Expected behaviour:args defaults to [] when omitted, consistent with StdioServerParameters.
Suggested fix: Change args: string[] to args?: string[] in MCPStdioServerConfig, treating a missing value as [] at the spawn call site.
dotnet/src/Types.cs:1794–1823 — .NET McpStdioServerConfig class
What I found
The args field is marked required in the Node.js user-facing type (args: string[]) and in the generated wire type (McpServerConfigLocal). When a user omits args, the SDK passes the config to the CLI without the field, and the CLI's schema validation rejects it with the invalid_union / args: Required error described in the issue.
This is inconsistent across SDKs and inconsistent with the MCP spec:
Args []string with no omitempty — nil serialises as JSON null, which also fails CLI validation
Python
args: list[str] in a total=False TypedDict — technically optional at runtime but no NotRequired annotation
.NET
Args { get => field ??= []; set; } — always defaults to []; already correct
The .NET SDK already handles this correctly by defaulting Args to an empty list. The other SDKs do not.
The MCP spec and the reference TypeScript SDK (StdioServerParameters) treat args as optional, since invoking a binary with no arguments is a completely valid configuration. The current Node.js and Go behaviour is therefore a bug: it rejects valid configurations that the spec explicitly supports.
Root cause
The user-facing types and the SDK serialisation layer do not normalise a missing/nil args to [] before sending the payload to the CLI. The fix is to make args optional in the user-facing type (args?: string[]) and default it to [] at the call site where the session-create/resume payload is assembled — mirroring what the .NET SDK already does automatically.
Activity
github-actions commentedon May 8, 2026
Investigation findings: confirmed bug ✅
I investigated the relevant code paths across all SDK implementations.
What I looked at
nodejs/src/types.ts:1133–1142— user-facingMCPStdioServerConfiginterfacenodejs/src/generated/rpc.ts:869–887— generatedMcpServerConfigLocal(the wire type sent to the CLI)go/types.go:471–493— GoMCPStdioServerConfigstructpython/copilot/session.py:778–787— PythonMCPStdioServerConfigTypedDictdotnet/src/Types.cs:1794–1823— .NETMcpStdioServerConfigclassWhat I found
The
argsfield is marked required in the Node.js user-facing type (args: string[]) and in the generated wire type (McpServerConfigLocal). When a user omitsargs, the SDK passes the config to the CLI without the field, and the CLI's schema validation rejects it with theinvalid_union/args: Requirederror described in the issue.This is inconsistent across SDKs and inconsistent with the MCP spec:
args: string[]— required; omitting causes CLI rejectionArgs []stringwith noomitempty—nilserialises as JSONnull, which also fails CLI validationargs: list[str]in atotal=FalseTypedDict — technically optional at runtime but noNotRequiredannotationArgs { get => field ??= []; set; }— always defaults to[]; already correctThe .NET SDK already handles this correctly by defaulting
Argsto an empty list. The other SDKs do not.The MCP spec and the reference TypeScript SDK (
StdioServerParameters) treatargsas optional, since invoking a binary with no arguments is a completely valid configuration. The current Node.js and Go behaviour is therefore a bug: it rejects valid configurations that the spec explicitly supports.Root cause
The user-facing types and the SDK serialisation layer do not normalise a missing/nil
argsto[]before sending the payload to the CLI. The fix is to makeargsoptional in the user-facing type (args?: string[]) and default it to[]at the call site where the session-create/resume payload is assembled — mirroring what the .NET SDK already does automatically.Labelled as bug.
Make MCPStdioServerConfig.args optional across all SDKs
Make MCPStdioServerConfig.args optional across all SDKs
Make MCPStdioServerConfig.args optional across all SDKs
Make MCPStdioServerConfig.args optional across all SDKs (#1347)
Make MCPStdioServerConfig.args optional across all SDKs (#1347)
Make MCPStdioServerConfig.args optional across all SDKs (#1347)