mcp-security-server

mcp-security-server

Provides AI agents with standardized security scanning capabilities for authorized assessments, including host detection, port scanning, service fingerprinting, web vulnerability scanning, CVE verification, and report generation, all with unified JSON output and strict compliance controls.

Category
访问服务器

README

MCP Security Scanner Server v2.0

Python MCP Kali License Security

Professional production-grade MCP Server for security assessment. Powered by Model Context Protocol, built for Kali Linux.

Overview

A professional Model Context Protocol (MCP) Server that provides AI agents with standardized security scanning capabilities. Designed for authorized security assessments with strict compliance controls.

Key Features

  • 7-Step Mandatory Flow — Every tool follows: param validation → security filtering → boundary checks → business logic → result packaging → exception capture → logging
  • Zero Command Injection — All shell calls use parameter arrays, never string concatenation
  • Mandatory Authorization — legal_authorized=true required for all scan operations
  • 8 CVE Verification — Log4Shell, Spring4Shell, Apache Path Traversal, HTTP/2 Rapid Reset, and more
  • Standardized Output — Unified JSON response: code/msg/target/vuln_list/risk_level/cvss_score/suggest
  • Professional Logging — Timestamped logs with task IDs, scan trails, and audit records

Architecture

mcp-security-server/
├── server.py              # MCP Server Entry Point
├── core/                  # Business Logic Layer
│   ├── scanner.py         # Scanning Engine (6 tools, 37KB)
│   ├── result.py          # Unified Response Builder
│   ├── analyzer.py        # CVSS 3.1 Scoring & Vulnerability DB
│   └── reporter.py        # Multi-format Report Generator
├── utils/                 # Infrastructure Layer
│   ├── executor.py        # Safe Command Executor (Parameter Arrays)
│   ├── validator.py       # Parameter Validation & Whitelist
│   ├── logger.py          # Professional Logging System
│   └── env.py             # Kali Environment Detection
└── requirements.txt       # Dependencies

Quick Start

1. Install Dependencies

# Python packages
pip3 install mcp pydantic

# System tools (Kali Linux)
sudo apt update && sudo apt install -y nmap curl

2. Start Server

cd mcp-security-server
python3 server.py

3. Configure MCP Client

Add to your MCP client configuration (e.g., Claude Desktop, opencode):

{
  "mcpServers": {
    "mcp-security-scanner": {
      "command": "python3",
      "args": ["/path/to/mcp-security-server/server.py"]
    }
  }
}

Tools

Tool Description Required Params
host_alive_detect Host alive detection (ICMP + TCP SYN) target, legal_authorized
port_scan Port scanning (SYN/Connect) target, legal_authorized
service_fingerprint Service version detection target, legal_authorized
web_vuln_scan Web vulnerability scanning target, legal_authorized
cve_poc_check CVE POC verification target, legal_authorized, cve_id
report_generate Security report generation target, legal_authorized, scan_data
env_check Environment & dependency check (none)

Usage Examples

Host Alive Detection

{
  "target": "192.168.1.1",
  "legal_authorized": true,
  "timeout": 15
}

Port Scan

{
  "target": "192.168.1.1",
  "legal_authorized": true,
  "ports": "80,443,8080,8443",
  "scan_type": "syn"
}

CVE Verification

{
  "target": "192.168.1.1",
  "legal_authorized": true,
  "cve_id": "CVE-2021-44228",
  "port": 8080
}

Generate Report

{
  "target": "192.168.1.1",
  "legal_authorized": true,
  "scan_data": "{\"vuln_list\":[...],\"suggest\":[...]}",
  "format_type": "html"
}

Supported CVEs

CVE Name CVSS Verification Method
CVE-2021-44228 Log4Shell 10.0 Java service detection
CVE-2022-22965 Spring4Shell 9.8 Spring/Tomcat detection
CVE-2023-22515 Confluence Privilege 10.0 Setup endpoint check
CVE-2022-26134 Confluence OGNL 9.8 Confluence detection
CVE-2021-41773 Apache Path Traversal 7.5 Path traversal test
CVE-2021-42013 Apache Path Traversal 2 7.5 Path traversal test
CVE-2023-44487 HTTP/2 Rapid Reset 7.5 HTTP/2 support check
CVE-2021-3449 OpenSSL NULL deref 5.9 Version detection

Standardized Output

{
  "code": 0,
  "msg": "success",
  "target": "192.168.1.1",
  "status": "completed",
  "scan_data": { ... },
  "vuln_list": [
    {
      "vuln_id": "CVE-2021-44228",
      "vuln_name": "Log4Shell",
      "cve_id": "CVE-2021-44228",
      "cvss_score": 10.0,
      "risk_level": "Critical",
      "confidence": "Suspected",
      "description": "Apache Log4j2 RCE",
      "evidence": "Java service detected",
      "remediation": "Upgrade Log4j to 2.17.0+"
    }
  ],
  "risk_level": "critical",
  "cvss_score": 10.0,
  "suggest": ["URGENT: Fix critical vulnerability immediately"],
  "task_id": "TASK-20260822100000-a1b2c3d4",
  "timestamp": "2026-08-22T10:00:00",
  "duration": 12.34
}

Logging

Logs are automatically saved to log/ directory:

Log File Purpose
main_YYYY-MM-DD.log General operations
scan_YYYY-MM-DD.log Scan activities
error_YYYY-MM-DD.log Errors & exceptions
audit_YYYY-MM-DD.log Security audit trail

Compliance

This tool is designed for:

  • Security assessments with written authorization
  • Internal security team vulnerability verification
  • Security research and education

PROHIBITED: Unauthorized scanning, data theft, system damage

License

MIT License - Authorized security testing only

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选