Wireshark MCP
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.
README
Wireshark MCP (Model Context Protocol)
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.
What is Wireshark MCP?
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.
<p align="center"> <img src="https://raw.githubusercontent.com/sarthaksiddha/Wireshark-mcp/main/docs/images/wireshark-mcp-flow.png" alt="Wireshark MCP Flow" width="600"/> </p>
The server provides tools for:
- Capturing live network traffic
- Analyzing existing pcap files
- Extracting protocol-specific information
- Summarizing network flows
Quick Start
Installation
# Clone the repository
git clone https://github.com/sarthaksiddha/Wireshark-mcp.git
cd Wireshark-mcp
# Install dependencies
pip install -e .
Running the MCP Server
# 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
Configuring Claude Desktop
To configure Claude Desktop to use the Wireshark MCP server:
- Open Claude Desktop
- Go to Settings > Developer > Edit Config
- Add the following configuration:
{
"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.
Available Tools
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 protocols
Example Usage in Claude
Once configured, you can use the Wireshark MCP server in Claude with queries like:
- "Capture 30 seconds of network traffic on my system and show me what's happening"
- "Analyze my network.pcap file and tell me if there are any suspicious activities"
- "What protocols can I focus on when analyzing network traffic?"
Key Features
- Packet Summarization: Convert large pcap files into token-optimized summaries
- Protocol Intelligence: Enhanced context for common protocols (HTTP, DNS, TLS, SMTP, etc.)
- Flow Tracking: Group related packets into conversation flows
- Anomaly Highlighting: Emphasize unusual or suspicious patterns
- Query Templates: Pre-built prompts for common network analysis tasks
- Visualization Generation: Create text-based representations of network patterns
- Multi-level Abstraction: View data from raw bytes to high-level behaviors
- Web Interface: Browser-based UI for easier analysis and visualization
- Agent-to-Agent (A2A) Integration: Expose packet analysis as an A2A-compatible agent
- Advanced Security Framework: Comprehensive security controls for data protection and communication
- IP Address Protection: Multiple strategies for anonymizing sensitive network addresses
- Secure Communication: Robust message signatures for secure agent-to-agent communication
- Cross-Platform: Works on Windows, macOS, and Linux
Documentation
- Claude Integration Guide - Detailed guide for connecting with Claude AI
- A2A Module Documentation - Guide for using the Agent-to-Agent integration
- A2A Security Guide - Security considerations for A2A integration
- IP Protection Guide - Detailed guide on IP address anonymization and obfuscation
- Security Manager Guide - Comprehensive guide to the unified security framework
- Message Security Signatures - Guide for secure message signing and verification
- Web Interface README - Information on using the web interface
- Utility Scripts - Helpful scripts for PCAP analysis
Basic Usage
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)
Using with Claude
There are three main ways to use Wireshark MCP with Claude:
1. Direct MCP Integration (NEW)
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.
2. Simple Script Approach
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.
3. API Integration
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.
Requirements
- Python 3.8+
- Wireshark/tshark installed and in your PATH
- fastmcp Python package
Contributing
Contributions are welcome! Areas where help is especially appreciated:
- Additional protocol analyzers
- Performance optimizations
- Documentation and examples
- Testing with diverse packet captures
- Web interface enhancements
See CONTRIBUTING.md for details on how to contribute.
License
This project is licensed under the MIT License - see the LICENSE file for details.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。