Transport and AuthInfo are declared separately in server and client, so an AuthInfo augmentation breaks in-process connections
Los mantenedores suelen responder en 1 día
@lipeh1 ya está trabajando en esto.
Desde el 4/12/2026.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
Línea de trabajo
Start by reading the server and client package declarations for Transport, MessageExtraInfo, and AuthInfo, then trace how each package bundles the protocol engine and how both depend on @modelcontextprotocol/core. Reproduce the reported TypeScript error with the module augmentation under TypeScript 5.9.3 or 6.0.3. Done means the shared types remain assignable across the packages after augmentation, with the protocol engine shared at runtime as described.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Packages: @modelcontextprotocol/server and @modelcontextprotocol/client 2.4.0
TypeScript: 5.9.3 and 6.0.3, strict, module/moduleResolution nodenext
Summary
Each package's declaration bundle carries its own copy of the shared types (Transport, MessageExtraInfo, AuthInfo, …). Without changes they are structurally identical, but a server that adds fields to AuthInfo by module augmentation (a common way to type the extra data its auth layer attaches) changes only the server package's copy. A server-side transport, such as InMemoryTransport from the server package, then no longer type-checks as the client package's Transport, which breaks in-process client/server setups used in tests and embedding.
The runtime is duplicated the same way: server and client each bundle the protocol engine, so a process that loads both (a server that also calls other servers, or a test that uses both) holds both copies (about 3 MB of live heap in our measurement).
Reproduction
import { Client } from '@modelcontextprotocol/client';
import { InMemoryTransport } from '@modelcontextprotocol/server';
declare module '@modelcontextprotocol/server' {
interface AuthInfo {
tenantId: string;
}
}
export async function connectInProcess(): Promise<void> {
const [clientTransport] = InMemoryTransport.createLinkedPair();
await new Client({ name: 'c', version: '1' }).connect(clientTransport);
}
Expected
Compiles, as it does without the augmentation (and as with 1.32.1, where one declaration of AuthInfo existed).
Actual
error TS2345: Argument of type 'InMemoryTransport' is not assignable to parameter of type 'Transport'.
Types of property 'onmessage' are incompatible. … Types of parameters 'extra' and 'extra' are incompatible.
Suggestion
Declare the shared types once (for example in @modelcontextprotocol/core, which both packages already depend on) and have server and client re-export them, so augmentations and assignability hold across packages. The same would let the protocol engine be shared at runtime.
- 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 7 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