[Client] Support subscriptions/listen (2026-07-28)

Aberta
#752 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@songecko já está trabalhando nisso.

Desde 19/11/2026.

  • #753 de @songecko — aberto

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
20/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
php
Domínio
api

Direção de pesquisa

Read the client implementation around Client::callTool() and the existing notification handling, then compare the protocol behavior with the referenced server support in #444 and #451. Implement Client::listen() for subscriptions/listen, including the acknowledged filter, subscription notifications, cancellation, and termination behavior. Done means the client can open the stream, dispatch its notifications to callbacks, and return or throw as described; pull request #753 is already open for this issue.

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

Descrição

enhancement

Is your feature request related to a problem? Please describe.
On 2026-07-28 the server answers subscriptions/listen (#444, #451), but the client has no way to open that stream. A PHP client can't receive notifications/resources/updated or list changes from a modern server, so it has to poll instead.

Describe the solution you'd like
A Client::listen() that sends subscriptions/listen with a SubscriptionFilter, hands the acknowledged filter and each notification of the subscription to callbacks, and returns when the server ends the subscription (including the stdio notifications/cancelled termination), or throws on cancellation like callTool().

Describe alternatives you've considered
Polling resources/read from the application, which misses the point of subscriptions; and a custom notification handler, which can't open the stream or tell its notifications apart from others.

Additional context
#340 listed the client side of SEP-2575, and #185 listed resource subscriptions for the client; both closed with that part open. Handshake-era resources/subscribe is out of scope here.

Linguagem predominante
PHP
Estrelas
1.7k
Forks
206
Merge médio
1d 19h
PRs com merge (30d)
100

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/php-sdk

Todas as issues de modelcontextprotocol/php-sdk

Issues semelhantes

Mais issues de PHP

Receba novas issues na sua caixa de entrada

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