Add conveniences for MCP proxy pattern
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- python, typescript
调研方向
首先定位 Python SDK 的传输抽象,以及可以暴露 proxy 的客户端或服务器入口点,然后将它们与 issue 中的 TypeScript 示例进行比较。完成后应提供等效的双向消息转发、错误处理和关闭传播,并更新或添加相关的 Python 测试。
由索引模型根据 Issue 内容生成。
描述
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;
}
- 主要语言
- Python
- 星标
- 24.3k
- 派生
- 4k
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 30
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/python-sdk 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
modelcontextprotocol/python-sdk#3566 ·
-
v1 v2
难度 2/5 1-3 小时 新手友好度 85/100
modelcontextprotocol/python-sdk#3546 · 5 条评论 ·
-
v1 v2
难度 2/5 1-3 小时 新手友好度 76/100
modelcontextprotocol/python-sdk#3545 · 1 条评论 ·
-
v1 v2
难度 1/5 1 小时以内 新手友好度 91/100
modelcontextprotocol/python-sdk#3508 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 64/100
modelcontextprotocol/python-sdk#3504 ·
查看 modelcontextprotocol/python-sdk 的全部 Issue
相似的 Issue
-
essnmx good first issue
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 65/100
syfoud/Simulated_Scepter#174 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
Giskard-AI/giskard-oss#2840 · 1 条评论 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success 未关闭area: repo bug perceived difficulty: 2
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
yeti-platform/yeti#1380 ·