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

Expose generic `SendNotification` on `ServerSession` for custom protocol extensions

オープン 初心者向け
#745 コメント 13 件 リアクション 1 件 担当者 0 名 GitHub で見る

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

@ajuijas がすでに取り組んでいます。

2026年3月15日 から。

  • #844 @ajuijas による — オープン
  • #1146 @delaneyj による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
go

調査の方向性

mcp/server.go で ServerSession と既存の NotifyProgress および Log ヘルパーを読むことから始め、次に内部の conn.Notify 呼び出しがどのように使われているかを確認します。issue で説明されている公開汎用通知エントリポイントを追加し、呼び出し側が unsafe やリフレクションなしで ide/diffAccepted のようなカスタムメソッドを送信できることを確認します。

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

説明

needs investigation
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/diffAccepted
  • ide/diffRejected
  • ide/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:

  1. The conn field on ServerSession is unexported.
  2. The mcp.Connection interface's Write method 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

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

modelcontextprotocol/go-sdk のほかの issue

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

似ている issue

Go の issue をもっと見る

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

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