Skip to main content
Glama

SharkMCP

sharkd(Wireshark의 프로그래밍 인터페이스)를 LLM을 위한 도구 세트로 노출하는 MCP 서버입니다. PCAP/PCAPNG 파일을 로드하고 자연어로 분석하세요.

요구 사항

  • Python 3.10+

  • Wireshark (sharkd 제공)

Related MCP server: Wireshark MCP

설치

git clone https://github.com/weirdmachine64/sharkmcp.git
cd sharkmcp
pip install -e .

또는 설치 없이 저장소에서 직접 실행:

uvx --from git+https://github.com/weirdmachine64/sharkmcp sharkmcp

구성

.mcp.json에 추가하세요:

{
  "mcpServers": {
    "sharkmcp": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/weirdmachine64/sharkmcp", "sharkmcp"],
      "env": {
        "SHARKMCP_TIMEOUT": "300"
      }
    }
  }
}

환경 변수

기본값

설명

SHARKMCP_SHARKD_BIN

sharkd

sharkd 바이너리 경로

SHARKMCP_TIMEOUT

300

요청당 타임아웃(초)

도구

로드된 각 PCAP은 전용 sharkd 하위 프로세스를 가집니다. 비용이 많이 드는 스캔(대화, 전문가 정보, 객체 내보내기 등)의 결과는 메모리에 캐시되므로, 페이지가 나뉜 후속 호출은 재스캔 없이 처리됩니다.

세션

도구

설명

load_pcap(path, alias?)

PCAP/PCAPNG 파일 로드

list_pcaps()

로드된 모든 PCAP 목록 표시

unload_pcap(alias)

세션 종료 및 메모리 해제

개요

도구

설명

pcap_summary(alias)

프레임 수, 지속 시간, 파일 크기, 감지된 프로토콜

server_info(alias)

사용 가능한 모든 탭 유형, 팔로우 프로토콜, 필드 유형

패킷 검사

도구

설명

list_packets(alias, filter?, columns?, refs?)

디스플레이 필터가 적용된 페이지 단위 프레임 목록

packet_detail(alias, frame, include_bytes?, include_hidden?)

단일 프레임에 대한 전체 프로토콜 트리

extract_fields(alias, fields, filter?)

패킷당 임의의 필드를 테이블로 추출

유틸리티

도구

설명

validate(alias, filter?, field?)

디스플레이 필터 및/또는 필드 이름 유효성 검사

complete(alias, field?, pref?)

접두사를 통한 필드 또는 기본 설정 이름 자동 완성

get_preference(alias, preference?)

디섹터(dissector) 기본 설정 읽기

set_preference(alias, name, value)

현재 세션에 대한 디섹터 기본 설정 지정

set_frame_comment(alias, frame, comment)

프레임 주석 달기 (세션 범위)

트래픽 구조

도구

설명

protocol_hierarchy(alias, filter?)

프레임/바이트 수가 포함된 중첩 프로토콜 트리

io_stats(alias, interval_ms?, filter?)

간격별 프레임 및 바이트 수

iograph(alias, graphs, interval_ms?, filters?)

다중 라인 트래픽 그래프; packets, bytes, bits, sum:<field>, avg:<field>, min:<field>, max:<field>, load:<field>, frames:<field> 지원

follow_stream(alias, protocol, filter)

스트림 재조합 (tcp, udp, tls, http, http2, quic, sip, dccp, websocket)

대화 및 토폴로지

도구

설명

conversations(alias, type?, sort_by?)

대화 테이블 — 피어 쌍당 바이트/프레임 수

endpoints(alias, type?, sort_by?)

엔드포인트 테이블 — 호스트당 송신/수신량

두 도구 모두 지원되는 계층 유형: tcp, udp, ip, ipv6, eth, sctp, dccp, mptcp, wifi, bluetooth, zigbee, fc, fddi, usb 등.

프로토콜 통계

도구

설명

expert_info(alias, filter?)

프레임별 이상 징후 탐지 — 오류, 경고, 참고, 채팅

protocol_stats(alias, protocol)

dns, http, http_requests, http_server, sip, dhcp, h225, http2, rtsp에 대한 집계 통계

service_response_time(alias, protocol)

smb, smb2, snmp, ldap, diameter, rpc, gtp 등에 대한 요청/응답 지연 시간

response_time_delay(alias, protocol)

radius, h225_ras, megaco, mgcp에 대한 왕복 지연 시간

sequence_diagram(alias, type?)

tcp, icmp, icmpv6, any에 대한 흐름 다이어그램 데이터

미디어 및 VoIP

도구

설명

voip_calls(alias, filter?)

상태 및 참가자가 포함된 SIP/H.323 통화 목록

rtp_streams(alias, stream_spec?)

RTP 스트림 인벤토리; 스트림별 지터/손실 확인을 위해 stream_spec 전달

multicast_streams(alias, filter?)

UDP 멀티캐스트 스트림 통계

내보내기 및 객체

도구

설명

export_objects(alias, type?)

추출 가능한 객체 목록 (http, imf, smb, tftp, dicom, ftp-data)

download_object(alias, token)

객체, TLS 세션 키(ssl-secrets) 또는 RTP 오디오(rtp:<spec>)를 base64로 다운로드

탈출구

도구

설명

tap(alias, specs, filter?, skip?, limit?)

sharkd 탭을 직접 실행 — 하나의 PCAP 스캔에서 최대 16개의 사양 사용 가능. 유효한 식별자를 찾으려면 server_info를 사용하세요.

예시

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

아키텍처

    LLM
     │  MCP (stdio)
     ▼
 SharkMCP server
     │  JSON-RPC 2.0 (stdin/stdout)
     ├─ sharkd [pcap-1]
     ├─ sharkd [pcap-2]
     └─ sharkd [pcap-N]

로드된 PCAP당 하나의 sharkd 하위 프로세스가 생성됩니다. 세션은 격리되어 있으며, 서로 다른 별칭(alias)에 대한 동시 쿼리는 서로를 차단하지 않습니다.

Available Tools

30 tools
completeA

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

    B3.4/5.0

    Scored across 30 tools

    Disambiguation5/5

    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.

    Naming Consistency3/5

    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.

    Tool Count4/5

    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.

    Completeness5/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers