WiFi PCAP Analyzer MCP
This server provides a local MCP tool set for inspecting Wi-Fi PCAP/PCAPNG files through TShark, including capture lifecycle management, metadata analysis, packet filtering/dissection, correlation, and export.
Load, list, reload, and unload capture files by session-unique capture ID
Configure Wi-Fi decryption keys (WEP, WPA-PWD, WPA-PSK, TK, MSK) in memory
Get packet summaries, capture metadata, traffic statistics, interfaces, time ranges, and validation issue reports
Filter packets using Wireshark display filters such as
dns,tcp.port == 443, orwlan.fc.retry == 1Dissect individual packets by Wireshark frame number and retrieve full decoded protocol fields
Retrieve packets by time range or frame-number range with compact summaries
Find related packets by stream, transaction, client MAC, AP BSSID, or endpoint heuristics
Generate chronological packet timelines with delta and elapsed times
Fetch packets for TCP/UDP/QUIC/TLS/HTTP flows and DNS/DHCP/TCP/EAPOL/ARP transactions
Export filtered packets to new
.pcapor.pcapngfiles without overwriting the source capture
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., "@WiFi PCAP Analyzer MCP Load C:\captures\wifi.pcapng and summarize its packets"
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.
WiFi PCAP Analyzer MCP
A local MCP server for inspecting Wi-Fi PCAP and PCAPNG files through PyShark, TShark, and Capinfos.
Architecture
MCP API tools
↓
application services
↓
domain contracts and models
↓
filesystem, repository, and TShark adaptersThe code uses a standard src package layout:
src/wifi_pcap_mcp/
├── server.py Composition and MCP runtime
├── api/ MCP tools, responses, and the error boundary
├── application/services/ Capture, packet, analysis, and export workflows
├── domain/ Models, repository contracts, typed errors
├── adapters/ Filesystem, repository, TShark, and Capinfos adapters
└── config/ Shared configuration constantsEvery registered tool passes through api/error_boundary.py. Expected
application failures receive stable error codes, while unexpected failures are
logged to stderr with an error ID and returned without a traceback. Successful
and failed calls share this envelope:
{"ok": true, "data": {}, "error": null}The repository stores capture metadata and keys, not live PyShark readers. A fresh reader is created and closed for each analysis call.
For a full tool catalog, end-to-end prompts, useful Wireshark filters, and structured error tests, see MCP Server Testing Guide.
Related MCP server: noc-pcap-mcp-server
Prerequisites
VS Code with GitHub Copilot and GitHub Copilot Chat
Python 3.13 for Windows
Wireshark with TShark installed
On Windows, install Wireshark with TShark selected. Create the virtual environment and install the project:
& "$env:LOCALAPPDATA\Programs\Python\Python313\python.exe" -m venv .venv-windows
& ".\.venv-windows\Scripts\python.exe" -m pip install -e .The server checks PATH, TSHARK_PATH, and the standard
C:\Program Files\Wireshark\tshark.exe location, so TShark does not have to be
on PATH when Wireshark is installed in its default directory.
Connect to GitHub Copilot in VS Code
The parent workspace already contains .vscode/mcp.json. Open the MCP folder
(the parent of this directory) in VS Code, then:
Open the Command Palette with
Ctrl+Shift+P.Run MCP: List Servers.
Select wifiPcapAnalyzer, then select Start.
Review and accept VS Code's trust prompt.
Open Copilot Chat, select Agent, and use Configure Tools to confirm that
load_capture,get_summary,filter_packets, anddissect_packetare enabled.
The workspace configuration launches
.venv-windows\Scripts\python.exe directly. It does not use WSL.
Try it
Use an absolute Windows path so the server can find the capture reliably:
Load the Wi-Fi capture at C:\captures\sample.pcap with capture ID sample-wifi,
summarize it, and identify the most useful Wireshark display filters for
investigating it.Copilot should first call load_capture. That tool returns a capture_id.
Copilot can pass that ID to the other tools.
Troubleshooting
Server does not start: run MCP: List Servers > wifiPcapAnalyzer > Show Output.
tsharknot found: install Wireshark/TShark, or setTSHARK_PATHto the full path oftshark.exebefore starting VS Code.Python path changed: recreate
.venv-windows, then updatecommandin.vscode/mcp.jsonif the workspace was moved.Tools changed but Copilot shows the old list: run MCP: Reset Cached Tools, then restart the server.
Run without Copilot
From this directory, start the stdio server with either command:
& ".\.venv-windows\Scripts\python.exe" server.py
& ".\.venv-windows\Scripts\wifi-pcap-mcp.exe"The command appears to wait without printing anything; that is normal for a stdio MCP server because it is waiting for an MCP client.
Available Tools
23 toolsdissect_packetA
Return the decoded protocol layers and fields for one frame.
Frame numbers are the one-based frame.number values shown by Wireshark.
Use filter_packets or validation example frames to discover relevant
numbers. A valid but absent frame is a successful result with
found=false rather than an error.
Args: capture_id: ID of a currently loaded capture. packet_number: Positive, one-based Wireshark frame number.
Returns: Capture/frame identity, found flag, packet summary, and decoded fields grouped by protocol layer when the frame exists.
Inputs: capture_id (required), packet_number (required). Returns: object
export_filtered_captureA
Write packets matching a display filter to a new capture file.
The export uses a temporary file and replaces the destination only after TShark succeeds. It never allows the source capture to be overwritten. Configured decryption keys are applied while filtering.
Args:
capture_id: ID of a currently loaded capture.
filter_expression: Non-empty Wireshark display filter selecting packets.
output_path: Destination ending in .pcap or .pcapng. Its parent
directory must already exist and be writable by the server.
overwrite: Allow replacement of an existing destination when true.
Defaults to false.
Returns: Capture ID, normalized filter, resolved output path, name, and size.
Inputs: capture_id (required), output_path (required), filter_expression (required), overwrite. Returns: object
filter_packetsA
Find packets using a Wireshark/TShark display-filter expression.
Use standard display filters such as dns, tcp.port == 443,
wlan.fc.retry == 1, or frame.number >= 10 && frame.number <= 20.
This returns summaries rather than complete field trees; use
dissect_packet on interesting frame numbers for full details.
Args: capture_id: ID of a currently loaded capture. filter_expression: Non-empty Wireshark display filter. This is not a BPF/libpcap capture filter. limit: Maximum results to return, from 1 through 1000. Defaults to 100.
Returns: Normalized filter, match count returned, and packet summaries containing frame number, Unix timestamp, protocols, and textual dissection.
Inputs: capture_id (required), filter_expression (required), limit. Returns: object
get_ap_packetsA
Retrieve IEEE 802.11 packets associated with an access-point BSSID.
The query uses the decoded wlan.bssid field and therefore requires an
IEEE 802.11 capture containing that field. Hyphenated and colon-separated
MAC input is accepted and normalized before filtering.
Args:
capture_id: ID of a currently loaded capture.
bssid: AP/BSSID MAC address such as aa:bb:cc:dd:ee:ff.
limit: Maximum results to return, from 1 through 1000.
Returns: Normalized BSSID, generated display filter, packet count, truncation flag, and matching packet summaries.
Inputs: bssid (required), capture_id (required), limit. Returns: object
get_capture_interfacesA
List capture interfaces or radio adapters stored in the file.
This is a focused view of get_capture_metadata for multi-interface
PCAPNG files. Interface fields depend on what the capture writer recorded.
Args: capture_id: ID of a currently loaded capture.
Returns: Interface count and available names, link types, snap lengths, timestamp precision, operating systems, and packet counts.
Inputs: capture_id (required). Returns: object
get_capture_metadataA
Inspect PCAP/PCAPNG container and capture-interface metadata.
Use this for file format, encapsulation, snap length, timestamp precision, capture origin, comments, time range, and per-interface information. The result comes primarily from Capinfos and does not return packet dissections.
Args: capture_id: ID of a currently loaded capture.
Returns: File, timing, capture-host, and interface metadata when available.
Inputs: capture_id (required). Returns: object
get_capture_statisticsA
Calculate aggregate traffic rates and packet-size statistics.
This combines Capinfos totals with a TShark pass over frame lengths. Use it to assess capture volume, duration, average traffic rate, and minimum, maximum, and average packet sizes.
Args: capture_id: ID of a currently loaded capture.
Returns: Packet/byte totals, file size, timing, rates, and packet-size metrics.
Inputs: capture_id (required). Returns: object
get_capture_time_rangeA
Divide the capture time range into packet and byte-count buckets.
Use this to locate bursts, quiet intervals, or the portion of a capture worth filtering in more detail. Every packet is assigned to one evenly sized time bucket.
Args: capture_id: ID of a currently loaded capture. bucket_count: Number of buckets to generate, from 1 through 100. Defaults to 20.
Returns: Overall time range plus timestamped packet/byte totals per bucket.
Inputs: capture_id (required), bucket_count. Returns: object
get_client_packetsA
Retrieve IEEE 802.11 packets involving a Wi-Fi client MAC address.
The query uses wlan.addr so it matches the client in any applicable
transmitter, receiver, source, or destination address role. Hyphenated and
colon-separated MAC input is accepted and normalized.
Args:
capture_id: ID of a currently loaded capture.
client_mac: Client MAC address such as aa:bb:cc:dd:ee:ff.
limit: Maximum results to return, from 1 through 1000.
Returns: Normalized client MAC, generated display filter, packet count, truncation flag, and matching packet summaries.
Inputs: capture_id (required), client_mac (required), limit. Returns: object
get_flow_packetsA
Retrieve packets belonging to a decoded transport or application flow.
Flow IDs are TShark stream identifiers, not port numbers. TLS and HTTP
flows use their underlying tcp.stream and additionally require the
selected application protocol to be present on the packet.
Args: capture_id: ID of a currently loaded capture. flow_type: One of tcp, udp, quic, tls, or http. flow_id: Non-negative TShark stream identifier. limit: Maximum results to return, from 1 through 1000.
Returns: Normalized flow type and ID, generated display filter, packet count, truncation flag, and matching packet summaries.
Inputs: flow_id (required), flow_type (required), capture_id (required), limit. Returns: object
get_packet_by_numberA
Retrieve and fully decode one packet by its Wireshark frame number.
This is a lookup-oriented alias of dissect_packet. Frame numbers are
one-based values from frame.number; an absent frame returns
found=false instead of raising an error.
Args: capture_id: ID of a currently loaded capture. packet_number: Positive frame.number value.
Returns: Capture/frame identity, found flag, packet summary, timestamp, protocol list, and decoded fields grouped by layer.
Inputs: capture_id (required), packet_number (required). Returns: object
get_packets_between_framesA
Retrieve packets in an inclusive Wireshark frame-number range.
Both range boundaries are included. Results contain compact packet summaries so a caller can select individual frames for detailed dissection without decoding every field in the requested range.
Args: capture_id: ID of a currently loaded capture. start_frame: Inclusive first frame number. end_frame: Inclusive last frame number. limit: Maximum number of packets, from 1 through 1000.
Returns: Requested frame range, generated display filter, returned count, truncation flag, and packet summaries.
Inputs: end_frame (required), capture_id (required), start_frame (required), limit. Returns: object
get_packets_by_time_rangeA
Retrieve packets whose Unix timestamps fall within an inclusive range.
Times use seconds since the Unix epoch, matching frame.time_epoch in
Wireshark. Results are summaries; call dissect_packet when full decoded
fields are required for an individual frame.
Args: capture_id: ID of a currently loaded capture. start_time: Inclusive Unix epoch start time. end_time: Inclusive Unix epoch end time. limit: Maximum number of packets, from 1 through 1000.
Returns: Requested range, normalized display filter, returned packet count, truncation flag, and packet summaries.
Inputs: end_time (required), capture_id (required), start_time (required), limit. Returns: object
get_packet_timelineA
Generate a chronological timeline of packet events.
The optional expression is a Wireshark display filter, not a capture filter. Events include deltas from the previous timestamp and elapsed time from the first returned event, making exchanges easier to inspect.
Args: capture_id: ID of a currently loaded capture. filter_expression: Optional Wireshark display filter. limit: Maximum number of timeline events.
Returns: Ordered events containing frame, timestamp, delta, elapsed time, protocols, textual summary, result count, and truncation status.
Inputs: capture_id (required), limit, filter_expression. Returns: object
get_summaryA
Produce a quick packet-level overview of a loaded capture.
This iterates through the full capture and is useful as the first analysis call after loading. It reports packet count, observed protocol-layer names, first/last Unix timestamps, and duration.
Args: capture_id: ID of a currently loaded capture.
Returns: Packet count, sorted protocols, start/end timestamps, and duration.
Inputs: capture_id (required). Returns: object
get_transaction_packetsA
Retrieve packets belonging to a DNS, DHCP, TCP, EAPOL, or ARP exchange.
DNS and DHCP keys may be decimal or 0x-prefixed transaction IDs; TCP
uses a stream number. Because EAPOL and ARP lack a universal transaction
number, their keys are a client MAC and IPv4 protocol address respectively.
Args: capture_id: ID of a currently loaded capture. transaction_type: One of dns, dhcp, tcp, eapol, or arp. transaction_key: Protocol-specific ID, stream, MAC, or IPv4 address. limit: Maximum results to return, from 1 through 1000.
Returns: Normalized transaction type and key, generated display filter, packet count, truncation flag, and matching packet summaries.
Inputs: capture_id (required), transaction_key (required), transaction_type (required), limit. Returns: object
list_loaded_capturesA
List every capture registered in the current MCP server session.
Use this to discover available capture IDs or confirm load/reload/unload operations. It reads only in-memory metadata and never rescans capture contents. Decryption-key values are never returned.
Returns: Capture count and metadata for each capture, including path, size, modification/load times, revision, and decryption-key configuration.
Inputs: no named parameters. Returns: object
load_captureA
Register a local packet-capture file for subsequent analysis.
Call this before using tools that accept capture_id. The server stores
the resolved path and file metadata in memory, but does not copy, modify, or
keep the capture open. Loading an existing ID is idempotent and reports
already_loaded.
Args:
capture_id: Non-empty session-unique name chosen by the caller, such as
office_wifi. Leading and trailing whitespace is removed.
file_path: Local path to an existing .pcap or .pcapng file that
is accessible to the MCP server process.
Returns: Load status, normalized capture ID, resolved path, file name, and size.
Inputs: file_path (required), capture_id (required). Returns: object
reload_captureA
Refresh a loaded capture after its source file changes.
The tool verifies the original file again, updates its path, size, modification time, and load time, and increments the capture revision. It does not scan packets during the reload.
Args: capture_id: ID of a currently loaded capture. clear_decryption_keys: When true, remove all keys stored for this capture. The default preserves them.
Returns:
Refreshed metadata, new revision number, and a reloaded flag.
Inputs: capture_id (required), clear_decryption_keys. Returns: object
set_decryption_keysA
Configure Wi-Fi decryption keys for later packet analysis.
Keys exist only in server memory and are passed to TShark whenever the
capture is read. Secret values are never included in tool responses or
normal logs. Supported key types are wep, wpa-pwd, wpa-psk,
tk, and msk.
Args:
capture_id: ID of a currently loaded capture.
keys: Key objects containing key_type and value. For example,
[{"key_type": "wpa-pwd", "value": "password:SSID"}].
replace_existing: Replace existing keys when true; append when false.
Passing an empty list with true clears all keys.
Returns: Capture ID, configured key count, and key types. Values are omitted.
Inputs: keys (required), capture_id (required), replace_existing. Returns: object
unload_captureA
Remove a loaded capture from the current server session.
This forgets the capture metadata and any configured decryption keys. It never deletes or changes the source PCAP/PCAPNG file.
Args:
capture_id: ID previously supplied to load_capture.
Returns:
The removed capture ID and an unloaded confirmation flag.
Inputs: capture_id (required). Returns: object
validate_captureA
Validate capture readability and identify common packet-quality issues.
Checks malformed packets, captured-length truncation, missing core frame fields, severe decode failures, unsupported protocols, timestamps, and strict chronological order. Issue categories can overlap.
Args: capture_id: ID of a currently loaded capture. example_limit: Maximum frame numbers retained for each issue, from 0 through 100. Counts always include all matches.
Returns: Overall validity/readability, packet count, time-order status, and issue counts with example frame numbers.
Inputs: capture_id (required), example_limit. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Most tools are clearly separated into lifecycle, metadata, and packet-retrieval roles, and the descriptions are detailed about input types. However, dissect_packet and get_packet_by_number are explicit aliases, and several TCP/DNS retrieval tools overlap enough to create misselection risk.
All tool names follow a consistent snake_case verb_noun pattern with predictable prefixes like load_, get_, set_, and filter_. Singular/plural noun choices are consistent with the returned data, and even the redundant get_packet_by_number is name-consistent.
At 23 tools, the server sits in the heavy 16-25 range and is borderline appropriate for a full PCAP analyzer. The count is defensible given the breadth of metadata, validation, and Wi-Fi-specific retrieval features, but the duplicate dissection tool and overlapping retrieval variants mean it could be trimmed without losing capability.
The server covers capture lifecycle, decryption-key configuration, export, metadata and statistics, validation, timeline analysis, generic filtering, per-frame dissection, and Wi-Fi-specific client/AP/transaction views. No major operational gap is apparent for file-based WiFi packet-capture analysis.
Maintenance
Related MCP Connectors
Voice quality analysis: PVQA and AQuA MOS for WAV files, VoIP call analysis for PCAPs
Offline log parsing, CI failures, HTTP capture analysis and bounded JSON configuration validation.
Capture web pages as cryptographically signed, tamper-evident evidence with WACZ archives.
12 Binary/Forensics MCP tools: entropy triage, ELF/PE/WASM disasm, PCAP, EXIF, SQLite, ZIP.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables Wireshark-like PCAP analysis through tshark, providing tools for filtering packets, extracting protocol fields, drilling down into frames, session tracking, and timeline analysis for troubleshooting 5G, IMS/SIP, and network protocol issues.-
- AlicenseAqualityDmaintenanceEnables LLM-based assistants to diagnose network problems from PCAP/PCAPNG packet captures, offering tools for capture summaries, TCP conversation analysis, security anomaly detection, and JSON-RPC extraction without requiring Wireshark.5MIT
- AlicenseAqualityCmaintenanceEnables AI agents to analyze local or base64-encoded PCAP/PCAPng captures through bounded MCP tools for protocol summaries, conversations, DNS/HTTP/TLS/QUIC inspection, credential and beacon detection, entropy checks, filtering, and Zeek-compatible export.1524 npm3Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants and security analysts to inspect PCAP/PCAPNG captures through MCP tools or REST endpoints, reassembling TCP/UDP streams, extracting payload artifacts, detecting CTF flags, credential leaks and network anomalies, and generating formal PDF or Markdown forensic reports. Every finding is bound to exact frame numbers, timestamps and endpoints with SHA-256 deduplicated evidence provenance.MIT