Skip to content

Logging: per-request log level on modern servers (era fork) #1629

Description

@cliffhall

Stack: SDK V2 + New Spec — 6 of 10 (tab era-fork; needs era model from card 3).

Fork the Logging UX by era. On modern servers logging/setLevel and the session-scoped level are gone: the client opts into logs per request via _meta["io.modelcontextprotocol/logLevel"], and servers MUST NOT emit notifications/message for requests that omitted it. The SDK does not auto-attach logLevel — server logs are silently absent until we stamp it.

Scope

  • Legacy era: keep the current LogControls level Select + "Set" button → logging/setLevel, unchanged.
  • Modern era: replace the session-level selector with a per-request (or global "stamp every request") log-level control; make clear in the UI that logs arrive on the originating request's stream. Gate the legacy selector out on modern.
  • ping UI, if any, is legacy-only.

Key files

clients/web/src/components/screens/LoggingScreen/*, groups/LogControls/*, core/mcp/inspectorClient.ts (per-request _meta stamping), core/mcp/state/messageLogState.ts.

Acceptance

  • Legacy servers: level selector works as today.
  • Modern servers: logs appear only when the client stamps logLevel; UI reflects per-request semantics; setLevel selector hidden.
  • npm run ci green.

Ref: specification/v2_new_spec_impact.md §7.6, §8.3(log level), §9.3(Logs), §9.5(5).

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions