server: sessions of failed scenarios are never closed (close() skipped on the error path)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- testing-qa
調査の方向性
Start with the connection lifecycle in src/scenarios/server/prompts.ts and resources.ts, then search the server scenarios for the same try/catch pattern. Run npx @modelcontextprotocol/conformance server --url against a server without prompts/list to reproduce the open sessions. Done means failed scenarios close their connections and no longer leave GET streams or sessions open.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
When a server scenario fails, its Streamable HTTP session is never terminated. #79 added the DELETE to the connection's close(), but most scenarios call close() as the last statement of their try block, so it only runs on the success path. When the scenario throws (for example on a -32601 for a method the server does not implement), the catch records the failure and the session, including its GET stream, stays open until the process exits.
For example, on main (7169291), every scenario in src/scenarios/server/prompts.ts and resources.ts follows this shape:
try {
const conn = await connectToServer(serverUrl);
// ... checks that can throw ...
await conn.close(); // skipped when anything above throws
} catch (error) {
checks.push({ /* FAILURE */ });
}
The same pattern is in 0.2.0-alpha.11: of about 50 close() calls in the bundle, 4 are in a finally.
Why it matters
A server that caps concurrent sessions per client (a reasonable defence for an authenticated HTTP server) fills up after a few failing scenarios, and every later scenario gets HTTP 503 at initialize. Their results then describe the harness, not the server. Running conformance server against a gateway with a cap of 4 sessions per client, the 2025-11-25 run gets 13 of these 503s, and scenarios later in the run cannot be scored. Because the open GET stream is also left in place, the server cannot tell those sessions apart from live, idle clients, so it has no safe way to reclaim them.
Expected behavior
Close the connection on every exit path, e.g.:
let conn: Connection | undefined;
try {
conn = await connectToServer(serverUrl);
// ... checks ...
} catch (error) {
checks.push({ /* FAILURE */ });
} finally {
await conn?.close().catch(() => {});
}
To Reproduce
- Run
npx @modelcontextprotocol/conformance server --url <server>against a server that does not implementprompts/list(so the prompts scenarios fail with-32601). - Watch the server: sessions from the failed scenarios receive no DELETE, and their GET streams stay open until the suite exits.
Additional context
Found while running the suite against Fathomgate, an MCP proxy, through its HTTP listener. Happy to send a PR if that helps.
- 主要言語
- TypeScript
- スター
- 127
- フォーク
- 101
- 平均マージ
- 4日 7時間
- マージ済み PR(30日)
- 6
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/conformance のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modelcontextprotocol/conformance#530 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
modelcontextprotocol/conformance#519 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
modelcontextprotocol/conformance#315 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modelcontextprotocol/conformance#312 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
modelcontextprotocol/conformance#517 ·
メンテナーはふだん 1 日以内に返信
modelcontextprotocol/conformance の issue をすべて見る
似ている issue
-
module-request
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
appandflow/stim#1604 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
lingdojo/kana-dojo#31060 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
paperclipai/paperclip#14173 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信