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

Aperta
#752 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@songecko ci sta già lavorando.

Dal 19/11/2026.

  • #753 di @songecko — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
20/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
php
Ambito
api

Direzione di ricerca

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.

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

Descrizione

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.

Lingua principale
PHP
Stelle
1.7k
Fork
206
Merge medio
1g 19h
PR unite (30g)
100

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

Tutte le issue di modelcontextprotocol/php-sdk

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.