Wireshark for AI agents, but it lives in the kernel
MCPSpy uses eBPF to intercept and inspect Model Context Protocol traffic between AI clients and servers without modifying either side.

What it does
MCPSpy is a Linux CLI tool that hooks kernel-level system calls with eBPF to capture JSON-RPC 2.0 messages flying between MCP clients and servers. It decodes both stdio and HTTP/HTTPS transports into a browsable TUI or structured JSONL logs, effectively turning opaque AI agent chatter into observable events. The tool also offers optional prompt-injection scanning via HuggingFace inference models, flagging potential jailbreaks in tool arguments or responses.
The interesting bit
Most debugging tools sit in userland; MCPSpy plants itself in the kernel using eBPF, which means it can observe inter-process MCP traffic without instrumenting the applications themselves. That architecture makes it viable as a Kubernetes DaemonSet, passively auditing containers running LangFlow, LangGraph, or any other MCP-speaking service from the node level.
Key highlights
- Passively monitors
stdiopipes andHTTP/Sstreams, including Server-Sent Events - Optional real-time security analysis using external ML models to detect prompt injection
- Outputs rich
JSONLwith full request/response correlation and raw message capture - Ships as a single binary with an interactive TUI, or runs headless for log collection
- Supports deployment as a privileged container or Kubernetes
DaemonSetfor cluster-wide visibility
Caveats
- Linux-only (kernel 5.15+) and requires root privileges, so forget about monitoring from your MacBook directly
- Prompt-injection detection depends on a HuggingFace API token and external inference, which means it is neither offline nor self-contained
- The README notes that one of the supported security models is already deprecated on HuggingFace’s inference API
Verdict
Worth a look if you run MCP workloads on Linux and need to debug opaque client/server conversations or audit them for compliance. Skip it if your stack is Windows, macOS, or you were hoping for a fully offline, batteries-included security scanner.
Frequently asked
- What is alex-ilgayev/MCPSpy?
- MCPSpy uses eBPF to intercept and inspect Model Context Protocol traffic between AI clients and servers without modifying either side.
- Is MCPSpy open source?
- Yes — alex-ilgayev/MCPSpy is open source, released under the Apache-2.0 license.
- What language is MCPSpy written in?
- alex-ilgayev/MCPSpy is primarily written in C.
- How popular is MCPSpy?
- alex-ilgayev/MCPSpy has 514 stars on GitHub.
- Where can I find MCPSpy?
- alex-ilgayev/MCPSpy is on GitHub at https://github.com/alex-ilgayev/MCPSpy.