Support using WithStreamServerTransport for multiple in-process mcp servers
まだ誰も着手していません。
評価
調査の方向性
builder.Services.AddSingleton(new StreamServerTransport(inputStream, outputStream)) の登録から始め、StreamServerTransport が同一プロセス内の MCP Server にどのように接続されているかを調べます。チャネルとサービスのライフタイムに関する前提を追跡し、その後、複数の MCP Server クラスを別々のチャネルで同一プロセス内に宣言できることを確認します。
索引モデルが issue の本文から書いたものです。
説明
The current implementation register the stream support as a singleton:
builder.Services.AddSingleton<ITransport>(new StreamServerTransport(inputStream, outputStream));
This prevents declaring multiple MCP Server classes in-process and using them with a separate channels.
Reasons for this choice:
- creating MCP servers in a separate class library so that they can be instantiated in-process or out-of-process depending on the app
- ability to clearly separate the tools, prompts and resources. Currently I have to mix all the in-process prompts, resources and tools in a single MCP server to be used in-process.
- avoid creating a separate process just because of the library limitation (performance reasons)
As I mentioned in a discussion, the Model Context Protocol adhere to the "transparency" principle, but the library makes it very difficult to reach. This is the reason why I tagged this as a bug.
- 主要言語
- C#
- スター
- 4.5k
- フォーク
- 814
- 平均マージ
- 9日 19時間
- マージ済み PR(30日)
- 4
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/csharp-sdk のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
modelcontextprotocol/csharp-sdk#1867 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
modelcontextprotocol/csharp-sdk#1840 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
modelcontextprotocol/csharp-sdk#1836 ·
-
enhancement needs confirmation
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
modelcontextprotocol/csharp-sdk#678 · コメント 1 件 ·
-
enhancement needs confirmation P3 ready for work
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modelcontextprotocol/csharp-sdk#515 · コメント 6 件 · リアクション 3 件 ·
modelcontextprotocol/csharp-sdk の issue をすべて見る
似ている issue
-
effort:S P3 refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
nightscout/nocturne#1532 ·
-
core dependencies
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
C#/.NET Roslyn LSP オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
DotNetNext/SqlSugar#1458 ·