A Model Context Protocol server that integrates Wireshark's network analysis capabilities with AI systems like Claude, allowing direct analysis of network packet data without manual copying.
A Model Context Protocol (MCP) server for integrating Wireshark network analysis capabilities with AI systems like Claude. This implementation provides direct integration with Claude without requiring manual copy/paste of prompts.
Wireshark MCP provides a standardized way for AI assistants to access and analyze network packet data through Wireshark. It bridges the gap between low-level network data and high-level AI understanding by implementing the Model Context Protocol.
The server provides tools for:
# Clone the repository git clone https://github.com/sarthaksiddha/Wireshark-mcp.git cd Wireshark-mcp # Install dependencies pip install -e .
# Run with stdio transport (for Claude Desktop) python mcp_server.py --stdio # Run with SSE transport (for other MCP clients) python mcp_server.py --host 127.0.0.1 --port 5000
To configure Claude Desktop to use the Wireshark MCP server:
{ "mcpServers": { "wireshark": { "command": "python", "args": [ "/path/to/wireshark-mcp/mcp_server.py", "--stdio" ] } } }
Replace /path/to/wireshark-mcp
with the actual path to your repository.
The Wireshark MCP server provides the following tools:
capture_live_traffic
: Capture live network traffic using tsharkanalyze_pcap
: Analyze an existing pcap fileget_protocol_list
: Get a list of supported protocolsOnce configured, you can use the Wireshark MCP server in Claude with queries like:
from wireshark_mcp import WiresharkMCP, Protocol from wireshark_mcp.formatters import ClaudeFormatter # Initialize with a pcap file mcp = WiresharkMCP("capture.pcap") # Generate a basic packet summary context = mcp.generate_context( max_packets=100, focus_protocols=[Protocol.HTTP, Protocol.DNS], include_statistics=True ) # Format it for Claude formatter = ClaudeFormatter() claude_prompt = formatter.format_context( context, query="What unusual patterns do you see in this HTTP traffic?" ) # Save to file for use with Claude with open("claude_prompt.md", "w") as f: f.write(claude_prompt)
There are three main ways to use Wireshark MCP with Claude:
For seamless integration with Claude Desktop:
# Run the MCP server with stdio transport python mcp_server.py --stdio
Then configure Claude Desktop as described in the "Configuring Claude Desktop" section above. This method provides direct integration without any copy/paste needed.
For quick analysis without complex setup (requires copy/paste):
python scripts/simple_pcap_analysis.py path/to/your/capture.pcap
This generates a markdown file you can copy and paste into Claude at claude.ai.
For programmatic integration with Claude's API:
from claude_client import ClaudeClient # Your implementation from wireshark_mcp import WiresharkMCP from wireshark_mcp.formatters import ClaudeFormatter # Process the PCAP file mcp = WiresharkMCP("capture.pcap") context = mcp.generate_context() # Format for Claude formatter = ClaudeFormatter() prompt = formatter.format_context(context, query="Analyze this network traffic") # Send to Claude API client = ClaudeClient(api_key="your_api_key") response = client.analyze(prompt)
See the Claude Integration Guide for detailed API instructions.
Contributions are welcome! Areas where help is especially appreciated:
See CONTRIBUTING.md for details on how to contribute.
This project is licensed under the MIT License - see the LICENSE file for details.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!