Summary
Invoking @azure/mcp without a command exits with code 1, but writes the generated root help to stdout. Only Required command was not provided. is written to stderr.
For MCP clients using stdio, stdout is reserved for newline-delimited JSON-RPC messages. A client configured with a bare npx -y @azure/mcp command therefore receives hundreds of non-JSON lines and may fail before surfacing the actionable diagnostic.
Reproduction
Reproduced with the latest published package on July 23, 2026:
npx -y @azure/mcp@3.0.0-beta.26 >stdout.txt 2>stderr.txt
echo $?
Observed:
- Exit code:
1
- stdout: 297 lines of version and root help text
- stderr:
Required command was not provided.
The valid invocation, npx -y @azure/mcp server start, is not affected.
Expected behavior
For an invalid invocation caused by a missing command:
- Exit nonzero.
- Write no output to stdout.
- Write the error and generated help/usage text to stderr.
Explicit help requests such as npx -y @azure/mcp --help should continue to exit successfully and write help to stdout.
Acceptance criteria
- A bare invocation exits nonzero with empty stdout.
- The missing-command error and root help are written to stderr.
- Explicit
--help behavior remains unchanged.
- Valid
server start stdio framing remains unchanged.
- Automated tests assert exit codes and stdout/stderr routing for the bare invocation and explicit help path.
Summary
Invoking
@azure/mcpwithout a command exits with code 1, but writes the generated root help to stdout. OnlyRequired command was not provided.is written to stderr.For MCP clients using stdio, stdout is reserved for newline-delimited JSON-RPC messages. A client configured with a bare
npx -y @azure/mcpcommand therefore receives hundreds of non-JSON lines and may fail before surfacing the actionable diagnostic.Reproduction
Reproduced with the latest published package on July 23, 2026:
Observed:
1Required command was not provided.The valid invocation,
npx -y @azure/mcp server start, is not affected.Expected behavior
For an invalid invocation caused by a missing command:
Explicit help requests such as
npx -y @azure/mcp --helpshould continue to exit successfully and write help to stdout.Acceptance criteria
--helpbehavior remains unchanged.server startstdio framing remains unchanged.