Wireshark MCP

Integrations

  • Enables AI systems to leverage Wireshark's network analysis tools through a standardized protocol, providing packet summarization, protocol intelligence, and flow tracking capabilities.

Wireshark MCP(模型上下文协议)

一个模型上下文协议 (MCP) 服务器,用于将 Wireshark 网络分析功能与 Claude 等 AI 系统集成。此实现可直接与 Claude 集成,无需手动复制/粘贴提示。

什么是 Wireshark MCP?

Wireshark MCP 为 AI 助手提供了一种通过 Wireshark 访问和分析网络数据包数据的标准化方法。它通过实现模型上下文协议 (MCP) 弥合了低级网络数据与高级 AI 理解之间的差距。

该服务器提供以下工具:

  1. 捕获实时网络流量
  2. 分析现有的 pcap 文件
  3. 提取协议特定信息
  4. 总结网络流量

快速入门

安装

# Clone the repository git clone https://github.com/sarthaksiddha/Wireshark-mcp.git cd Wireshark-mcp # Install dependencies pip install -e .

运行 MCP 服务器

# 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

配置 Claude 桌面

要配置 Claude Desktop 以使用 Wireshark MCP 服务器:

  1. 打开 Claude 桌面
  2. 前往“设置”>“开发者”>“编辑配置”
  3. 添加以下配置:
{ "mcpServers": { "wireshark": { "command": "python", "args": [ "/path/to/wireshark-mcp/mcp_server.py", "--stdio" ] } } }

/path/to/wireshark-mcp替换为您的存储库的实际路径。

可用工具

Wireshark MCP 服务器提供以下工具:

  • capture_live_traffic :使用 tshark 捕获实时网络流量
  • analyze_pcap :分析现有的 pcap 文件
  • get_protocol_list :获取支持的协议列表

Claude 中的示例用法

配置完成后,您可以使用 Claude 中的 Wireshark MCP 服务器进行如下查询:

  • “捕获我系统上 30 秒的网络流量并向我展示发生了什么”
  • “分析我的 network.pcap 文件并告诉我是否有任何可疑活动”
  • “分析网络流量时我应该关注哪些协议?”

主要特点

  • 数据包摘要:将大型 pcap 文件转换为令牌优化摘要
  • 协议智能:增强常见协议(HTTP、DNS、TLS、SMTP 等)的上下文
  • 流跟踪:将相关数据包分组到对话流中
  • 异常突出显示:强调不寻常或可疑的模式
  • 查询模板:针对常见网络分析任务的预建提示
  • 可视化生成:创建基于文本的网络模式表示
  • 多层次抽象:从原始字节到高级行为查看数据
  • Web 界面:基于浏览器的 UI,可更轻松地进行分析和可视化
  • 代理到代理 (A2A) 集成:将数据包分析公开为与 A2A 兼容的代理
  • 高级安全框架:全面的数据保护和通信安全控制
  • IP 地址保护:匿名敏感网络地址的多种策略
  • 安全通信:用于安全代理间通信的强大消息签名
  • 跨平台:适用于 Windows、macOS 和 Linux

文档

基本用法

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)

与 Claude 一起使用

将 Wireshark MCP 与 Claude 结合使用主要有三种方法:

1. 直接 MCP 集成(新)

为了与 Claude Desktop 无缝集成:

# Run the MCP server with stdio transport python mcp_server.py --stdio

然后按照上面“配置 Claude Desktop”部分中的说明配置 Claude Desktop。此方法可直接集成,无需任何复制/粘贴。

2. 简单脚本方法

无需复杂设置即可进行快速分析(需要复制/粘贴):

python scripts/simple_pcap_analysis.py path/to/your/capture.pcap

这会生成一个 markdown 文件,您可以将其复制并粘贴到claude.ai上的 Claude 中。

3. API集成

对于与 Claude 的 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)

有关详细的 API 说明,请参阅Claude 集成指南

要求

  • Python 3.8+
  • Wireshark/tshark 已安装并位于您的 PATH 中
  • fastmcp Python 包

贡献

欢迎贡献!特别感谢以下领域的帮助:

  • 附加协议分析仪
  • 性能优化
  • 文档和示例
  • 使用不同的数据包捕获进行测试
  • Web 界面增强功能

有关如何贡献的详细信息,请参阅CONTRIBUTING.md

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

一个模型上下文协议服务器,将Wireshark的网络分析功能与Claude等AI系统集成,可以直接分析网络数据包数据,而无需手动复制。

  1. 什么是 Wireshark MCP?
    1. 快速入门
      1. 安装
      2. 运行 MCP 服务器
      3. 配置 Claude 桌面
    2. 可用工具
      1. Claude 中的示例用法
        1. 主要特点
          1. 文档
            1. 基本用法
              1. 与 Claude 一起使用
                1. 1. 直接 MCP 集成(新)
                2. 2. 简单脚本方法
                3. 3. API集成
              2. 要求
                1. 贡献
                  1. 执照

                    Related MCP Servers

                    • -
                      security
                      F
                      license
                      -
                      quality
                      A Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.
                      Last updated -
                      1
                      Python
                      • Linux
                      • Apple
                    • -
                      security
                      F
                      license
                      -
                      quality
                      A Model Context Protocol server that extends AI capabilities by providing file system access and management functionalities to Claude or other AI assistants.
                      Last updated -
                      3
                      TypeScript
                      • Apple
                    • -
                      security
                      -
                      license
                      -
                      quality
                      A modular, extensible Model Context Protocol server framework designed for Claude Desktop that uses convention-based automatic module discovery to easily extend AI application functionality without modifying core code.
                      Last updated -
                      1
                      Python
                    • -
                      security
                      A
                      license
                      -
                      quality
                      A Model Context Protocol server that provides network analysis tools for security professionals, enabling AI models like Claude to perform tasks such as ASN lookups, DNS analysis, WHOIS retrieval, and IP geolocation for security investigations.
                      Last updated -
                      1
                      Python
                      Apache 2.0
                      • Linux
                      • Apple

                    View all related MCP servers

                    ID: 5gbduo2wik