StreamableHTTPServerTransport: option to send SSE keepalive comments on open streams
Los mantenedores suelen responder en 1 día
@Urdemonlord ya está trabajando en esto.
Desde el 21/11/2026.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- backend, networking
Línea de trabajo
Start with the StreamableHTTPServerTransport class and its internal _webStandardTransport, where _streamMapping holds each open SSE stream's controller. Find where the standalone GET stream and POST SSE responses are created, then decide where a periodic : keepalive comment could be written and how the new option gets through the constructor. Done means the option is accepted, comments appear on open streams at the configured interval, and it is off by default. Settle the option name and default with maintainers before coding, since the issue leaves both open.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
StreamableHTTPServerTransport writes nothing on an open SSE stream between messages. The standalone GET stream usually carries no traffic for long periods, and a long-running tool call's POST stream can be quiet too. Proxies and load balancers with an idle timeout (AWS ALB and nginx default to 60 seconds, Cloudflare to 100) then close the connection, and clients see the stream drop and reconnect.
There is no public way to add a heartbeat. To keep streams alive today, a server has to reach into _webStandardTransport._streamMapping and enqueue an SSE comment on each stream's controller, which breaks on any internal change and forces an exact version pin.
Proposal
An option on the transport, for example:
new StreamableHTTPServerTransport({
sessionIdGenerator: () => randomUUID(),
keepAliveIntervalMs: 20_000, // write ": keepalive\n\n" on every open SSE stream
});
- SSE comment lines are ignored by clients (per the SSE spec), so this needs no protocol change and no client support.
- Applies to the standalone GET stream and to POST responses streamed as SSE.
- Off by default, or a conservative default below common proxy timeouts.
The MCP ping request is an alternative, but it makes every client send a POST per interval per stream, where a comment costs one line on an already-open connection.
Versions
Observed on @modelcontextprotocol/sdk 1.29.0.
- Lenguaje dominante
- TypeScript
- Estrellas
- 13.8k
- Forks
- 2.5k
- Merge medio
- 6 d 23 h
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de modelcontextprotocol/typescript-sdk
-
v2
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
modelcontextprotocol/typescript-sdk#3270 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
`callTool` with `allowInputRequired: true` throws on an `input_required` result when the tool declares an `outputSchema`Posiblemente ocupada @mgoldsborough la tomó hace 6 días. Abiertov2
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
modelcontextprotocol/typescript-sdk#3249 ·
Los mantenedores suelen responder en 1 día
-
v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
modelcontextprotocol/typescript-sdk#3243 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
TypeScript client accepts an unknown `resultType` in the first `server/discover` replyPosiblemente ocupada @Tidehyc la tomó hace 8 días. Abiertov2
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
modelcontextprotocol/typescript-sdk#3235 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
UriTemplate.match() throws a TypeError on an empty expression it acceptsPosiblemente ocupada @yunusemrejs la tomó hace 12 días. Abiertov1 v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
modelcontextprotocol/typescript-sdk#3221 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de modelcontextprotocol/typescript-sdk
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Vessel9817/onion-site-template#512 ·
Los mantenedores suelen responder en 1 día
-
nightly-tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
BlackBeltTechnology/pi-agent-dashboard#1256 ·
Los mantenedores suelen responder en 1 día
-
approved
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
fritzprix/libr-agent#3266 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
better-auth/better-auth#13101 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día