Token导航 LogoToken导航TokenDH.com
netMCP (Cortexc0de) logo
安全风控stdio官方级别未说明来源级核验

netMCP (Cortexc0de)

MCP Server

NetMCP是一款专业级的网络分析MCP服务器,整合了Wireshark/TShark、Nmap和威胁情报功能,支持通过自然语言进行数据包捕获、网络扫描、威胁检测和凭证提取。

工具数

40

提示词数

0

GitHub Stars

2

资源数

0
PythonClaude安全Claude DesktopClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

cortexc0de

提供方

cortexc0de

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install netmcp

详细介绍

🌐 NetMCP

专业级网络分析MCP服务器——Wireshark/TShark+Nmap+威胁情报

![Tests](https://github.com/cortexc0de/netmcp/actions/workflows/ci.yml) ![Coverage](https://github.com/cortexc0de/netmcp) ![CodeQL](https://github.com/cortexc0de/netmcp/actions/workflows/codeql.yml) ![Python 3.11+](https://www.python.org/downloads/) ![License: MIT](LICENSE) ![PyPI](https://pypi.org/project/netmcp/) ](https://ghcr.io/cortexc0de/netmcp) ![MCP](https://modelcontextprotocol.io/)

NetMCP弥合了原始网络数据和人工智能理解之间的差距。它使Claude、Cursor和任何符合MCP的客户端能够捕获数据包、扫描网络、检测威胁和提取凭据——所有这些都是通过自然语言实现的。

快速开始特性配置API 参考建筑

______________________________________________________________________

🚀 快速开始

# Install system dependencies
sudo apt-get install -y tshark nmap        # Ubuntu/Debian
# brew install wireshark nmap              # macOS

# Install NetMCP
pip install netmcp

# Run
netmcp

就是这样。服务器启动 标准 默认情况下,传输已准备好用于任何MCP客户端。

______________________________________________________________________

✨ 特性

  • 📡 数据包捕获 --实时捕获、BPF过滤、目标流量、快速捕获模式
  • 🔬 深度分析 --PCAP解析、协议统计、HTTP流量分析、DNS分析、专家信息、GeoIP丰富
  • 🔄 河流重建 --跟踪TCP/UDP对话,枚举流
  • 📤 灵活出口 -JSON、CSV、pcap/pcanel格式转换
  • 🔍 Nmap集成 --端口扫描、服务检测、操作系统指纹识别、漏洞扫描
  • 🛡️ 威胁情报 --URLhaus+滥用IPDB IP信誉检查,PCAP范围内的威胁扫描
  • 🔑 凭证提取 --HTTP基本、FTP、Telnet、Kerberos(哈希猫就绪)
  • 🌍 GeoIP地图 --MaxMind GeoLite2用于流量分析的IP地理定位
  • 🔒 5层安全 --输入验证、shell=False、速率限制、路径遍历保护、审计日志记录
  • 💬 引导式工作流程 --安全审计、事件响应、故障排除、流量分析、网络基线提示

高级功能

  • 🔀 PCAP差异/合并/切片 --比较捕获,通过mergecap组合文件,通过editcap提取数据包范围
  • 📊 可视化 --网络对话的ASCII艺术和美人鱼序列图
  • 🔓 TLS解密 --使用SSLKEYLOGFILE(NSS密钥日志格式)解密HTTPS流量
  • 🎨 Wireshark配置文件 --列出配置文件,应用配置文件设置,解析颜色过滤器,使用配置文件进行捕获
  • 🧬 DNS隧道检测 --分析DNS流量并标记可疑的长子域名
  • 📦 并转换部分 --具有完整协议层剖析的详细单包分析
  • 🏥 专家信息 --提取Wireshark的专家警告、错误和协议违规注释

______________________________________________________________________

📊 工具类别

NetMCP提供 48工具 穿过 9类,加 3资源5个提示:

类别工具描述
📡 捕获与分析5get_network_interfaces · capture_live_packets · quick_capture · save_capture_to_file · analyze_large_pcap
🔬 协议分析10analyze_pcap_file · get_protocol_statistics · get_capture_file_info · capture_targeted_traffic · analyze_http_traffic · detect_network_protocols · analyze_http_headers · geoip_lookup · analyze_dns_traffic · get_expert_info
📊 网络流2visualize_network_flows (ASCII+美人鱼)· decrypt_tls_traffic
🔧 PCAP工具4diff_pcap_files · merge_pcap_files · slice_pcap · decode_packet
🔄 3follow_tcp_stream · follow_udp_stream · list_tcp_streams
📤 出口3export_packets_json · export_packets_csv · convert_pcap_format
🔍 扫描器6nmap_port_scan · nmap_service_detection · nmap_os_detection · nmap_vulnerability_scan · nmap_quick_scan · nmap_comprehensive_scan
🛡️ 安全3extract_credentials · check_ip_threat_intel · scan_capture_for_threats
🎨 Wireshark配置文件4list_wireshark_profiles · apply_profile_capture · get_color_filters · capture_with_profile
📖 API完整参考,包括参数和示例: docs/API.md文件

______________________________________________________________________

🔌 运输选项

NetMCP支持所有MCP传输协议:

运输命令用例
标准 (默认)netmcpClaude Desktop、Cursor、本地客户端
上海证券交易所netmcp --transport sse基于Web的客户端,远程访问
可流式传输的HTTPnetmcp --transport streamable-http现代HTTP客户端

______________________________________________________________________

⚙️ 配置

克劳德桌面版

编辑您的配置文件:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • 视窗: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "netmcp": {
      "command": "netmcp",
      "env": {
        "ABUSEIPDB_API_KEY": "your_api_key_here"
      }
    }
  }
}

