Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

A network analysis MCP server providing 23 tools for packet capture, protocol analysis, and cryptographic inspection, including TLS handshake, certificate extraction, and SM2/SM3/SM4 support.

README.md

Rainy MCP Server

一个真正支持 AI IDE(暂不支持Antigravity)的 Rainy MCP 服务器,实现了符合 MCP (Model Context Protocol) 规范的 SSE 传输层。(由 RainyMarks 开发)

特性

  • 真正的 SSE 实现:完整实现 MCP SSE 传输规范,支持 EventSource 长连接
  • 会话管理:自动管理客户端会话生命周期,支持超时清理
  • 异步工具调用:工具执行不阻塞主线程,结果通过 SSE 推送
  • 23 个强大工具:覆盖网络抓包、TLS/SSL分析、IPSec/ISAKMP、数字证书解析等场景
  • 期末考试专用:支持 SM2/SM3/SM4 国密分析,TLS握手分析,证书公钥提取等
  • 零外部 MCP 依赖:完全自包含实现,无需安装 mcp

架构

┌─────────────────┐     GET /sse      ┌──────────────────┐
│   Cursor IDE    │ ◄───────────────► │  SSE MCP Server  │
│  (MCP Client)   │                   │                  │
│                 │  POST /messages   │  - SessionMgr    │
│                 │ ────────────────► │  - ToolRegistry  │
│                 │                   │  - RainyMCP      │
└─────────────────┘                   └──────────────────┘
                                              │
                                              ▼
                                      ┌──────────────┐
                                      │   tshark     │
                                      │ (Wireshark)  │
                                      └──────────────┘

前置要求

  • Python 3.8+
  • Wireshark (需要 tshark 命令行工具)

安装 Wireshark

