WireShark(tshark)的MCP。赋能LLM实时网络流量分析能力
概览
WireMCP 是一款模型上下文协议(MCP)服务器,旨在赋能大型语言模型(LLM)实现实时网络流量分析能力。通过利用基于 Wireshark tshark 构建的工具,WireMCP 捕获并处理实时网络数据,为大型语言模型提供结构化上下文,以协助威胁狩猎、网络诊断和异常检测等任务。 WireMCP 向 MCP 客户端开放以下工具,增强了对网络活动的 LLM 理解: - : 捕获实时流量并返回原始数据包数据以JSON格式,使LLM能够分析数据包级细节(如IP地址、端口、HTTP方法)。- : 提供协议层级统计,向LLM提供流量组成概览(例如TCP与UDP使用情况)。- : 提供TCP/UDP会话统计数据,使LLM能够跟踪端点间的通信流。
概述(AI 翻译)
WireMCP 是一款模型上下文协议(MCP)服务器,旨在赋能大型语言模型(LLM)具备实时网络流量分析能力。通过利用基于 Wireshark tshark 的工具,WireMCP 捕获并处理实时网络数据,为大型语言模型提供结构化上下文,以协助威胁狩猎、网络诊断和异常检测等任务。
特征
WireMCP 向 MCP 客户端开放以下工具,增强了对网络活动的 LLM 理解:
capture_packets:捕获实时流量并返回原始数据包数据以 JSON 格式,使大型语言模型能够分析数据包级细节(如 IP 地址、端口、HTTP 方法)。get_summary_stats:提供协议层级统计,为大型语言模型提供流量组合概览(例如 TCP 与 UDP 使用情况)。get_conversations:提供TCP/UDP会话统计数据,使大型语言模型能够追踪端点之间的通信流。check_threats:捕获IP并与URLhaus黑名单进行核对,为LLM配备威胁情报上下文以识别恶意活动。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
WireMCP
WireMCP is a Model Context Protocol (MCP) server designed to empower Large Language Models (LLMs) with real-time network traffic analysis capabilities. By leveraging tools built on top of Wireshark’s tshark, WireMCP captures and processes live network data, providing LLMs with structured context to assist in tasks like threat hunting, network diagnostics, and anomaly detection.
Features
WireMCP exposes the following tools to MCP clients, enhancing LLM understanding of network activity:
capture_packets: Captures live traffic and returns raw packet data as JSON, enabling LLMs to analyze packet-level details (e.g., IP addresses, ports, HTTP methods).get_summary_stats: Provides protocol hierarchy statistics, giving LLMs an overview of traffic composition (e.g., TCP vs. UDP usage).get_conversations: Delivers TCP/UDP conversation statistics, allowing LLMs to track communication flows between endpoints.check_threats: Captures IPs and checks them against the URLhaus blacklist, equipping LLMs with threat intelligence context for identifying malicious activity.check_ip_threats: Performs targeted threat intelligence lookups for specific IP addresses against multiple threat feeds, providing detailed reputation and threat data.analyze_pcap: Analyzes PCAP files to provide comprehensive packet data in JSON format, enabling detailed post-capture analysis of network traffic.extract_credentials: Scans PCAP files for potential credentials from various protocols (HTTP Basic Auth, FTP, Telnet), aiding in security audits and forensic analysis.
How It Helps LLMs
WireMCP bridges the gap between raw network data and LLM comprehension by:
- Contextualizing Traffic: Converts live packet captures into structured outputs (JSON, stats) that LLMs can parse and reason about.
- Threat Detection: Integrates IOCs (currently URLhaus) to flag suspicious IPs, enhancing LLM-driven security analysis.
- Diagnostics: Offers detailed traffic insights, enabling LLMs to assist with troubleshooting or identifying anomalies.
- Narrative Generation: LLM’s can Transform complex packet captures into coherent stories, making network analysis accessible to non-technical users.
Installation
Prerequisites
- Mac / Windows / Linux
- Wireshark (with
tsharkinstalled and accessible in PATH) - Node.js (v16+ recommended)
- npm (for dependency installation)
Setup
-
Clone the repository:
git clone https://github.com/0xkoda/WireMCP.git cd WireMCP -
Install dependencies:
npm install -
Run the MCP server:
node index.js
Note: Ensure
tsharkis in your PATH. WireMCP will auto-detect it or fall back to common install locations (e.g.,/Applications/Wireshark.app/Contents/MacOS/tsharkon macOS).
Usage with MCP Clients
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"wiremcp": {
"command": "node",
"args": [
"/ABSOLUTE_PATH_TO/WireMCP/index.js"
]
}
}
}