MCP cover image
See in Github
2025-03-31

TSHARK/WIRESHARK MCP服务器通过Claude进行网络数据包分析

1

Github Watches

0

Github Forks

0

Github Stars

Wireshark MCP Server

This project exposes PyShark functionality through the Model Context Protocol (MCP), allowing AI assistants like Claude to interact with network packet capture and analysis capabilities.

Installation

  1. Install the required dependencies:
# Install with uv (recommended)
uv add mcp[cli] pyshark

# Or with pip
pip install mcp[cli] pyshark
  1. Clone this repository:
git clone https://github.com/A-G-U-P-T-A/wireshark-mcp
cd wireshark-mcp

Requirements

  • Python 3.8+
  • TShark (Wireshark's command-line component) must be installed
  • Administrative/root privileges for live packet capture

Usage

Running the server

You can run the server in development mode with the MCP Inspector:

mcp dev pyshark_mcp.py

Or install it directly in Claude Desktop:

mcp install pyshark_mcp.py

Available functionality

This MCP server exposes the following:

Resources

  • pyshark://version - Gets the PyShark version information
  • pyshark://config - Gets the PyShark configuration
  • pyshark://capture-history - Gets history of previous packet captures

Tools

  • list_interfaces - Lists all available network interfaces
  • capture_live_packets - Captures live packets from a network interface
  • read_pcap_file - Reads and analyzes a packet capture file
  • analyze_traffic - Analyzes network traffic patterns from a capture

Advanced tools provided in advanced_captures.py:

  • capture_targeted_traffic - Captures traffic targeted to specific host, port, or protocol
  • capture_to_file - Captures network traffic and saves to a pcap file
  • analyze_http_traffic - Analyzes HTTP traffic from a capture file
  • detect_network_protocols - Detects and reports network protocols in use

Prompts

  • packet_capture_help - Provides help information about packet capturing with PyShark

Example usage in Claude

Once the server is installed in Claude Desktop, you can interact with it like this:

You: What interfaces are available for network capture?

Claude: Let me check the available network interfaces on your system.
[Calls list_interfaces tool]

You: Can you capture HTTP traffic for 10 seconds?

Claude: I'll capture HTTP traffic for 10 seconds.
[Calls capture_live_packets with appropriate parameters]

You: Can you analyze the traffic I just captured?

Claude: Here's an analysis of the captured traffic:
[Calls analyze_traffic to provide insights]

Remember to always ensure you have permission to capture network traffic.

Security Considerations

Network packet capture is a sensitive operation. Please ensure:

  1. You have proper authorization to capture network traffic
  2. You comply with all applicable laws and regulations
  3. You don't capture sensitive or private data inadvertently
  4. You handle capture files securely to prevent unauthorized access

Requirements

  • PyShark: Python wrapper for TShark
  • TShark: Command-line version of Wireshark (must be installed separately)
  • Administrative privileges: Often required for live packet capture

Customization

You can customize this MCP server by:

  1. Adding more advanced capture and analysis tools
  2. Implementing filters for specific traffic types
  3. Creating specialized analysis functions for protocols of interest
  4. Extending the capture history management capabilities

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • modelcontextprotocol
  • 模型上下文协议服务器

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • n8n-io
  • 具有本机AI功能的公平代码工作流程自动化平台。将视觉构建与自定义代码,自宿主或云相结合,400+集成。

  • open-webui
  • 用户友好的AI接口(支持Ollama,OpenAi API,...)

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

    Reviews

    4 (1)
    Avatar
    user_3ONwAPrB
    2025-04-18

    As a loyal user of MCP applications, Wireshark-MCP by A-G-U-P-T-A on GitHub is an exceptional tool for network protocol analysis. It offers extensive support and efficiency, making my debugging and monitoring tasks smoother and more insightful. Highly recommended for professionals in network management and cybersecurity. Check it out!