Windows:

  • 下载安装 Wireshark
  • 确保安装时勾选 "TShark" 组件
  • 将 Wireshark 安装目录添加到系统 PATH(如 C:\Program Files\Wireshark

macOS: ``bash brew install wireshark ``

Linux (Ubuntu/Debian): ``bash sudo apt install tshark ``

安装

# 克隆项目
git clone <repository-url>
cd Rainy_mcp

# 安装依赖
pip install -r requirements.txt

使用方法

1. 启动服务器

python rainy_mcp.py

可选参数: ``bash python rainy_mcp.py --host 127.0.0.1 --port 3000 --tshark-path /path/to/tshark ``

启动成功后会显示: `` 服务器地址: http://127.0.0.1:3000 SSE 端点: http://127.0.0.1:3000/sse 消息端点: http://127.0.0.1:3000/messages 已注册 8 个 Rainy 工具 ``

2. 配置 Cursor IDE

在项目根目录创建 mcp.json(或 .cursor/mcp.json):

{
  "mcpServers": {
    "rainy": {
      "url": "http://127.0.0.1:3000/sse"
    }
  }
}

3. 在 Cursor 中使用

重启 Cursor 或刷新 MCP 连接后,可以直接使用 Rainy 工具:

"帮我分析这个 pcap 文件中的 HTTP 流量" "列出所有可用的网络接口" "提取流量包中的所有 IP 地址"

可用工具 (23个)

基础工具 (8个)

| 工具名称 | 描述 | |---------|------| | list_interfaces | 列出所有可用的网络接口 | | capture_live | 实时抓包分析,支持过滤器 | | analyze_pcap | 分析 pcap/pcapng 文件内容 | | get_protocols | 获取 tshark 支持的协议列表 | | get_packet_statistics | 获取数据包统计信息(I/O、会话、端点) | | extract_fields | 提取数据包中的特定字段 | | analyze_protocols | 分析特定协议(HTTP、TCP、DNS 等) | | analyze_errors | 分析网络错误(重传、丢包等) |

🎓 期末考试专用工具 (15个)

TLS/SSL 分析

| 工具名称 | 描述 | 考试用途 | |---------|------|---------| | analyze_tls_handshake | TLS 握手完整分析 | 🔥 提取 random 随机数、cipher_suites | | extract_certificates | 提取 TLS 证书 | 🔥 获取签名证书和加密证书 | | get_cipher_suites | 获取加密套件列表 | 🔥 找出四个 cipher suite |

IPSec/ISAKMP 分析

| 工具名称 | 描述 | 考试用途 | |---------|------|---------| | analyze_ipsec | 分析 ESP/AH 协议 | IPSec 协议分析 | | analyze_isakmp | IKE/ISAKMP 分析 | 🔥 主模式前四个包、DH公钥、证书 |

数字证书解析

| 工具名称 | 描述 | 考试用途 | |---------|------|---------| | parse_certificate | X.509 证书深度解析 | 🔥 序列号、公钥、签名值、SM3摘要 | | extract_public_key | 提取公钥 | 🔥 RSA/SM2(512bit)/ECC 公钥 | | get_signature_value | 获取签名值 | 🔥 ServerKeyExchange签名、SM2签名 |

流重组与协议分析

| 工具名称 | 描述 | |---------|------| | follow_tcp_stream | TCP 流追踪重组 | | follow_udp_stream | UDP 流追踪重组 | | extract_http_objects | HTTP 对象提取 | | analyze_dns_detail | DNS 深度分析 |

安全检测与智能摘要

| 工具名称 | 描述 | |---------|------| | detect_anomalies | 异常检测(端口扫描、可疑流量) | | generate_traffic_summary | 智能流量摘要报告 | | get_conversation_graph | IP 通信图谱数据 |

输出控制:证书/签名相关工具(如 analyze_tls_handshakeextract_certificatesparse_certificateextract_public_keyget_signature_value)新增参数 full_output(默认 false),开启后不再截断长字段;流重组工具 follow_tcp_stream / follow_udp_stream 新增 max_lines(默认 2000,<=0 表示不截断)。

工具详细说明

list_interfaces

列出系统上所有可用的网络接口。

// 无需参数
{}

capture_live

实时抓包分析。需要管理员/root 权限。

{
  "interface": "eth0",        // 必需:网络接口名称
  "duration": 10,             // 可选:抓包时长(秒),默认 10
  "filter": "tcp port 80",    // 可选:BPF 过滤器
  "max_packets": 100          // 可选:最大数据包数,默认 100
}

analyze_pcap

分析已保存的 pcap 文件。

{
  "file_path": "capture.pcap",  // 必需:文件路径
  "filter": "http",             // 可选:显示过滤器
  "max_packets": 100            // 可选:最大数据包数
}

extract_fields

提取特定字段并统计。

{
  "file_path": "capture.pcap",
  "fields": ["ip.src", "ip.dst"],  // 必需:字段列表
  "filter": "",                     // 可选:显示过滤器
  "max_packets": 5000               // 可选:最大数据包数
}

analyze_errors

分析网络传输错误。

{
  "file_path": "capture.pcap",
  "error_type": "all",  // 可选:all/malformed/tcp/retransmission/duplicate_ack/lost_segment
  "max_packets": 5000
}

🎓 期末考试场景示例

第八章:TLS 分析

> "分析这个pcap中的TLS握手,找出random随机数和cipher_suites"
> "提取第一个包的随机数和第二个包选中的加密套件"

第八章:ISAKMP 分析

> "分析ISAKMP流量,找出主模式的前四个包"
> "提取IKE密钥交换中的DH公钥和证书"

第九章:数字证书分析

> "解析流量中的证书,提取公钥和签名值"
> "根据证书序列号找到对应的公钥"

第七章:SM2 签名验签

> "提取SM2签名值(r,s)和公钥,准备验签"
> "找出签名报文和签名原文"

第六章:SM3 摘要

> "从证书中提取国密SM3摘要值"

端点说明

| 端点 | 方法 | 描述 | |-----|------|------| | / | GET | 状态页面 | | /status | GET | 状态页面 | | /sse | GET | SSE 长连接端点,返回 text/event-stream | | /messages | POST | JSON-RPC 消息接收端点 |

SSE 协议流程

1. Client ──GET /sse──────────────────────────► Server
2. Client ◄──event: endpoint, data: /messages?session_id=xxx── Server
3. Client ──POST /messages?session_id=xxx────► Server
   (JSON-RPC: initialize)
4. Client ◄──event: message, data: {result}─── Server
5. Client ──POST /messages (tools/list)──────► Server
6. Client ◄──event: message, data: {tools}─── Server
7. Client ──POST /messages (tools/call)──────► Server
8. Client ◄──event: message, data: {content}─ Server

常见问题

Q: 为什么看不到网络接口?

A: 列出网络接口需要管理员权限。请以管理员身份运行 PowerShell/终端后启动服务器。

Q: Cursor 连接失败怎么办?

  1. 确认服务器已启动且在 3000 端口运行
  2. 检查 mcp.json 配置是否正确(使用 url 而非 serverUrl
  3. 访问 http://127.0.0.1:3000/status 确认服务器状态
  4. 重启 Cursor 刷新 MCP 连接

Q: tshark 命令找不到?

确保 Wireshark 已安装且 tshark 在系统 PATH 中。可以通过 --tshark-path 参数指定完整路径: ``bash python rainy_mcp.py --tshark-path "C:\Program Files\Wireshark\tshark.exe" ``

技术栈

  • Web 框架: Starlette (ASGI)
  • 服务器: Uvicorn
  • 协议: MCP over SSE (Server-Sent Events)
  • 后端工具: tshark (Wireshark CLI)

许可证

MIT License

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Finance & Payments servers.