About Wireshark MCP Server
Wireshark MCP Server is an MCP server built on TShark that lets AI agents capture live packets and analyze pcap and pcapng files. It runs with any stdio MCP host and exits at startup if TShark is missing, so hosts show it as offline rather than exposing a broken tool list.
Key features
- 01Live capture and pcap/pcapng analysis tools
- 02Guided workflows through MCP prompts
- 03Startup preflight check for TShark
- 04setup and doctor command line helpers
- 05Allowlisted interfaces and argv-based subprocess calls
Use cases
- 01Troubleshooting network connectivity or performance issues
- 02Analyzing DNS or HTTP traffic in saved pcap files
- 03Reviewing network traffic for security concerns
MCP support
This project is an MCP server that exposes capture, traffic analysis and diagnostic tools, prompts and resources to MCP clients.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEWireshark MCP Server
Packet capture and analysis for AI agents via the Model Context Protocol (MCP).
Works with any stdio MCP host: Cursor, Claude Desktop, Claude Code, VS Code / Copilot, Windsurf, custom agents, and similar tools. No vendor lock-in — the host only needs to launch:
python -m wireshark_mcp
Version 0.2.2
| Docs (wiki) | |
|---|---|
| Setup for novices | Install TShark + this package |
| MCP clients | Cursor, Claude, VS Code, generic |
| Troubleshooting | Offline server, PATH issues |
| Security | Safe capture rules |
GitHub Pages (optional): set Settings → Pages → Source = GitHub Actions, then the Pages workflow publishes docs/ as HTML.
What you get
- Live capture and pcap/pcapng analysis through MCP tools
- Guided workflows via MCP prompts
- Startup preflight: if TShark is missing, the process exits so your host shows the server offline/error instead of a broken tool list
setup/doctorCLIs so a new user can configure paths without guessing
Requirements
- Python 3.10+
- TShark (
PATHorTSHARK_PATH) - Npcap (Windows) or libpcap (Unix) for live capture
- Authorization to capture on the target network
Quick start (5 minutes)
git clone https://github.com/A-G-U-P-T-A/wireshark-mcp
cd wireshark-mcp
python -m venv .venv
# Windows: .venv\Scripts\activate
# Unix: source .venv/bin/activate
python -m pip install -e .
python -m wireshark_mcp doctor
python -m wireshark_mcp setup
setup detects TShark (or asks for its path) and writes or prints a standard mcpServers JSON block. Point your host at that config, then reload / restart the host.
Windows Wireshark install:
winget install --id WiresharkFoundation.Wireshark -e
MCP config (any host)
{
"mcpServers": {
"wireshark": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["-m", "wireshark_mcp"],
"env": {
"TSHARK_PATH": "/absolute/path/to/tshark"
}
}
}
}
Windows example paths:
- Python:
C:\\Users\\YOU\\...\\wireshark-mcp\\.venv\\Scripts\\python.exe - TShark:
C:\\Program Files\\Wireshark\\tshark.exe
Ready-made template: examples/mcpServers.wireshark.json
Client-specific file locations: docs/Clients.md
CLI
| Command | Purpose |
|---|---|
python -m wireshark_mcp | Run the MCP server (stdio) |
python -m wireshark_mcp doctor | JSON dependency report (exit 0/1) |
python -m wireshark_mcp setup | Interactive TShark + host config |
python -m wireshark_mcp setup --client print | Print JSON only |
Project layout
src/wireshark_mcp/ # MCP server package (tools, prompts, preflight)
examples/ # Sample mcpServers JSON
docs/ # Setup wiki for novices
tests/ # pytest (no live capture by default)
.cursor/skills/ # Optional Cursor agent skill
pyshark_mcp.py # Thin legacy shim
Tools (selected)
| Area | Tools |
|---|---|
| Setup | check_environment, configure_tshark |
| Capture | list_interfaces, quick_capture, capture_live_packets, save_capture_to_file |
| Analysis | read_pcap_file, analyze_traffic, deep_packet_analysis, quick_traffic_analysis |
| App protocols | analyze_dns_traffic, analyze_http_traffic, analyze_http_traffic_tabular |
| Diagnostics | protocol_hierarchy_statistics, expert_information, filtered_packet_display |
Prompts & resources
Prompts: packet_capture_help, investigate_live_traffic, analyze_pcap_file, security_traffic_review, safe_capture_rules
Resources: pyshark://version, pyshark://config (allow_simulation is always false)
Security
- Interfaces allowlisted from
tshark -D; shell metacharacters rejected - Subprocesses use argv +
shell=False - Failures return errors — no simulated packets
Details: docs/Security.md
Tests & CI
python -m pip install -e ".[dev]"
pytest -q -m "not live"
GitHub Actions installs TShark on Ubuntu and runs the non-live suite.
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.