Expose generic `SendNotification` on `ServerSession` for custom protocol extensions
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- go
調査の方向性
mcp/server.go で ServerSession と既存の NotifyProgress および Log ヘルパーを読むことから始め、次に内部の conn.Notify 呼び出しがどのように使われているかを確認します。issue で説明されている公開汎用通知エントリポイントを追加し、呼び出し側が unsafe やリフレクションなしで ide/diffAccepted のようなカスタムメソッドを送信できることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Use Case
I am implementing an MCP Server for the Gemini CLI IDE Integration. The specification requires the server to send custom notifications to the client to signal specific events.
Specifically, I need to send:
ide/diffAcceptedide/diffRejectedide/contextUpdate
The Problem
Currently, the mcp.ServerSession struct only exposes specific notification helpers (like NotifyProgress and Log). There is no public API to send a generic/custom JSON-RPC notification.
I attempted to use session.Notify(ctx, method, params), but:
- The
connfield onServerSessionis unexported. - The
mcp.Connectioninterface'sWritemethod requires*mcp.JSONRPCMessage, which is an unexported struct.
Proposed Solution
Please expose a generic notification method on ServerSession, similar to:
// In mcp/server.go
func (s *ServerSession) SendNotification(ctx context.Context, method string, params any) error {
return s.conn.Notify(ctx, method, params)
}
Current Workaround
I am currently forced to use unsafe and reflect to access the underlying conn field to call its Notify method, which is fragile for obvious reasons.
- 主要言語
- Go
- スター
- 5.2k
- フォーク
- 568
- 平均マージ
- 1日 18時間
- マージ済み PR(30日)
- 36
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/go-sdk のほかの issue
-
Session-lifecycle bookkeeping logs at info, spamming multiple log lines per request on stateless streamable HTTP対応中かも @anneheartrecord が 41 日前に担当しました。 オープンP3
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
modelcontextprotocol/go-sdk#1204 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
auth: Authorize fails against a 2025-03-26 server whose URL has a query string対応中かも @akshita317 が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 40/100
modelcontextprotocol/go-sdk#1347 ·
メンテナーはふだん 1 日以内に返信
-
P3
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
modelcontextprotocol/go-sdk#1337 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
mcp: Client.Connect never falls back to initialize when a stdio server ignores server/discover対応中かも @crossxr が 6 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
modelcontextprotocol/go-sdk#1332 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
modelcontextprotocol/go-sdk#1331 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
modelcontextprotocol/go-sdk の issue をすべて見る
似ている issue
-
[correctness][missing-coverage][sort] Strict uniqueness checks lack numeric-key equivalence coverageオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 69/100
SpecterOps/Janus#6 · コメント 1 件 ·
-
Service process inherits the caller's cwd at first use, holding that folder open on Windows (EBUSY)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
[docs] Media elements cannot load from a custom protocol (video/audio report MEDIA_ERR_SRC_NOT_SUPPORTED)対応中かも @vst93 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信