Allow injecting a notifier factory for notification filtering and checks

Aberta
#1,197 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

  • #1210 de @tarun-agarwal1044 — fechado sem integrar

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
java

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Java
Estrelas
3.8k
Forks
1.1k
Merge médio
1d 3h
PRs com merge (30d)
38

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de modelcontextprotocol/java-sdk

Todas as issues de modelcontextprotocol/java-sdk

Issues semelhantes

Mais issues de Java

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.