TShark2MCP
An MCP server that enables AI-assisted network packet analysis using Wireshark's TShark tool. It provides tools for pcap file overview, session extraction, protocol filtering, and statistical analysis through a standardized interface.
README
TShark2MCP - AI 辅助报文分析的 MCP 协议工具
基于 Wireshark 的 TShark 命令行工具,构建一个支持 Model Context Protocol (MCP) 的 AI 辅助报文分析服务器,让 AI 助手能够通过标准化的 MCP 协议调用报文提取工具,辅助用户快速定位和分析网络通信异常。
功能概述
提供6个核心报文分析工具,支持:
- pcap 文件概览分析
- 网络会话提取
- 时间范围过滤
- 协议类型过滤
- 特定网络流分析
- 统计指标计算
环境要求
- Python 3.8+
- Wireshark/TShark 4.0+
安装步骤
1. 安装 Wireshark
Windows:
- 下载并安装 Wireshark
- 确保 TShark 被添加到系统 PATH,或记录安装路径
2. 安装 Python 依赖
pip install -r requirements.txt
MCP 服务器配置
将以下配置添加到支持 MCP 协议的 AI 助手(如 Cursor、VS Code、Claude Desktop)中:
{
"mcpServers": {
"tshark2mcp": {
"command": "python",
"args": [
"D:\\niusulong\\wireshark_mcp\\TShark2MCP\\main.py"
],
"env": {
"PYTHONPATH": "D:\\niusulong\\wireshark_mcp\\TShark2MCP\\src",
"TSHARK_PATH": "C:\\Program Files\\Wireshark\\tshark.exe"
}
}
}
}
配置说明
- command: 启动服务器的命令(python)
- args: 服务器入口文件的绝对路径
- env: 环境变量配置
PYTHONPATH: 确保 Python 能找到项目模块TSHARK_PATH: TShark 可执行文件路径
重要: 请根据实际安装路径修改 args 和 TSHARK_PATH 的值。
TShark 路径配置
项目支持多种 TShark 路径配置方式,按优先级排序:
-
环境变量 TSHARK_PATH (推荐)
export TSHARK_PATH="C:\Program Files\Wireshark\tshark.exe" -
系统 PATH 中的 tshark
- 确保 Wireshark 安装时添加到系统 PATH
-
自动检测 (备用)
- 项目会尝试在常见位置查找 TShark
启动服务器
python main.py
贡献
欢迎提交 Issue 和 Pull Request 来改进项目。
许可证
[项目许可证]
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.