modelcontextprotocol / modelcontextprotocol/csharp-sdk

`SseClientTransport.Endpoint` should be nullable when `HttpClient` is provided

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

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

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

説明

Is your feature request related to a problem? Please describe.
I'm looking at how to integrate with .NET Aspire, where I have an MCP server on HTTP and then I want to consume that from an application using McpClient.

Aspire allows me to pass through the endpoint using service discovery on the HttpClient, so I can have an endpoint like https+http://mcp, but this endpoint can't be set to SseClientTransport.Endpoint due to this validation on the setter: https://github.com/modelcontextprotocol/csharp-sdk/blob/1e8fb040377b9ac9ac94c97e4b1f1438170bc0ea/src/ModelContextProtocol.Core/Client/SseClientTransportOptions.cs#L24-L27

Describe the solution you'd like
I want to be able to provide a HttpClient instance to the SseClientTransport without also having to provide the endpoint, since the HttpClient has the endpoint known (and it's resolved via service discovery).

Describe alternatives you've considered
My only solution is that I have to manually configure the endpoint, which defeats some of the value of using .NET Aspire here.

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

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

はじめの一歩

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

調査の方向性

src/ModelContextProtocol.Core/Client/SseClientTransportOptions.cs から始め、特に issue でリンクされている setter を確認し、SseClientTransport が HttpClient と Endpoint をどのように使用しているかを追跡します。既存の検証が引き続き正しく動作しつつ、別個の Endpoint 値を必要とせずに HttpClient からサービスディスカバリーされたエンドポイントを提供できれば完了です。関連するテストがあれば確認してください。

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

評価

技術スタック
csharp
領域
api
issue の種類
機能追加
難易度
2/5
見積もり時間
1〜3時間
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
68/100

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

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