Skip to content

MCPStdioServerConfig.args should be optional #1231

@ricksmit3000

Description

@ricksmit3000

The args field on MCPStdioServerConfig in [nodejs/src/types.ts](https://github.com/github/copilot-sdk/blob/main/nodejs/src/types.ts) is currently required:

export interface MCPStdioServerConfig extends MCPServerConfigBase {
  command: string;
  args: string[];   // required
  env?: Record<string, string>;
  cwd?: string;
}

This is inconsistent with the MCP TypeScript SDK's own StdioServerParameters, which defines args as optional:

modelcontextprotocol/typescript-sdksrc/client/stdio.ts:

export type StdioServerParameters = {
  command: string;
  args?: string[];  // optional
  // ...
};

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions