Skip to content

fix(cli): align --log-level with MCP LoggingLevel specification - #1737

Open
AkhilTrivediX wants to merge 1 commit into
modelcontextprotocol:v1/mainfrom
AkhilTrivediX:fix/cli-log-level-spec-mismatch
Open

fix(cli): align --log-level with MCP LoggingLevel specification#1737
AkhilTrivediX wants to merge 1 commit into
modelcontextprotocol:v1/mainfrom
AkhilTrivediX:fix/cli-log-level-spec-mismatch

Conversation

@AkhilTrivediX

Copy link
Copy Markdown

Summary

  • Update CLI validLogLevels to include all 8 spec-defined log levels (debug, info, notice, warning, error, critical, alert, emergency).
  • Remove non-spec log level aliases (trace, warn) from CLI option validation.
  • Add CLI tests validating rejection of non-spec log level strings.

Root cause

validLogLevels in cli/src/client/connection.ts diverged from @modelcontextprotocol/sdk's LoggingLevelSchema by including trace/warn while rejecting standard MCP levels like notice, critical, alert, and emergency.

Fixes #1734.

Validation

  • cd cli && npx vitest run __tests__/cli.test.ts -t "reject"
  • npm run build-cli

@cliffhall
cliffhall changed the base branch from main to v1/main July 28, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI --log-level rejects valid MCP log levels and accepts invalid ones (spec mismatch)

1 participant