Evaluate SDK middleware for protocol/tracing

未关闭
#1,024 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
冷清
技术栈
typescript
领域
devtools

调研方向

审查 TypeScript SDK PR #1406 中的 sendMiddleware 和 receiveMiddleware API,然后检查 McpContext.tsx 中当前的连接处理。将 middleware 选项与 #1011 中的请求跟踪模型以及 #983 中的历史记录/日志架构进行比较。完成标准是记录 Inspector V2 是否应集成 middleware,用于捕获、跟踪、协议扩展或插件钩子。

由索引模型根据 Issue 内容生成。

描述

enhancement v2

Context

TypeScript SDK PR #1406 adds message middleware support:
https://github.com/modelcontextprotocol/typescript-sdk/pull/1406

This adds sendMiddleware and receiveMiddleware options to Protocol, allowing transformation of JSON-RPC messages before sending and after receiving.

Potential Uses in Inspector V2

Use Case How Middleware Helps
Protocol capture receiveMiddleware could capture all messages for Protocol page without modifying client logic
Request tracing sendMiddleware could inject trace IDs for parent-child correlation
Protocol extensions Add custom capabilities to initialize (e.g., inspector metadata)
Plugin architecture Plugins could register middleware to intercept/modify messages
Debugging Inject timestamps, add debugging headers

Action Items

  • Monitor PR #1406 for merge
  • When merged, evaluate integration into McpContext.tsx
  • Consider for request trace model (linking tool calls to sampling requests)
  • Evaluate for plugin hooks in client features PR

Related

  • #1022 (Mantine UI) - current McpContext uses direct SDK connection
  • #1011 (client features UX spec) - request trace model spec
  • #983 (data spec) - history/logging architecture
主要语言
TypeScript
星标
11.3k
派生
1.6k
平均合并
1 小时 28 分钟
30 天内合并 PR
138

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelcontextprotocol/inspector 的其他 Issue

查看 modelcontextprotocol/inspector 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。