mcpField
🛡
🛡️ CyberShield MCP — Servidor MCP de Defensa Autónoma (Windows)

🛡️ CyberShield MCP — Servidor MCP de Defensa Autónoma (Windows)

本地服务
github.com/jmatias2411安全574 周前更新

关于 🛡️ CyberShield MCP — Servidor MCP de Defensa Autónoma (Windows)

CyberShield MCP 是面向 Windows 的防御与诊断 MCP 服务,可供 Claude Desktop、LangChain Agent 和脚本调用。它将系统安全操作作为 MCP 工具、资源和提示词提供,也可通过 FastAPI 暴露 HTTP 端点。

主要功能

  1. 01执行主机 Ping 检查
  2. 02阻止 IP 地址
  3. 03查看防火墙规则资源
  4. 04诊断系统并检查可疑进程
  5. 05通过 FastAPI 提供 HTTP 端点

适用场景

  1. 01从 Claude Desktop 检查网络连通性
  2. 02通过 Agent 自动执行 IP 阻止
  3. 03查看防火墙规则并诊断系统
  4. 04将防御工具接入 HTTP 工作流

MCP 相关

该 MCP 服务向客户端公开 Windows 防御与诊断工具、系统资源和提示词。也可通过 FastAPI 将相关工具作为 HTTP 端点提供。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

暂未收录安装方式

我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。

代码仓库

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

🛡️ CyberShield MCP — 自主防御 MCP 服务(Windows)

CyberShield MCP 是一款功能齐全的 MCP(Model Context Protocol)服务,旨在运行防御工具、查询系统资源,并借助人工智能做出安全决策。

它运行于 Windows,可安全地开放关键系统命令,并可通过 Claude Desktop 或 LangChain Agent 控制,从而实现具备上下文感知能力、精准且自主的防御。


⚙️ 要求和依赖项

💡 目前仅兼容 Windows(使用 netsh、ping、Get-WinEvent 等)

快速安装:

pip install mcp[cli] langchain langchain-ollama fastapi uvicorn requests

如果使用 .env 中的环境变量,请执行:

mcp install -f

📂 项目结构

cybershield_mcp/
├── server.py               # Punto de entrada principal
├── pyproject.toml          # Configuración del proyecto (con uv o poetry)
├── README.md               # Descripción del proyecto
├── .env                    # Variables de entorno (si usás `mcp install -f`)
│
├── tools/                  # Herramientas de defensa y diagnóstico
│   ├── __init__.py
│   ├── firewall.py         # Bloqueo y desbloqueo de puertos/IPs
│   ├── diagnostics.py      # Ping y escaneo con nmap
│   ├── logs.py             # Análisis de logs con Context
│   ├── hardening.py        # Fortalecimiento del sistema
│   ├── agent_response.py   # Acciones automáticas y diagnóstico rápido
│   ├── network_watch.py    # Conexiones activas y detección de IPs raras
│   ├── eventlog_analyzer.py # Revisión de eventos de seguridad (logins fallidos, privilegios)
│   └── processes.py        # Escaneo y gestión de procesos activos
│
├── resources/
│   ├── __init__.py
│   └── firewall_state.py   # Consulta del estado actual del firewall
│
├── prompts/
│   ├── __init__.py
│   └── threat_response.py  # Prompt para decidir acción ante amenazas
│
├── utils/
│   ├── __init__.py
│   └── commands.py         # Funciones comunes para subprocess seguro
│
├── fastapi_mcp_server.py   # Exposición HTTP de herramientas MCP para integración externa
├── agent_langchain.py      # Agente IA con LangChain + Ollama usando MCP vía FastAPI
├── Dockerfile              # Imagen Docker del servidor FastAPI
├── docker-compose.yml      # Despliegue simplificado con Docker Compose

🧠 AI 使用模式

🧠 Claude Desktop
  1. 在 Claude 中安装你的服务:
uv run mcp install server.py --name "CyberShield Agent"
  1. 运行 MCP 服务:
uv run mcp dev server.py
  1. Claude 现在可以使用以下语句:
  • “Ping 一下 8.8.8.8”
  • “封锁 IP 192.168.1.50”
  • “启用隔离模式”
  • “我正在遭受攻击吗?”

🔗 LangChain + Ollama(自主 Agent 模式)
  1. 启动 FastAPI 服务:
uvicorn fastapi_mcp_server:app --port 4242
  1. 使用 agent_langchain.py 启动一个 Agent,并使用如下工具:
  • 自动封锁 ip
  • 系统诊断
  • 列出可疑进程
python agent_langchain.py
  1. Agent 将根据你的 LLM 决定何时运行防御工具(封锁、诊断等)

🐳 Docker 集成

Dockerfile

已包含在项目中。它会创建 FastAPI 服务的镜像,以便在任何环境中运行。

构建和运行:
docker build -t cybershield-api .
docker run -p 4242:4242 --name cybershield cybershield-api
或使用 docker-compose:
docker-compose up --build

这样你就能获得:

  • 可复现性
  • 快速部署
  • 受控环境
  • 无需直接安装即可将 MCP 部署到 Linux 服务上的可能性

🧪 使用 MCP Inspector 测试

运行:

uv run mcp dev server.py

与 Claude 或 LangChain 交互时,打开 Web Inspector。

你可以查看:

  • 已运行的函数
  • 传入的参数
  • 响应时间和错误

💬 快速示例(Claude 或 LangChain)

🛠 @tool:do_ping(host: str)

“Ping 一下 8.8.8.8”

📦 @resource:firewall://rules

“显示防火墙的活动规则”

🧠 @prompt:suggest_block_action(threat_description)

“我检测到来自 192.168.1.42 的可疑连接。我应该怎么做?”

🔗 FastAPI

GET http://localhost:4242/tools/system_diagnostic


🧰 使用 CyberShield MCP 可以做什么?

✅ 自动化 Windows 系统防御
✅ 通过 AI 运行关键命令
✅ 加固系统并缩小攻击面
✅ 协调 AI Agent 或对话模型的响应
✅ 将工具作为 HTTP 端点开放,以支持更广泛的集成
✅ 使用 Docker 轻松部署到任何环境

准备好开启智能防御了吗?克隆它,连接到 Claude 或你的 LangChain Agent,然后开始保护你的系统吧!💥

MseeP.ai Security Assessment Badge

Verified on MseeP

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。