ADourou/WiresharkMCP
If you are the rightful owner of WiresharkMCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The WiresharkMCP project is an MCP server designed to analyze pcap files using tshark, enabling AI-driven dynamic network queries.
WiresharkMCP
Thesis Project: An MCP server that analyzes pcap files using tshark, allowing an AI to dynamically define analysis fields for smart network queries.
This is an active thesis project, and its functionality is currently under development. The goal is to create a robust and intelligent network analysis tool.
💡 Project Motivation
This thesis began by evaluating existing tools, such as WireMCP, which provide a solid foundation for MCP based pcap analysis.
While tools like WireMCP are effective for basic 5-tuple analysis (e.g., ip.src, ip.dst, tcp.srcport), the requirements for analyzing the (Jim Kurose) Wireshark Labs are more demanding. These labs require querying a wide variety of specific protocol fields (e.g., http.host, dns.cname, tcp.flags.syn).
This project was created to bridge that gap. It implements an MCP tool that is not limited to a fixed set of fields. Instead, it empowers the AI client to dynamically define the exact display filters and fields required for any given query.
✨ Our Solution
This server implements an "AI-driven" workflow:
- An AI model receives a high-level question (e.g., "Find all CNAMEs for
www.mit.edu"). - The AI determines it needs the
dns.cnamefield with adns.qry.name == "www.mit.edu"filter. - The AI (via an MCP client) calls the
analyze_pcap_detailstool with these specific parameters. - The server runs a lightweight, highly targeted
tsharkcommand. - Only the precise data requested is returned to the AI for its final answer.
🌟 Features
- Dynamic Field Selection: Allows the client to specify any
tsharkdisplay filters (-Y) and fields (-e). - Flexible Tshark Path: The client can optionally provide a custom path to the
tsharkexecutable, making the server portable. - Optimized Data Transfer: Returns only the necessary JSON data, minimizing overhead.
🛠️ Setup & Installation
-
Prerequisites:
- Node.js (v18.x or newer recommended)
- Tshark (Must be installed. The server can find it in
PATHor be given a direct path at runtime).
-
Clone the Repository:
git clone https://github.com/ADourou/WiresharkMCP.git -
Install Dependencies:
npm install
🚀 Usage
-
Run the MCP Server:
node server.js -
Example Client Request: The server listens for MCP tool calls. A client (e.g., your AI script) would send a JSON request like the following over
stdio:{ "tool_name": "analyze_pcap_details", "pcap_file": "path/to/dns-ethereal-lab-1.pcap", // --- All parameters below are optional --- "display_filter": "dns.qry.name == \"www.mit.edu\"", "fields": ["frame.number", "dns.qry.name", "dns.cname"], "tsharkpath": "C:\\Program Files\\Wireshark\\tshark.exe" }
🎓 Academic Info
- Institution: University of Crete
- Department: Computer Science Department
- Author: Anastasia Dourou
- Supervisor: Xenofontas Dimitropoulos