Skip to main content
Glama

Hospital WAF Management System MCP Server

Python License MCP

Englisch | 中文

Ein MCP-Server für eine Web Application Firewall (WAF) in Krankenhäusern, der KI-Assistenten WAF-Regelprüfungsfunktionen zur Verfügung stellt. Er unterstützt die Erkennung von SQL-Injection, XSS, Befehlsinjection und Pfad-Traversal und enthält spezielle Regeln für Krankenhausumgebungen.

✨ Funktionen

  • 🔒 SQL-Injection-Erkennung — Identifizierung gängiger SQLi-Angriffsmuster (UNION-Injection, Boolean-based Blind, Time-based Blind, Error-based Injection)

  • 🎯 XSS-Cross-Site-Scripting-Erkennung — Erkennung von reflektiertem/gespeichertem XSS (script-Tags, Event-Handler, JS-URIs)

  • Befehlsinjection-Erkennung — Identifizierung von Angriffen zur Ausführung von Unix/Windows-Systembefehlen

  • 📁 Pfad-Traversal-Erkennung — Erkennung von Directory-Traversal-Angriffen und Encoding-Umgehungen

  • 🏥 Spezielle Krankenhausregeln — Abdeckung gängiger Schwachstellenmuster in HIS/PACS/LIS/RIS

  • 🔄 Hot-Reloading von Regeln — Keine Notwendigkeit, den Dienst nach Regeländerungen neu zu starten

  • 🧪 Selbsttest — Integrierte Angriffsbeispiele zur Überprüfung der Engine-Fähigkeiten

  • Leichtgewichtiger Betrieb — Reine Python-Regex-Engine, keine externen Abhängigkeiten

Related MCP server: Smart EHR MCP Server

🚀 Erste Schritte

1. Installation

# 克隆仓库
git clone https://github.com/12211725-star/hospital-waf-mcp.git
cd hospital-waf-mcp

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

2. Integration in den MCP-Client

Fügen Sie Folgendes zur Konfigurationsdatei des MCP-Clients hinzu:

{
  "mcpServers": {
    "hospital-waf-mcp": {
      "command": "python",
      "args": ["-m", "waf_mcp"],
      "env": {
        "WAF_MCP_LOG_LEVEL": "INFO"
      }
    }
  }
}

Docker-Methode

{
  "mcpServers": {
    "hospital-waf-mcp": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "hospital-waf-mcp"],
      "env": {
        "WAF_MCP_LOG_LEVEL": "INFO"
      }
    }
  }
}

Streamable HTTP-Remote-Bereitstellung

export WAF_MCP_TRANSPORT=http
export WAF_MCP_HOST=0.0.0.0
export WAF_MCP_PORT=8000
python -m waf_mcp

MCP-Endpunkt: http://<host>:8000/mcp Gesundheitsprüfung: GET /health

📖 Verwendung

SQL-Injection erkennen

In Claude / Cursor / anderen MCP-Clients:

请帮我检测这个请求是否有安全问题:
URL: https://example.com/search?q=1' OR '1'='1

Die KI ruft das Tool waf_check_request auf und gibt Folgendes zurück:

[
  {
    "rule_id": "sqli-001",
    "category": "SQL Injection",
    "severity": "high",
    "matched": "1' OR '1'='1",
    "description": "检测到 SQL 注入特征"
  }
]

XSS-Angriffe erkennen

检测这个 POST 请求的 body:
<script>alert('xss')</script>

Regelstatistiken anzeigen

当前 WAF 引擎加载了多少规则?

🎯 Prompt-Leitfaden

Szenarien zur Sicherheitsbewertung

我需要对一个请求进行安全检测,
URL 是 https://hospital.example.com/api/patient?id=1 UNION SELECT,
请帮我分析是否存在攻击特征。

Szenarien zur Regelwartung

我刚刚更新了 WAF 规则文件,
请帮我重新加载规则并确认加载成功。

Szenarien zur Engine-Validierung

请运行 WAF 引擎自检测试,
确认 SQL 注入和 XSS 检测功能正常。

Szenarien zur Protokollanalyse

帮我检测这个可疑请求的完整参数:
URL: https://api.hospital.com/query
Method: POST
Body: {"filter": "'; DROP TABLE users; --"}
Headers: {"Content-Type": "application/json"}

🛠️ Tool-Liste

Tool

Beschreibung

Parameter

waf_check_request

WAF-Anfrageprüfung

url: Anfrage-URL, method: HTTP-Methode, headers: Header, body: Body, cookies: Cookie

