Skip to main content
Glama

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 .pcap/.pcapng (yours, a colleague's, a router export). No admin needed.

packetsniffer_ops(operation="analyze_pcap", file_path="C:/captures/router.pcap")

"What is phoning home?" — watch DNS queries to find which app contacts which domain. Pass save_path to keep the raw capture as evidence.

packetsniffer_ops(operation="sniff", filter_expr="udp port 53", count=200, timeout=120, save_path="C:/captures/dns.pcap")

"Watch it in the background" — start a capture, don't block the agent. Poll, then collect. Survives across agent sessions in HTTP daemon mode.

start_capture → capture_status → stop_capture

"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).

packetsniffer_ops(operation="decode_pcap", file_path="C:/captures/dns.pcap", limit=100)

"Why is my service unreachable?" — capture traffic to one port and see whether packets arrive at all, and how the TCP handshake behaves.

packetsniffer_ops(operation="sniff", filter_expr="tcp port 10813", count=30)

"What is on my network?" — list interfaces before capturing.

packetsniffer_ops(operation="list_interfaces")

"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.

packetsniffer_ops(operation="usb_payloads", file_path="C:/captures/02-dot.pcap", export_path="C:/captures/02-dot.bin")

"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).

packetsniffer_ops(operation="btsnoop_payloads", file_path="C:/captures/btsnoop_hci.log")

"Which bytes encode the dot?" — diff two captures (blank label vs one-dot label): shared prefix/suffix, changed byte ranges, per-transfer differences.

packetsniffer_ops(operation="diff_captures", file_path="C:/captures/01-blank.pcap", file_path_b="C:/captures/02-dot.pcap")

"Capture USB while I operate the device" — wraps USBPcap's command line for a fixed duration. Unverified live (needs the USBPcap driver, administrator rights).

packetsniffer_ops(operation="usb_list_hubs") then packetsniffer_ops(operation="usb_capture", usb_hub="\\\\.\\USBPcap1", timeout=30, save_path="C:/captures/02-dot.pcap")

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_payloads and diff_captures work 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_hubs drive USBPcapCMD.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_pcap and decode_pcap work on files anywhere, no privileges.

  • decode_pcap needs tshark on PATH (ships with Wireshark — winget install Wireshark). Without it, the op returns a clean missing_dependency error, nothing else breaks.

  • Live sniff / start_capture require 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: count max 1000, timeout max 300s. Raise the ceilings via PACKETSNIFFER_MCP_MAX_SNIFF_COUNT / PACKETSNIFFER_MCP_MAX_SNIFF_SECONDS for 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_capture takes 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 install

Run

# 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.ps1

LLM Providers

Auto-detects local providers (Ollama on :11434, LM Studio on :1234). Configure via environment variables:

Variable

Purpose

PACKETSNIFFER_MCP_LLM_PROVIDER

ollama | lmstudio | openai | anthropic | google

PACKETSNIFFER_MCP_LLM_MODEL

Override model name

PACKETSNIFFER_MCP_LLM_API_KEY

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

Health check

GET

/api/v1/diagnostics

Full diagnostics (LLM, tools, system)

GET

/api/v1/tools

List all MCP tools

GET

/api/v1/providers

List LLM providers + presets

POST

/api/v1/chat

Chat with LLM (supports streaming)

Fleet Surface

Feature

Entry

Help

help tool

Status

status tool

Prefab card

packetsniffer_mcp_status_card

Chat

chat tool (multi-provider LLM)

Agentic

agentic_packetsniffer_mcp_workflow

Skills

resource://packetsniffer-mcp/skills

Capabilities

resource://packetsniffer-mcp/capabilities

CodeMode

--agentic or MCP_AGENTIC=1

License

MIT © 2026 MCP Studio

Available Tools

6 tools
agentic_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

chatA
Read-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_cardB
Read-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

    B3.1/5.0

    Scored across 6 tools

    Disambiguation3/5

    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.

    Naming Consistency3/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides AI assistants with direct access to Wireshark network analysis capabilities, enabling AI-powered network troubleshooting, packet analysis, and network monitoring through a secure interface.
      14
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to analyze network traffic using Wireshark/tshark, providing packet statistics, protocol analysis, and anomaly detection through natural language interaction.
      75
      MIT
    • F
      license
      C
      quality
      D
      maintenance
      Enables LLMs to capture, analyze, and summarize network traffic using Wireshark CLI tools, supporting live capture, pcap analysis, and LLM-oriented summaries.
      76
      -