modelcontextprotocol / modelcontextprotocol/python-sdk

Add conveniences for MCP proxy pattern

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

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

enhancement needs decision P1 v2
主要言語
Python
スター
24.3k
フォーク
4k
平均マージ
1日 1時間
マージ済み PR(30日)
31

説明

TypeScript example, but should also be portable to our Python SDK:

export function mcpProxy({
  transportToClient,
  transportToServer,
  onerror,
}: {
  transportToClient: Transport;
  transportToServer: Transport;
  onerror: (error: Error) => void;
}) {
  transportToClient.onmessage = (message) => {
    transportToServer.send(message).catch(onerror);
  };

  transportToServer.onmessage = (message) => {
    transportToClient.send(message).catch(onerror);
  };

  transportToClient.onclose = () => {
    transportToServer.close().catch(onerror);
  };

  transportToServer.onclose = () => {
    transportToClient.close().catch(onerror);
  };

  transportToClient.onerror = onerror;
  transportToServer.onerror = onerror;
}

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

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

はじめの一歩

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

調査の方向性

まず、Python SDK のトランスポート抽象化と、プロキシを公開できそうなクライアントまたはサーバーのエントリポイントを見つけ、issue の TypeScript の例と比較します。完了時には、同等の双方向メッセージ転送、エラー処理、クローズの伝播を提供し、関連する Python テストを更新または追加する必要があります。

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

評価

技術スタック
python, typescript
領域
api, backend-api-design
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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