waf_rule_stats

Regelstatistiken

Keine Parameter

waf_reload_rules

Hot-Reloading von Regeln

Keine Parameter

waf_run_self_tests

Selbsttest

Keine Parameter

📖 Umgebungsvariablen

Variable

Beschreibung

Standardwert

WAF_MCP_TRANSPORT

Transportprotokoll (stdio/http/sse)

stdio

WAF_MCP_HOST

HTTP-Listen-Adresse

127.0.0.1

WAF_MCP_PORT

HTTP-Listen-Port

8000

WAF_MCP_LOG_LEVEL

Protokollebene

INFO

WAF_RULES_FILE

Pfad zur Regeldatei

waf_mcp/rules/waf_rules.mcp.json

📋 Erkennungsfähigkeiten

SQL-Injection-Erkennung

Risikotyp

Schweregrad

Erkennungsbedingung

UNION-Injection

Hoch

UNION SELECT etc.

Boolean-based Blind

Hoch

AND/OR boolesche Ausdrücke

Time-based Blind

Hoch

SLEEP/BENCHMARK etc.

Error-based Injection

Hoch

EXTRACTVALUE/UPDATEXML etc.

Stacked Queries

Hoch

Mehrere SQL-Befehle durch Semikolon getrennt

XSS-Erkennung

Risikotyp

Schweregrad

Erkennungsbedingung

script-Tag

Hoch

<script> Tag-Injection

Event-Handler

Hoch

onclick/onerror etc.

JavaScript URI

Mittel

javascript: Protokoll

SVG-Injection

Mittel

<svg onload> etc.

Befehlsinjection-Erkennung

Risikotyp

Schweregrad

Erkennungsbedingung

Unix-Befehlsinjection

Kritisch

;

& $ ` Pipe-Verbindungen

Windows-Befehlsinjection

Kritisch

&

^ Befehlsverbindungen

Gefährliche Befehle

Kritisch

cat/ls/wget/curl etc.

Pfad-Traversal-Erkennung

Risikotyp

Schweregrad

Erkennungsbedingung

Directory-Traversal

Hoch

../ Pfad-Traversal

URL-Encoding-Umgehung

Hoch

%2e%2e/ etc. Encoding

Double-Encoding-Umgehung

Hoch

%252e%252e/ etc.

Spezielle Krankenhaus-Szenarien

Systemtyp

Schlüsselwörter

HIS

Krankenhausinformationssystem, Ambulanz, Station, Registrierung

PACS

Bildgebung, DICOM, Radiologie

LIS

Labor, Laboruntersuchung, Biochemie

RIS

Radiologie-Informationssystem, Bilddiagnostik

EMR

Elektronische Patientenakte, Krankheitsverlauf

🔧 Entwicklung

git clone https://github.com/12211725-star/hospital-waf-mcp.git
cd hospital-waf-mcp
pip install -e .

# 运行测试
python scripts/run_functional_tests.py

# 本地运行
python -m waf_mcp

📁 Projektstruktur

hospital-waf-mcp/
├── waf_mcp/                  # MCP 服务包
│   ├── __init__.py
│   ├── __main__.py
│   ├── config.py
│   ├── server.py
│   ├── version.py
│   ├── waf_engine.py
│   └── rules/
│       └── waf_rules.mcp.json
├── scripts/                  # 脚本工具
├── modelscope.yaml           # 魔搭配置
├── mcp.json                  # MCP 元数据
├── mcp_config.json           # MCP 客户端配置
├── pyproject.toml            # Python 项目配置
└── README.md

📄 Lizenz

MIT-Lizenz

Install Server
A
license - permissive license
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that enables AI assistants to perform YARA rule-based threat analysis on files and URLs, supporting comprehensive rule management and detailed scanning results.
    23
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that connects AI tools to Electronic Health Records using SMART on FHIR, allowing secure searching, querying, and analysis of patient data from compatible EHRs.
    84
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for AI agent security guardrails. Provides input validation, prompt injection detection, PII redaction, output filtering, policy enforcement, rate limiting, and comprehensive audit logging.
    45
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    A governed, audited Model Context Protocol server that provides AI agents with secure, read-only access to a clinical knowledge base through least-privilege tools, policy validation, and append-only audit logging.
    MIT

View all related MCP servers

Related MCP Connectors

  • A Model Context Protocol server for Wix AI tools

  • MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.

  • Hosted MCP server exposing US hospital procedure cost data to AI assistants

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/12211725-star/hospital-waf-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server