Allow injecting a notifier factory for notification filtering and checks

Offen
#1,197 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

  • #1210 von @tarun-agarwal1044 — ohne Merge geschlossen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
java

Rechercherichtung

Start by locating McpAsyncNotifier and the server request and notification paths that create or use it; the issue does not name files or tests. Trace how request-scoped log levels and notification streams are represented, then assess how an injectable factory can fit while keeping the default permissive. Done means users can supply a factory for filtering notifications, with coverage for the described filtering cases.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area/server enhancement P2

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.

Vorherrschende Sprache
Java
Sterne
3.8k
Forks
1.1k
Ø Merge
1 T. 3 Std.
Gemergte PRs (30 T.)
38

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus modelcontextprotocol/java-sdk

Alle Issues in modelcontextprotocol/java-sdk

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.