Skip to content

Allow injecting a notifier factory for notification filtering and checks #1197

Description

@chemicL

Spec: Logging: Per-request log level

The server MUST NOT emit notifications/message for a request that does not include this field. […] notifications/message is request-scoped: the server MUST NOT deliver it on a subscriptions/listen stream or on any stream other than the one carrying the response to the request that set the log level.

Current behavior

McpAsyncNotifier.notify(method, params) sends any notification without checks. A handler can send notifications/message without a logLevel (or below the requested level), or notification types that don't belong to the request.

Proposal

Let users inject a notifier factory, so the policy is the user's choice and the framework doesn't hard-code one. A factory could:

  • drop or reject notifications by method
  • gate log messages on logLevel and the requested threshold
  • check extension-specific rules

The default stays permissive – the factory is the place to add stricter rules.

Activity

  1. added this to the 2.2.0-M2 milestone on Oct 20, 2026
  2. added
    enhancement
    on Oct 20, 2026
  3. added
    P2
    on Oct 20, 2026
  4. modified the milestones: 2.2.0-M2, 2.2.0-M3 on Nov 2, 2026
  5. modified the milestones: 2.2.0, 2.3.0 on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2area/serverenhancement

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions