KM

kerlenton/mcpsnoop

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

369 stars 35 forks 质量 82 趋势 14MIT

kerlenton/mcpsnoop 是一个从 https://github.com/kerlenton/mcpsnoop. 导入的 MCP 服务器候选服务器。

概览

kerlenton/mcpsnoop 是一个从 https://github.com/kerlenton/mcpsnoop. 导入的 MCP 服务器候选服务器。

概述(AI 翻译)

Wireshark 用于 MCP。 mcpsnoop 位于你的 AI 客户端和 MCP 服务器之间 并记录它们交换的每一个JSON-RPC帧,双方均无变化。 在终端里实时观看,检测结果不通过CI,或者发送给你的 追踪后端,OpenTelemetry 跨度。

问题所在

官方MCP检查员 作为自己的客户端连接,因此它永远看不到你的客户端(光标,Claude 代码,Codex)实际上会发送你的服务器。还有任何等待请求的东西 到达时不能显示模型从未打过的电话,或者用错误的电话 参数。当某个工具没有被静默调用时,能力不匹配,或者 电话就挂着,你只能翻日志猜测。

mcpsnoop 位于真实数据路径中。 将你的服务器命令包裹为 并且实时观看每一帧 JSON-RPC,就像你的真实客户端和服务器在对话时一样。

在CI中

本页也是mcpsnoop GitHub Action的列表, 所以这里是全部内容。它会检查捕获的会话,将所有发现归档为 代码扫描警报,导致你限制的任务失败。

手头没有捕获?录一次和你自己客户的会话,提交它,

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Wireshark for MCP. mcpsnoop sits between your AI client and your MCP server and records every JSON-RPC frame they exchange, with no change to either side. Watch it live in your terminal, fail CI on what it finds, or send it to your tracing backend as OpenTelemetry spans.

The problem

The official MCP Inspector connects as its own client, so it never sees what your client (Cursor, Claude Code, Codex) actually sends your server. And anything that waits for a request to arrive can’t show the call the model never made, or made with the wrong arguments. When a tool silently isn’t called, capabilities don’t line up, or a call just hangs, you’re left digging through logs and guessing.

mcpsnoop sits in the real data path instead. Wrap your server command with it and watch every JSON-RPC frame live, as your real client and server talk.

In CI

This page is also the listing for the mcpsnoop GitHub Action, so here is the whole of it. It checks a captured session, files every finding as a code scanning alert, and fails the job on what you gated on.

permissions:
  security-events: write
  contents: read

steps:
  - uses: kerlenton/[email protected]
    with:
      session: artifacts/session.jsonl

No capture to hand? Record one session with your own client once, commit it, and let the action replay it against every build. No model and no API key run in CI. The replay is checked like any capture, and the job also fails when the server got worse than in the recording. A server reached over Streamable HTTP gets target with its endpoint, and a recording replays over either transport.

steps:
  - uses: kerlenton/[email protected]
    with:
      replay: tests/mcp/claude-code-session.jsonl
      server: node dist/index.js

Pin whichever release you want. The newest is on the releases page. Every input and output is in The GitHub Action further down, and every signal the check can fail on is in docs/CI.md.

OpenTelemetry

MCP revision 2026-07-28 deprecates protocol-level Logging and tells implementations to move to stderr on stdio, or to OpenTelemetry for structured

在 GitHub 查看完整 README

安装

npx mcpsnoop -- node build/index.js
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "my-server": { "command": "mcpsnoop", "args": ["--", "node", "build/index.js"] } } }