SharkMCP
Enables LLMs to load and analyze PCAP/PCAPNG files using Wireshark's sharkd interface, supporting packet inspection, traffic structure, conversations, and protocol statistics through natural language.
README
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)
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 sharkmcp
Configuration
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 |
|---|---|---|
SHARKMCP_SHARKD_BIN |
sharkd |
Path to sharkd binary |
SHARKMCP_TIMEOUT |
300 |
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_pcap(path, alias?) |
Load a PCAP/PCAPNG file |
list_pcaps() |
List all loaded PCAPs |
unload_pcap(alias) |
Terminate session and free memory |
Overview
| Tool | Description |
|---|---|
pcap_summary(alias) |
Frame count, duration, file size, protocols seen |
server_info(alias) |
All available tap types, follow protocols, field types |
Packet Inspection
| Tool | Description |
|---|---|
list_packets(alias, filter?, columns?, refs?) |
Paginated frame list with display filter |
packet_detail(alias, frame, include_bytes?, include_hidden?) |
Full protocol tree for one frame |
extract_fields(alias, fields, filter?) |
Extract arbitrary fields per packet as a table |
Utilities
| Tool | Description |
|---|---|
validate(alias, filter?, field?) |
Validate a display filter and/or field name |
complete(alias, field?, pref?) |
Autocomplete field or preference names by prefix |
get_preference(alias, preference?) |
Read dissector preferences |
set_preference(alias, name, value) |
Set a dissector preference for this session |
set_frame_comment(alias, frame, comment) |
Annotate a frame (session-scoped) |
Traffic Structure
| Tool | Description |
|---|---|
protocol_hierarchy(alias, filter?) |
Nested protocol tree with frame/byte counts |
io_stats(alias, interval_ms?, filter?) |
Per-interval frame and byte counts |
iograph(alias, graphs, interval_ms?, filters?) |
Multi-line traffic graph; supports packets, bytes, bits, sum:<field>, avg:<field>, min:<field>, max:<field>, load:<field>, frames:<field> |
follow_stream(alias, protocol, filter) |
Reassemble a stream (tcp, udp, tls, http, http2, quic, sip, dccp, websocket) |
Conversations & Topology
| Tool | Description |
|---|---|
conversations(alias, type?, sort_by?) |
Conversation table — bytes/frames per peer pair |
endpoints(alias, type?, sort_by?) |
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 |
|---|---|
expert_info(alias, filter?) |
Per-frame anomaly detection — errors, warnings, notes, chats |
protocol_stats(alias, protocol) |
Aggregate stats for dns, http, http_requests, http_server, sip, dhcp, h225, http2, rtsp |
service_response_time(alias, protocol) |
Request/response latency for smb, smb2, snmp, ldap, diameter, rpc, gtp, and more |
response_time_delay(alias, protocol) |
Round-trip delay for radius, h225_ras, megaco, mgcp |
sequence_diagram(alias, type?) |
Flow diagram data for tcp, icmp, icmpv6, any |
Media & VoIP
| Tool | Description |
|---|---|
voip_calls(alias, filter?) |
SIP/H.323 call list with state and participants |
rtp_streams(alias, stream_spec?) |
RTP stream inventory; pass stream_spec for per-stream jitter/loss |
multicast_streams(alias, filter?) |
UDP multicast stream statistics |
Export & Objects
| Tool | Description |
|---|---|
export_objects(alias, type?) |
List extractable objects (http, imf, smb, tftp, dicom, ftp-data) |
download_object(alias, token) |
Download an object, TLS session keys (ssl-secrets), or RTP audio (rtp:<spec>) as base64 |
Escape Hatch
| Tool | Description |
|---|---|
tap(alias, specs, filter?, skip?, limit?) |
Run any sharkd tap directly — up to 16 specs in one PCAP scan. Use server_info to discover valid identifiers. |
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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。