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

Add client-side tool call interceptor (annotation-aware policy enforcement)

オープン
#1,453 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
csharp
領域
api, security

調査の方向性

まず McpClientTool.ProtocolTool.Annotations と McpClientOptions および McpClientHandlers API を読み、次にサーバー側の AddCallToolFilter パイプラインと比較します。提案されている ToolCallFilter がアノテーションを検査し、クライアントのツール呼び出しパス全体でポリシーを適用する方法を定義し、破壊的な呼び出しがブロックされ、許可された呼び出しが next を通じて続行されることを示すテストを追加します。

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

説明

enhancement P2 ready for work

The MCP C# SDK v1.1.0 exposes ToolAnnotations via McpClientTool.ProtocolTool.Annotations, but provides no built-in mechanism for a host to inspect those annotations and decide whether to allow invocation.

The server-side filter pipeline (WithRequestFilters(f => f.AddCallToolFilter(...))) has no client-side equivalent. McpClientOptions has no ToolCallPolicy or BeforeToolCall hook. McpClientHandlers only handles server→client requests (Sampling, Elicitation).

Proposed API

var client = await McpClient.CreateAsync(transport, new McpClientOptions
{
    ToolCallFilter = async (toolName, annotations, args, next, ct) =>
    {
        if (annotations?.DestructiveHint == true)
            throw new ToolBlockedException("Requires confirmation");
        return await next(toolName, args, ct);
    }
});

Without this, hosts must manually wrap every McpClientTool before passing to an IChatClient, and any unwrapped path bypasses policy entirely.

See also: https://modelcontextprotocol.io/blog/2026-03-16-tool-annotations (lethal trifecta attack pattern)

主要言語
C#
スター
4.5k
フォーク
814
平均マージ
9日 19時間
マージ済み PR(30日)
4

環境構築

はじめの一歩

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

modelcontextprotocol/csharp-sdk のほかの issue

modelcontextprotocol/csharp-sdk の issue をすべて見る

似ている issue

C# の issue をもっと見る

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

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