packetsniffer-mcp
Provides tools to analyze Bluetooth HCI/btsnoop captures, extracting RFCOMM serial port profile payloads, frame types, lengths, and checksums.
Supports Google's LLM API as a cloud provider for chat and agentic workflows, configured via GOOGLE_API_KEY.
Integrates with a local Ollama server for LLM-powered chat and agentic workflows, auto-detected on port 11434.
Integrates with OpenAI's LLM API as a cloud provider for chat and agentic workflows, configured via OPENAI_API_KEY.
Uses Wireshark's tshark dissectors to deeply decode PCAP/PCAPNG files, extracting DNS answers, HTTP requests, TLS SNI hostnames, USBPcap, and RFCOMM fields.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@packetsniffer-mcp what's in this capture file? C:/captures/router.pcap"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
packetsniffer-mcp
MCP server for local network packet capture and PCAP file analysis.
Stack: Python 3.12+ · FastMCP 3.4 · FastAPI · prefab-ui · Multi-provider LLM · Sampling · CodeMode (--agentic)
What can I do with this?
A network debugger you can ask questions of. The agent drives Scapy via one
portmanteau tool (packetsniffer_ops) instead of you wrangling Wireshark/tshark:
Scenario | Call |
"What is in this capture file?" — analyze any |
|
"What is phoning home?" — watch DNS queries to find which app contacts which domain. Pass |
|
"Watch it in the background" — start a capture, don't block the agent. Poll, then collect. Survives across agent sessions in HTTP daemon mode. |
|
"Decode it deeply" — after a capture, extract decoded fields Scapy misses: full DNS answers, HTTP requests, and TLS SNI hostnames (catches encrypted phone-home domains). Requires tshark (ships with Wireshark). |
|
"Why is my service unreachable?" — capture traffic to one port and see whether packets arrive at all, and how the TCP handshake behaves. |
|
"What is on my network?" — list interfaces before capturing. |
|
"What bytes does this app send my USB device?" — pull the host-to-device data out of a USBPcap capture, with per-endpoint totals and any captured device/interface descriptors (printer class? HID? vendor-specific?). Pure Python, no tshark. |
|
"What does it send over Bluetooth serial?" — RFCOMM (serial port profile) data from a Bluetooth HCI capture (btsnoop log from an Android phone, or Wireshark pcap/pcapng). |
|
"Which bytes encode the dot?" — diff two captures (blank label vs one-dot label): shared prefix/suffix, changed byte ranges, per-transfer differences. |
|
"Capture USB while I operate the device" — wraps USBPcap's command line for a fixed duration. Unverified live (needs the USBPcap driver, administrator rights). |
|
Results come back as structured JSON (flows, protocol mix, per-packet summaries) so the agent can interpret them directly — no pcap GUI needed.
Hardware reverse engineering (USB / Bluetooth):
usb_payloads,btsnoop_payloadsanddiff_captureswork on files anywhere, with no privileges and no tshark. They are tested against synthetic captures, and when tshark is installed a test cross-checks the same files against Wireshark's own dissectors (USBPcap bus/device/endpoint/transfer type/payload, RFCOMM frame types, lengths and check bytes; verified with Wireshark 4.6.8). Not yet tested against a capture from real hardware.usb_capture/usb_list_hubsdriveUSBPcapCMD.exe(winget install desowin.USBPcap; a capture driver, administrator rights, and a reboot before the driver attaches to the USB hubs). The flags used (-d,-o,-A,--devices,--inject-descriptors) match the real tool's--help(USBPcap 1.5.4.0). Orchestration is tested through a fake executable; a live capture has not been run yet.Bluetooth: the capture must start before the device connects, or the L2CAP channel table is missing and only frames whose checksum verifies are kept. Classic Bluetooth cannot be sniffed from Windows; use an Android phone's HCI snoop log. Credit-based flow control bytes are handled; unusual RFCOMM streams may not decode.
Method and capture protocol: see the DYMO MobileLabeler plan in devices-mcp,
docs/LABEL_PRINTER_REVERSE_ENGINEERING.md.
Limits / requirements:
analyze_pcapanddecode_pcapwork on files anywhere, no privileges.decode_pcapneeds tshark on PATH (ships with Wireshark —winget install Wireshark). Without it, the op returns a cleanmissing_dependencyerror, nothing else breaks.Live
sniff/start_capturerequire administrator privileges, and on Windows the Npcap driver (Wireshark's capture backend).Loopback capture (
127.0.0.1) is unreliable on Windows — this tool shines on WiFi/LAN/DNS traffic and offline capture files, not localhost webapp debugging.Capture defaults are bounded:
countmax 1000,timeoutmax 300s. Raise the ceilings viaPACKETSNIFFER_MCP_MAX_SNIFF_COUNT/PACKETSNIFFER_MCP_MAX_SNIFF_SECONDSfor long-running captures.Background captures live in the server process: run the HTTP daemon (
start.ps1/--http) for captures that outlive a single agent session.stop_capturetakes effect on the next packet — with no traffic on the interface it finishes at the timeout.
Related MCP server: mcp-wireshark
Install
uv sync --extra dev
pre-commit installRun
# stdio (Claude Desktop / Cursor)
uv run python -m packetsniffer_mcp
# HTTP + REST API (direct access)
uv run python -m packetsniffer_mcp --http --port 10920
# CodeMode agentic discovery
uv run python -m packetsniffer_mcp --agentic
# Dev launcher (auto-opens browser; `-Headless` to skip)
.\start.ps1LLM Providers
Auto-detects local providers (Ollama on :11434, LM Studio on :1234). Configure via environment variables:
Variable | Purpose |
| ollama | lmstudio | openai | anthropic | google |
| Override model name |
| API key (cloud providers) |
Cloud providers detect their standard env vars: OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY.
API Endpoints (HTTP mode)
Method | Path | Description |
GET |
| Health check |
GET |
| Full diagnostics (LLM, tools, system) |
GET |
| List all MCP tools |
GET |
| List LLM providers + presets |
POST |
| Chat with LLM (supports streaming) |
Fleet Surface
Feature | Entry |
Help |
|
Status |
|
Prefab card |
|
Chat |
|
Agentic |
|
Skills |
|
Capabilities |
|
CodeMode |
|
License
MIT © 2026 MCP Studio
Available Tools
6 toolsagentic_packetsniffer_mcp_workflowC
Run a multi-step workflow using FastMCP sampling when the client supports it.
Inputs: workflow_prompt (required), max_iterations, available_tools. Returns: object
chatARead-only
Chat with the configured LLM provider (local or cloud).
Uses the unified LLM client which auto-detects local providers (Ollama, LM Studio) and supports cloud providers (OpenAI, Anthropic, Google Gemini) via API keys.
The provider and model can be overridden per-request.
Return Format
{"success": bool, "content": str, "model": str, "provider": str}
Examples
await chat(prompt="What is the capital of Austria?") await chat(prompt="Explain quantum computing in 3 sentences", system="Be concise.") await chat(prompt="Hello", provider="openai", model="gpt-4o") await chat(prompt="Describe Vienna", temperature=0.3)
Inputs: prompt (required), model, system, provider, +2 more. Returns: object
helpB
List capabilities and fleet surface for PacketsnifferMcp.
Inputs: no named parameters. Returns: object
packetsniffer_mcp_status_cardBRead-only
Server health as a Prefab card.
Inputs: no named parameters.
packetsniffer_opsA
Network interface discovery, live packet capture, and PCAP analysis.
[RATIONALE] Consolidates local packet sniffing, background captures, and offline PCAP analysis tools to stay under tool limits while providing full companion hacking capability.
Operations:
list_interfaces: List active network interfaces with details.
sniff: Blocking capture for the given count/timeout (requires admin privileges). Pass save_path to persist the capture to a PCAP file for later analysis or evidence.
start_capture: Start a capture in the background (non-blocking). Returns a capture_id immediately; the capture runs in a server thread until count/timeout is reached or stop_capture is called. In HTTP daemon mode the capture survives across agent sessions. Poll with capture_status.
capture_status: Status of one capture (capture_id) or all active captures.
stop_capture: Request a stop (takes effect on the next packet, or at timeout). Returns packets captured so far; pass save_path to persist them.
decode_pcap: Deep protocol decode of a PCAP/PCAPNG file via tshark (optional dependency - install Wireshark). Extracts decoded fields Scapy's thin dissectors miss: DNS query/answer names, HTTP requests, TLS SNI hostnames (catches encrypted phone-home domains). Use limit to bound output.
analyze_pcap: Parse a PCAP/PCAPNG capture file and summarize network flows.
Hardware-protocol reverse engineering (pure Python, no tshark needed; for working out what bytes a host sends a device such as a label printer):
usb_list_hubs: List USB root hubs USBPcap can capture on (needs USBPcap installed; UNVERIFIED live).
usb_capture: Capture USB traffic with USBPcapCMD for 'timeout' seconds into save_path (needs USBPcap and administrator rights; UNVERIFIED live). Print/operate the device during the window.
usb_payloads: From a USBPcap capture, the data of each transfer (default host-to-device bulk/interrupt), per-endpoint totals, and any device/interface descriptors in the capture (answers "printer class, HID, or vendor-specific?"). export_path writes the concatenated stream to a .bin file.
btsnoop_payloads: From a Bluetooth HCI capture (btsnoop, or pcap/pcapng link type 187/201), the RFCOMM serial-port-profile data. Best effort: capture from before the connection is made.
diff_captures: Compare two captures' host-to-device streams (file_path vs file_path_b): shared prefix and suffix, changed byte ranges, per-transfer differences. For controlled experiments (blank label vs one dot).
Return Format
{"success": bool, "operation": str, "data": dict | list}
Examples
await packetsniffer_ops(operation="list_interfaces") await packetsniffer_ops(operation="sniff", interface="WiFi", count=10) await packetsniffer_ops(operation="sniff", filter_expr="udp port 53", count=200, timeout=120, save_path="C:/captures/dns.pcap") await packetsniffer_ops(operation="start_capture", filter_expr="udp port 53", count=1000, timeout=300) await packetsniffer_ops(operation="capture_status", capture_id="a1b2c3d4") await packetsniffer_ops(operation="stop_capture", capture_id="a1b2c3d4", save_path="C:/captures/dns.pcap") await packetsniffer_ops(operation="decode_pcap", file_path="C:/captures/dns.pcap", limit=100) await packetsniffer_ops(operation="analyze_pcap", file_path="C:/captures/dns.pcap") await packetsniffer_ops(operation="usb_list_hubs") await packetsniffer_ops(operation="usb_capture", usb_hub="\.\USBPcap1", timeout=30, save_path="C:/captures/02-dot.pcap") await packetsniffer_ops(operation="usb_payloads", file_path="C:/captures/02-dot.pcap", export_path="C:/captures/02-dot.bin") await packetsniffer_ops(operation="btsnoop_payloads", file_path="C:/captures/btsnoop_hci.log", direction="tx") await packetsniffer_ops(operation="diff_captures", file_path="C:/captures/01-blank.pcap", file_path_b="C:/captures/02-dot.pcap")
Inputs: operation (required), count, limit, timeout, +15 more. Returns: object
statusB
Server health and version.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Most tools target distinct concerns, but 'status' and 'packetsniffer_mcp_status_card' both expose server health (differing only in output format), and 'agentic_packetsniffer_mcp_workflow' has a vague, undefined purpose that overlaps conceptually with both chat and ops orchestration. An agent can mostly tell them apart, but the redundancy and the fuzzy workflow tool create real selection risk.
All names are snake_case, but prefixing is inconsistent: three tools carry a 'packetsniffer'/'agentic_packetsniffer_mcp' namespace prefix while 'help', 'status', and 'chat' are bare, and the naming mixes workflow-style, health-style, and action-style conventions. Readable but not a predictable pattern.
Six top-level tools is a reasonable, well-scoped surface for this server. However, 'packetsniffer_ops' is an over-consolidated mega-tool packing roughly 14 distinct operations, which pushes complexity into a single tool rather than the count itself.
The ops tool covers the sniffing lifecycle well: interface discovery, blocking/background capture, capture status, stop, PCAP decode and analysis, plus USB and Bluetooth payload extraction and diffing. Minor gaps remain (no live stream display, packet injection, or filter validation), but core workflows are covered.
Maintenance
Related MCP Connectors
IP intelligence, network diagnostics, and AI service availability tools for AI agents.
Live browser debugging for AI assistants — DOM, console, network via MCP.
Agentic cybersecurity tool: URL phishing/malware scanning and more.
Protocol-native energy infrastructure orchestration for AI data centers. Provides 46 MCP tools across 8 grid protocols (IEC-61850, DNP3, Modbus, OCPP, OpenADR, IEEE 2030.5, IEC 60870-5-104, ICCP) with 5 core API primitives: connect, dispatch, settle, comply, and intel. Enables AI agents to programmatically interact with substations, grid interfaces, and energy assets for real-time workload-grid coordination.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with direct access to Wireshark network analysis capabilities, enabling AI-powered network troubleshooting, packet analysis, and network monitoring through a secure interface.14MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to analyze, filter, and capture network traffic using Wireshark/tshark, allowing natural language interaction with packet captures.14261 PyPI69MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to analyze network traffic using Wireshark/tshark, providing packet statistics, protocol analysis, and anomaly detection through natural language interaction.75MIT
- FlicenseCqualityDmaintenanceEnables LLMs to capture, analyze, and summarize network traffic using Wireshark CLI tools, supporting live capture, pcap analysis, and LLM-oriented summaries.76-