Tshark MCP Server
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., "@Tshark MCP Server Analyze /pcaps/traffic.pcap for attacks"
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.
Tshark MCP Server
An MCP (Model Context Protocol) server for analyzing pcap files using tshark to detect potential network attacks and security threats.
Features
Automated Attack Detection: Analyzes pcap files for common attack patterns:
Port scanning attempts
DDoS indicators (traffic volume anomalies)
DNS tunneling and exfiltration
HTTP-based attacks (SQL injection, XSS)
Failed connection attempts
Suspicious IP addresses
Custom Queries: Run custom tshark queries with Wireshark display filters
Statistics: Get comprehensive pcap statistics including protocols and conversations
Related MCP server: PCAP MCP Server
Prerequisites
Option 1: Docker (Recommended - Most Portable)
Docker and Docker Compose installed
No other dependencies needed!
Option 2: Local Installation
Node.js (v16 or higher)
Tshark installed and available in PATH
Windows: Install Wireshark (includes tshark)
Linux:
sudo apt-get install tsharkmacOS:
brew install wireshark
Installation
Docker Setup (Recommended)
Build the Docker image:
docker-compose buildPlace your pcap files in the
pcaps/directory (or configure a custom volume in docker-compose.yml)Configure Claude Desktop with the Docker container:
Add to your Claude Desktop config file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"tshark": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v",
"/path/to/your/pcaps:/pcaps:ro",
"tshark-mcp-server:latest"
]
}
}
}Windows example:
{
"mcpServers": {
"tshark": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v",
"C:\\captures:/pcaps:ro",
"tshark-mcp-server:latest"
]
}
}
}Linux/Mac example:
{
"mcpServers": {
"tshark": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v",
"${HOME}/captures:/pcaps:ro",
"tshark-mcp-server:latest"
]
}
}
}Local Installation (Alternative)
Install dependencies:
npm installConfigure Claude Desktop:
{
"mcpServers": {
"tshark": {
"command": "node",
"args": ["/absolute/path/to/tshark-mcp/index.js"]
}
}
}Usage
After configuration, restart Claude Desktop. Your pcap files should be accessible at /pcaps/ (Docker) or their original paths (local).
Available Tools
1. analyze_pcap_attacks
Automatically analyzes a pcap file for security threats.
Parameters:
pcap_path(required): Path to the pcap file
Example:
# Docker: pcap files are in /pcaps inside container
Analyze /pcaps/traffic.pcap for attacks
# Local installation
Analyze c:\captures\traffic.pcap for attacksThe AI will automatically identify suspicious IPs and attack patterns.
2. query_pcap
Run custom tshark queries with display filters.
Parameters:
pcap_path(required): Path to the pcap filedisplay_filter(optional): Wireshark display filterfields(optional): Array of fields to extract
Examples:
# Docker
Show all HTTP GET requests from /pcaps/traffic.pcap
Query /pcaps/traffic.pcap with filter "ip.src==192.168.1.100 && tcp.port==443"
# Local
Show all HTTP GET requests from traffic.pcap
Extract source IPs and ports from traffic.pcap where tcp.flags.syn==13. get_pcap_stats
Get general statistics about a pcap file.
Parameters:
pcap_path(required): Path to the pcap file
Example:
Get statistics for traffic.pcapHow It Works
AI-Powered Analysis
When you use analyze_pcap_attacks, the server:
Runs multiple tshark queries to extract security-relevant data
Formats the results for AI analysis
The AI (Claude) analyzes the data to:
Identify suspicious IP addresses
Detect attack patterns
Explain potential threats
Provide remediation suggestions
Example Workflow
User: "Analyze /pcaps/suspicious.pcap"
AI Response:
Identifies potential attackers by IP
Explains attack types detected (port scan, DDoS, etc.)
Lists suspicious domains or URLs
Recommends next steps
User: "Show me all traffic from IP 192.168.1.50"
AI uses query_pcap:
Filters pcap for that specific IP
Shows relevant packets
Analyzes behavior
Docker Benefits
✅ Portability: Works on Windows, Linux, and macOS ✅ No Dependencies: Tshark is pre-installed in the container ✅ Isolation: Secure execution environment ✅ Easy Updates: Just rebuild the image ✅ Consistent: Same environment everywhere
Detection Capabilities
The server looks for:
Port Scanning: SYN packets to multiple ports from the same source
DDoS Attacks: Unusual traffic volumes from single sources
DNS Anomalies: Suspicious query patterns, potential tunneling
HTTP Attacks: SQL injection, XSS, directory traversal in URLs
Reconnaissance: Multiple failed connections (RST packets)
Protocol Anomalies: Unusual protocol usage patterns
Wireshark Display Filter Examples
Common filters you can use with query_pcap:
ip.addr==192.168.1.1 # Traffic to/from specific IP
tcp.port==80 # HTTP traffic
http.request.method==POST # POST requests
dns.qry.name contains "evil" # DNS queries with "evil"
tcp.flags.syn==1 && tcp.flags.ack==0 # SYN packets (port scan)
icmp.type==8 # ICMP echo requests (ping)Troubleshooting
"tshark: command not found"
Ensure tshark is installed and in your PATH
Restart Claude Desktop after installation
Permission errors on Linux:
sudo dpkg-reconfigure wireshark-common # Select "Yes"
sudo usermod -a -G wireshark $USERLog out and back in for changes to take effect.
Security Note
This tool is designed for defensive security analysis only. Use it to:
Analyze your own network traffic
Investigate security incidents
Learn about network security
Detect threats in authorized environments
License
MIT
Available Tools
4 toolsanalyze_pcap_attacksA
Analyze a pcap file for potential security threats and attacks. Returns suspicious IPs, port scans, DDoS indicators, DNS anomalies, HTTP attacks, and connection patterns.
Inputs: pcap_path (required).
get_pcap_statsA
Get general statistics about a pcap file including packet counts, protocols, and conversations.
Inputs: pcap_path (required).
investigate_dns_tunnelingA
Perform detailed DNS tunneling investigation. Identifies attack characteristics, starting packet number, source IP, OS fingerprinting via TTL, and entropy analysis. Perfect for forensic investigations.
Inputs: pcap_path (required), time_filter.
query_pcapC
Run a custom tshark query on a pcap file with optional display filters and field extraction. Use Wireshark display filter syntax.
Inputs: pcap_path (required), fields, display_filter.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct focus: general attack detection, custom queries, overall stats, and detailed DNS tunneling investigation. However, the general attack analysis in 'analyze_pcap_attacks' could overlap with the DNS tunneling investigation, creating slight ambiguity for agents that might pick the wrong tool for a specific subtask.
All tool names follow a consistent 'verb_noun' pattern in snake_case (e.g., analyze_pcap_attacks, query_pcap, get_pcap_stats, investigate_dns_tunneling), making it easy to predict functionality.
With only 4 tools, the server is well-scoped for pcap analysis. Each tool serves a clear purpose: statistics, custom queries, general attack detection, and specialized DNS tunneling investigation. No tool feels redundant or missing given the domain.
The tool set covers core pcap analysis tasks: statistics, custom queries, generic attack detection, and deep forensic investigation of DNS tunneling. A potential gap is the lack of a tool for direct file upload or results export, but 'query_pcap' with Wireshark syntax provides flexible extraction. Overall, it's reasonably complete for security analysis.
Related MCP Connectors
Passive OSINT and security recon: DNS, TLS, email posture, IP reputation, CVE/KEV, CT logs.
Threat intelligence: threats, detections (SPL/KQL/Sigma), IOCs, CVEs/CWEs, ATT&CK coverage, actors
Security log tools: Windows/Entra error codes, log explainer, IP blocklists, attack scans
TLPTOracle — 17-tool TIBER-EU TLPT framework: scope, threat intel, scenarios, reports.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAnalyzes PCAP/PCAPNG network capture files to detect port scanning techniques (SYN, FIN, Xmas), classify scan patterns, and enrich suspicious IP addresses with threat intelligence data. Provides comprehensive network security analysis through natural language interactions.MIT
- 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.-
- AlicenseCqualityBmaintenanceAn MCP server that enables LLMs to analyze pcap files by providing tools for packet dissection, stream following, and data extraction via tshark. It supports protocol hierarchy analysis, credential scanning, and threat intelligence checks on captured network traffic.54463 PyPI410MIT
- FlicenseNot gradedqualityDmaintenanceAn automated security operations center MCP server that uses LLMs and network analysis tools like Tshark to detect threats in traffic data. It enables users to automatically ingest PCAP files, query specific packets, and generate intelligent security analysis reports.-