Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

MCP instrumentation retries synchronously failing handlers

クローズ
#24,504 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
observability

調査の方向性

Start at the wrapMcpServerWithSentry entry point and reproduce the synchronous handler example with the official MCP SDK. Trace the inner and outer wrappers to confirm why the same error causes a second callback invocation. Done means a throwing synchronous handler runs once and its error reaches the MCP client, with coverage for tools, resources, or prompts as appropriate.

索引モデルが issue の本文から書いたものです。

説明

Bug Core javascript

Wrapping an MCP server with wrapMcpServerWithSentry can execute a synchronous handler twice when its first invocation throws. This repeats application side effects. If the second invocation succeeds, the MCP client receives that success instead of the original failure.

Reproduced on develop at ceb8517523 with the official TypeScript SDK 1.30.0 and 2.0.0 clients and servers, including in a deployed Cloudflare Worker. Tools, resources, and prompts registered after wrapping are affected; resource callbacks registered before wrapping are also affected. Unwrapped callbacks and asynchronous rejections execute once.

For example, register this tool after wrapping, then call it once through an MCP client:

let calls = 0;
const server = wrapMcpServerWithSentry(new McpServer({ name: 'example', version: '1.0.0' }));

server.registerTool('example', {}, () => {
  calls += 1;
  if (calls === 1) {
    throw new Error('operation failed');
  }
  return { content: [{ type: 'text', text: 'unexpected retry' }] };
});

Expected: calls === 1 and the tool error reaches the client. Actual: calls === 2 and the client receives unexpected retry as a successful result.

The inner handler wrapper captures and rethrows the application error. The outer fallback catches that same error and invokes the original callback again, treating it as an instrumentation failure.

主要言語
TypeScript
スター
8.7k
フォーク
1.9k
平均マージ
1日 16時間
マージ済み PR(30日)
576

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getsentry/sentry-javascript のほかの issue

getsentry/sentry-javascript の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。