光标

编辑 .cursor/mcp.json 在项目根目录中:

{
  "mcpServers": {
    "netmcp": {
      "command": "netmcp"
    }
  }
}

风帆/VS代码

编辑 .vscode/mcp.json:

{
  "servers": {
    "netmcp": {
      "command": "netmcp",
      "env": {
        "ABUSEIPDB_API_KEY": "your_api_key_here"
      }
    }
  }
}

环境变量

变量必填默认描述
ABUSEIPDB_API_KEY没有-滥用威胁情报的IPDB API密钥。 获取免费密钥
NETMCP_TSHARK_PATH自动检测tshark二进制文件的自定义路径
NETMCP_MAX_PACKETS没有10000每次捕获操作的最大数据包数
NETMCP_MAX_FILE_SIZE没有104857600最大PCAP文件大小(以字节为单位)(100 MB)

______________________________________________________________________

📋 需求

依赖关系必需安装
python3.11+sudo apt install python3.11
TShark是的sudo apt install tshark
扫描器可选sudo apt install nmap

macOS

brew install wireshark nmap

Linux权限

# Option 1: Set capabilities (recommended)
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap

# Option 2: Add user to wireshark group
sudo usermod -aG wireshark $USER && newgrp wireshark

______________________________________________________________________

🛡️ 安全模型

NetMCP实现 5层纵深防御:

机制防止
1.输入验证正则表达式, ipaddress Pydantic模块输入格式错误,注入有效载荷
2.指挥建设列出参数, shell=False 无处不在命令注入、shell扩展
3.子流程执行超时,仅捕获输出失控进程,资源耗尽
4.文件系统Path.resolve(),扩展满列表,大小限制路径遍历,符号链接攻击
5.费率限制滑动窗口,每次操作跟踪滥用、DoS攻击

附加保护:

  • 🔒 从不自动升级权限
  • 📝 所有操作审核都记录了时间戳
  • 🚫 危险nmap标志被拒绝(--script-args, --interactive等等)
  • ⚠️ 清除权限问题的错误消息

______________________________________________________________________

🎯 使用示例

实时数据包捕获

You: Capture 100 packets from eth0 and analyze the protocols.

Claude: [capture_live_packets(interface="eth0", packet_count=100)]
       [get_protocol_statistics(filepath="capture.pcap")]
       Found 8 protocols: TCP (62%), UDP (24%), DNS (8%), HTTP (4%)...

安全审计

You: Perform a security audit on suspicious.pcap

Claude: 1. [get_protocol_statistics] → traffic breakdown
        2. [extract_credentials] → found HTTP Basic Auth credentials
        3. [scan_capture_for_threats] → 2 malicious IPs detected
        4. Generated full security report with IOCs

Nmap漏洞扫描

You: Scan 192.168.1.100 for vulnerabilities

Claude: [nmap_quick_scan("192.168.1.100")] → ports 22, 80, 443 open
        [nmap_service_detection("192.168.1.100")] → nginx 1.18.0, OpenSSH 8.2
        [nmap_vulnerability_scan("192.168.1.100")] → no critical CVEs found

______________________________________________________________________

🧠 MCP资源和提示

资源

URI描述
netmcp://interfaces可用网络接口的动态列表
netmcp://captures公用目录中的可用PCAP文件
netmcp://system/info系统功能:工具版本、功能

提示(引导式工作流)

提示描述
security_audit基于IOC提取的全面PCAP安全分析
network_troubleshooting逐步网络诊断
incident_response安全事件调查工作流程
traffic_analysis基于GeoIP映射的深度流量分析
network_baseline建立正常的交通模式

______________________________________________________________________

🧪 发展

# Clone and setup
git clone https://github.com/cortexc0de/netmcp.git
cd netmcp
python -m venv .venv
source .venv/bin/activate

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=netmcp --cov-report=html

# Linting
ruff check src/netmcp/ tests/
ruff format --check src/netmcp/
mypy src/netmcp/

项目结构

src/netmcp/
├── server.py                # FastMCP server entry point
├── core/
│   ├── security.py          # 5-layer input validation + rate limiting
│   └── formatter.py         # MCP response formatting
├── interfaces/
│   ├── tshark.py            # TShark async CLI wrapper
│   ├── nmap.py              # python-nmap wrapper
│   └── threat_intel.py      # URLhaus + AbuseIPDB clients
├── tools/                   # 48 MCP tools across 11 modules
├── resources/               # 3 MCP resources
└── prompts/                 # 5 MCP prompts

______________________________________________________________________

🤝 贡献

欢迎投稿!看 贡献.md 作为指导方针。

  1. 分叉存储库
  2. 创建要素分支(git checkout -b feat/amazing-feature)
  3. 运行测试(pytest tests/ -v)
  4. 提交拉取请求

______________________________________________________________________

📄 许可证

MIT许可证——见 许可证 了解详情。

______________________________________________________________________

🙏 致谢

______________________________________________________________________

通过AI驱动的数据包捕获、扫描和威胁情报来改变您的网络分析。

目录标签

目录标签

PythonClaude安全网络分析本地部署数据包捕获威胁检测网络扫描协议分析

支持客户端

Claude DesktopClaudeCursor

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

40

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP