SharkMCP
Provides tools for loading and analyzing PCAP/PCAPNG files using Wireshark's sharkd, enabling AI agents to inspect network packets, conversations, protocol statistics, and more.
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., "@SharkMCP load capture.pcapng and show summary"
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.
SharkMCP
An MCP server that exposes sharkd — Wireshark's programmatic interface — as a set of tools for LLMs. Load PCAP/PCAPNG files and analyse them with natural language.
Requirements
Python 3.10+
Wireshark (provides
sharkd)
Related MCP server: Wireshark MCP
Installation
git clone https://github.com/weirdmachine64/sharkmcp.git
cd sharkmcp
pip install -e .Or run directly from the repo without installing:
uvx --from git+https://github.com/weirdmachine64/sharkmcp sharkmcpConfiguration
Add to your .mcp.json:
{
"mcpServers": {
"sharkmcp": {
"command": "uvx",
"args": ["--from", "git+https://github.com/weirdmachine64/sharkmcp", "sharkmcp"],
"env": {
"SHARKMCP_TIMEOUT": "300"
}
}
}
}Env var | Default | Description |
|
| Path to sharkd binary |
|
| Per-request timeout in seconds |
Tools
Each loaded PCAP gets a dedicated sharkd subprocess. Results from expensive scans (conversations, expert info, export objects) are cached in memory so paginated follow-up calls are served without re-scanning.
Session
Tool | Description |
| Load a PCAP/PCAPNG file |
| List all loaded PCAPs |
| Terminate session and free memory |
Overview
Tool | Description |
| Frame count, duration, file size, protocols seen |
| All available tap types, follow protocols, field types |
Packet Inspection
Tool | Description |
| Paginated frame list with display filter |
| Full protocol tree for one frame |
| Extract arbitrary fields per packet as a table |
Utilities
Tool | Description |
| Validate a display filter and/or field name |
| Autocomplete field or preference names by prefix |
| Read dissector preferences |
| Set a dissector preference for this session |
| Annotate a frame (session-scoped) |
Traffic Structure
Tool | Description |
| Nested protocol tree with frame/byte counts |
| Per-interval frame and byte counts |
| Multi-line traffic graph; supports |
| Reassemble a stream ( |
Conversations & Topology
Tool | Description |
| Conversation table — bytes/frames per peer pair |
| Endpoint table — tx/rx per host |
Supported layer types for both: tcp, udp, ip, ipv6, eth, sctp, dccp, mptcp, wifi, bluetooth, zigbee, fc, fddi, usb, and more.
Protocol Statistics
Tool | Description |
| Per-frame anomaly detection — errors, warnings, notes, chats |
| Aggregate stats for |
| Request/response latency for |
| Round-trip delay for |
| Flow diagram data for |
Media & VoIP
Tool | Description |
| SIP/H.323 call list with state and participants |
| RTP stream inventory; pass |
| UDP multicast stream statistics |
Export & Objects
Tool | Description |
| List extractable objects ( |
| Download an object, TLS session keys ( |
Escape Hatch
Tool | Description |
| Run any sharkd tap directly — up to 16 specs in one PCAP scan. Use |
Example
> load_pcap("/captures/traffic.pcap", alias="traffic")
> protocol_hierarchy("traffic")
> expert_info("traffic", limit=20)
> conversations("traffic", type="tcp", sort_by="bytes")
> extract_fields("traffic", ["dns.qry.name", "dns.a"], filter="dns")
> follow_stream("traffic", "http", "tcp.stream eq 0")
> export_objects("traffic", type="http")
> download_object("traffic", "eo:http_0")Architecture
LLM
│ MCP (stdio)
▼
SharkMCP server
│ JSON-RPC 2.0 (stdin/stdout)
├─ sharkd [pcap-1]
├─ sharkd [pcap-2]
└─ sharkd [pcap-N]One sharkd subprocess per loaded PCAP. Sessions are isolated — concurrent queries on different aliases never block each other.
Available Tools
30 toolscompleteA
Autocomplete field names or preference names by prefix.
field — field prefix, e.g. "tcp." → all tcp.* dissector fields.
pref — preference prefix, e.g. "tcp." → all tcp.* preferences.
At least one of field or pref must be provided.
Dense protocols (e.g. "opcua.") can return thousands of entries;
limit caps the list (0 = no cap).
Inputs: alias (required), field, pref, limit.
conversationsB
Conversation table for a given layer. Sums frames/bytes per peer pair.
Results are sorted by sort_by (descending) and paged with skip/limit.
The PCAP is scanned only on the first call for a given filter; all
subsequent pages are served from an in-memory cache. Set limit=0 for all.
Inputs: alias (required), type, display_filter, sort_by, +2 more.
download_objectA
Download the raw content of an exportable object, TLS secrets, or RTP audio.
Tokens come from:
export_objects → "eo:http_0", "eo:imf_0", etc.
TLS session keys → "ssl-secrets" (NSS Key Log format, if embedded)
RTP audio stream → "rtp:<src_ip>_<src_port>_<dst_ip>_<dst_port>_<ssrc>"
Content is returned base64-encoded under the data key along with
the MIME type and original filename where available.
Inputs: alias (required), token (required).
endpointsA
Endpoint table for a given layer. Sums tx/rx frames and bytes per host.
Results are sorted by sort_by (descending) and paged with skip/limit.
The PCAP is scanned only on the first call for a given filter; all
subsequent pages are served from an in-memory cache. Set limit=0 for all.
Inputs: alias (required), type, display_filter, sort_by, +2 more.
expert_infoC
Per-frame expert diagnostics — errors, warnings, notes, and chats.
Returns Wireshark's built-in anomaly detection results: TCP retransmissions,
malformed packets, unusual sequences, and protocol violations.
Each entry contains frame number (f), severity (s), protocol (p),
and message (m). Results are cached after the first scan.
Inputs: alias (required), display_filter, skip, limit.
export_objectsA
List exportable objects of the given type found in the capture.
Each returned object includes a _download token that can be passed to
download_object to retrieve the raw content. Supported types:
http, dicom, smb, tftp, imf, ftp-data.
The PCAP is scanned only on the first call for a given type; subsequent pages are served from cache.
Inputs: alias (required), type, skip, limit.
extract_fieldsC
Extract arbitrary fields per packet, e.g.
["ip.src", "tcp.dstport", "http.host"]. Returns rows of dicts keyed
by field name.
Inputs: alias (required), fields (required), display_filter, skip, +1 more.
follow_streamB
Reassemble a stream. display_filter selects it (e.g. tcp.stream eq 3).
Returns client/server addrs and base64 payload chunks with direction.
Long-lived streams can produce huge payload lists; max_payloads caps
how many chunks are returned. Set to 0 for no cap.
Inputs: alias (required), protocol (required), display_filter (required), max_payloads.
get_preferenceA
Read one or all sharkd dissector preferences.
Pass a dotted preference name (e.g. "tcp.check_checksum") to read a
single value, or omit to dump all preferences. Useful for checking
whether a dissector is enabled or what port a protocol is bound to.
Inputs: alias (required), preference.
iographA
Per-interval traffic graph for up to 8 simultaneous lines.
Each entry in graphs must be one of:
"packets" | "bytes" | "bits" — basic counters
"sum:" | "avg:" — aggregate a numeric field per interval
"min:" | "max:" — min/max of a numeric field per interval
"load:" | "frames:" — bit-rate or frame count for a field
filters — optional per-graph display filters (parallel list to graphs);
enables multi-line graphs of different protocol streams.
Results are paged with skip/limit (default 300 buckets ≈ 5 min at 1 s).
Inputs: alias (required), graphs (required), interval_ms, filters, +2 more.
io_statsA
Per-interval frame and byte counts. interval_ms is the bucket size.
Results are in chronological order and paged with skip/limit.
The PCAP is scanned only on the first call for a given (interval, filter)
combination; subsequent pages are served from cache.
Default limit is 300 intervals (~5 min at 1 s buckets). Set limit=0 for all.
Inputs: alias (required), interval_ms, display_filter, skip, +1 more.
list_packetsC
Page through packets via sharkd frames.
display_filter accepts Wireshark display-filter syntax.
columns overrides the default column set with arbitrary field names
(e.g. ["frame.number", "ip.src", "tcp.dstport"]).
refs is a list of reference frame numbers for delta-time calculations.
Inputs: alias (required), display_filter, skip, limit, +2 more.
list_pcapsA
List every loaded PCAP with its current sharkd status.
Inputs: no named parameters. Returns: result
load_pcapA
Load a PCAP/PCAPNG file into a fresh sharkd session.
alias defaults to the basename. Each loaded PCAP keeps a dedicated
sharkd subprocess warm so subsequent queries are interactive.
Returns the alias and basic status (frame count, duration, file size).
Inputs: path (required), alias.
multicast_streamsB
UDP multicast stream statistics.
Returns per-stream packet counts, byte rates, and burst statistics for all UDP multicast flows in the capture.
Inputs: alias (required), display_filter.
packet_detailA
Full protocol tree for one frame.
include_bytes — add raw bytes (base64) per layer.
include_hidden — include hidden protocol tree fields.
ref_frame — reference frame number for delta-time display.
prev_frame — previous frame number for delta-time display.
Inputs: alias (required), frame_number (required), include_bytes, include_hidden, +2 more.
pcap_summaryC
Combined status + analyse: filename, size, frame count, duration,
protocols seen, first/last timestamps.
Inputs: alias (required).
protocol_hierarchyC
Protocol hierarchy stats — nested tree of frame/byte counts per protocol.
Inputs: alias (required), display_filter.
protocol_statsC
Protocol-level aggregate statistics.
protocol options: dns — query/response counts by type and return code http — HTTP request/response packet counters http_requests — requests grouped by URI http_server — load distribution across servers http_seq — HTTP request sequences http2 — HTTP/2 stream statistics rtsp — RTSP packet counters sip — SIP response code counters dhcp — DHCP message type distribution h225 — H.225 message and response status
Inputs: alias (required), protocol (required), display_filter.
response_time_delayC
Response time delay statistics for signalling protocols.
Measures per-transaction round-trip delay: h225_ras — H.225 RAS registration/admission delays megaco — MEGACO/H.248 gateway control delays mgcp — MGCP gateway control delays radius — RADIUS authentication/accounting delays
Inputs: alias (required), protocol (required), display_filter.
rtp_streamsB
RTP stream inventory and per-stream quality analysis.
Without stream_spec — returns all RTP streams with SSRC, codec,
packet count, and timing.
With stream_spec — returns jitter, packet loss, and sequence error
statistics for one stream. Format:
<src_ip>_<src_port>_<dst_ip>_<dst_port>_<ssrc>
e.g. 200.57.7.195_9762_200.57.7.196_26946_0xd2bd4e3e
Inputs: alias (required), stream_spec, display_filter.
sequence_diagramB
Flow sequence diagram data for visualising packet exchanges.
Returns time-ordered node and flow entries suitable for rendering a sequence diagram (equivalent to Wireshark's Flow Graph window). any — all flows tcp — TCP flows (handshakes, data, teardowns) icmp — ICMP echo request/reply flows icmpv6 — ICMPv6 flows
Inputs: alias (required), type, display_filter.
server_infoA
List all types available in this sharkd session: tap identifiers, follow protocols, column fields, and stats tree entries.
Useful for discovering valid values before calling conversations, endpoints, follow_stream, or protocol_hierarchy.
Inputs: alias (required).
service_response_timeC
Service response time statistics — min/max/avg latency per request type.
Measures the elapsed time between a protocol request and its response. Useful for detecting slow servers, network congestion, or anomalous response-time patterns in application protocols.
Inputs: alias (required), protocol (required), display_filter.
set_frame_commentA
Set a comment on a frame for the duration of this session (non-persistent).
Pass an empty string to clear an existing comment. Useful for annotating frames during forensic analysis.
Inputs: alias (required), frame_number (required), comment.
set_preferenceA
Set a sharkd dissector preference for this session.
Changes are session-scoped and do not persist after the server restarts.
Common uses: forcing a non-standard port to decode as a specific protocol
(e.g. name="http.tcp.port", value="8080"), or enabling/disabling a
dissector option.
Inputs: alias (required), name (required), value (required).
tapA
Run one or more sharkd statistics taps in a single PCAP scan.
specs — tap identifiers from server_info, e.g.
["expert", "conv:TCP", "stat:dns", "srt:smb"]
filter — global display filter applied to all taps (sharkd supports
only one filter per tap call; per-tap filters are iograph-only)
skip / limit — pagination applied to each tap's flat list result
Up to 16 specs per call (sharkd limit). Results are cached after the
first scan; paginated follow-up calls are served from memory.
Use server_info to discover all valid tap identifiers.
Inputs: alias (required), specs (required), filter, skip, +1 more.
unload_pcapB
Terminate the sharkd session for alias and free its memory.
Inputs: alias (required).
validateA
Validate a display-filter expression and/or a field name.
filter — Wireshark display filter (e.g. tcp.port == 443).
field — fully qualified field name (e.g. http.request.method).
Returns {"status":"OK"} on success or an error object.
At least one of filter or field must be provided.
Inputs: alias (required), filter, field.
voip_callsC
VoIP call list with state, duration, and participant addresses.
Detects SIP, H.323, MGCP, and SKINNY calls in the capture and reconstructs the call flow from signalling messages.
Inputs: alias (required), display_filter.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 30 tools
Each tool targets a distinct operation on packet capture data, such as loading, listing, extracting fields, following streams, or computing statistics. Overlaps like io_stats and iograph are clarified by descriptions (one simple counts, the other multi-line graphs). No two tools appear to do the same thing.
Tool names mix verb_noun patterns (list_pcaps, load_pcap, set_preference) with noun-only names (protocol_hierarchy, voip_calls, rtp_streams). While the naming is readable and uses snake_case consistently, the lack of a uniform verb prefix creates inconsistency.
30 tools cover a broad range of PCAP analysis features (loading, filtering, statistics, protocol details, export). This is slightly above the typical 15-20 but justified given the extensive functionality of Wireshark/sharkd. No obvious bloat.
The tool surface is comprehensive for analyzing packet captures: it covers file management, packet listing, field extraction, stream reassembly, export objects, multiple statistics taps, protocol-specific analysis, preferences, and validation. Missing features like live capture or saving are outside the server's stated purpose.
Maintenance
Related MCP Connectors
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
File tools for your AI chat: PDF tables to Excel, merge PDFs, images to PDF, fill PDF forms.
File uploads for AI agents. Upload, list, and manage files. No signup required.
Open, inspect, filter, edit and convert xlsx and csv files from your AI chat. Processing is local.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables LLMs to perform automated network forensics, threat hunting, and traffic analysis using Wireshark/TShark.344MIT
- 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-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with tshark and related command-line tools for live packet capture, PCAP analysis, filtering, stream following, and capture file merging.1MIT