Transport and AuthInfo are declared separately in server and client, so an AuthInfo augmentation breaks in-process connections
メンテナーはふだん 1 日以内に返信
@lipeh1 がすでに取り組んでいます。
2026年12月4日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 13.8k
- フォーク
- 2.5k
- 平均マージ
- 6日 23時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/typescript-sdk のほかの issue
-
v2
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
modelcontextprotocol/typescript-sdk#3270 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
`callTool` with `allowInputRequired: true` throws on an `input_required` result when the tool declares an `outputSchema`対応中かも @mgoldsborough が 6 日前に担当しました。 オープンv2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
modelcontextprotocol/typescript-sdk#3249 ·
メンテナーはふだん 1 日以内に返信
-
v2
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modelcontextprotocol/typescript-sdk#3243 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
TypeScript client accepts an unknown `resultType` in the first `server/discover` reply対応中かも @Tidehyc が 7 日前に担当しました。 オープンv2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
modelcontextprotocol/typescript-sdk#3235 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
UriTemplate.match() throws a TypeError on an empty expression it accepts対応中かも @yunusemrejs が 12 日前に担当しました。 オープンv1 v2
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
modelcontextprotocol/typescript-sdk#3221 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
modelcontextprotocol/typescript-sdk の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Vessel9817/onion-site-template#512 ·
メンテナーはふだん 1 日以内に返信
-
nightly-tests
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
BlackBeltTechnology/pi-agent-dashboard#1256 ·
メンテナーはふだん 1 日以内に返信
-
approved
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
fritzprix/libr-agent#3266 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
better-auth/better-auth#13101 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信