Allow injecting a notifier factory for notification filtering and checks

Aperta
#1,197 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #1210 di @tarun-agarwal1044 — chiusa senza merge

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Java
Stelle
3.8k
Fork
1.1k
Merge medio
1g 3h
PR unite (30g)
38

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/java-sdk

Tutte le issue di modelcontextprotocol/java-sdk

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.