Skip to main content
Glama
CyberSafe MCP

CyberSafe MCP

by kshitij9896
README.md
# CyberSafe MCP (v0.3 — Hybrid AI/ML Edition)

An open-source, plain-language **Model Context Protocol (MCP)** server built in Python to help everyday users—especially people **40+**—stay safe on phones, laptops, and AI tools.

Built with the official [Python MCP SDK v2](https://py.sdk.modelcontextprotocol.io/) (`mcp>=2.0.0`).

## What's Inside v0.3

### Hybrid AI/ML + Regional Rules Scam Detection
- `analyze_scam_message(message, channel, region)` now runs a **Hybrid Engine**:
  1. **Explainable Regional Packs** (`global`, `india`, `us_uk`) in `src/cybersafe_mcp/scam_packs/*.json` for clear, zero-jargon red flags (Digital Arrest, UPI QR fraud, KYC traps, IRS/HMRC scams, AI voice-cloning).
  2. **Local HuggingFace AI Model** (optional `ml` extra) that catches subtle or paraphrased scams with no exact keywords—running 100% locally in memory with zero user data sent to third-party AI APIs.
  - Default model: [`mrm8488/bert-tiny-finetuned-sms-spam-detection`](https://huggingface.co/mrm8488/bert-tiny-finetuned-sms-spam-detection) (~17.6 MB, fast on CPU).
  - Multilingual alternative: set `CYBERSAFE_ML_MODEL=Horizon-Labs/phishing-scam-detector-base` ([model card](https://huggingface.co/Horizon-Labs/phishing-scam-detector-base)).

### Other Security Tools
- `check_url_safety(url)` — Local phishing heuristics + optional live [URLhaus API](https://urlhaus.abuse.ch/api/) lookups (never visits the link).
- `check_email_breach(email)` — Live breach check via the free, no-key [XposedOrNot API](https://xposedornot.com/api_doc).
- `get_latest_alerts(limit, consumer_only, keyword)` — Live consumer-filtered alerts from the [CISA KEV Catalog](https://www.cisa.gov/known-exploited-vulnerabilities-catalog).
- `check_password_hygiene(password_sample)` — Pure local offline password-strength evaluator.
- `get_daily_cyber_tip(category)` — One 60-second daily tip (`phone`, `laptop`, `ai`, `general`).

## Quick Start

### Lightweight Mode (Rules Only — Fastest Install)
```bash
uv sync --extra dev
uv run pytest
uv run mcp dev src/cybersafe_mcp/server.py
```

### Full Hybrid AI/ML Mode (Rules + Local HuggingFace Model)
```bash
uv sync --extra dev --extra ml
uv run pytest
uv run mcp dev src/cybersafe_mcp/server.py
```
On the first call to `analyze_scam_message`, the ~17.6 MB BERT-Tiny model downloads once into your local HuggingFace cache and runs completely offline after that.

To swap models without changing code:
```bash
# macOS / Linux
CYBERSAFE_ML_MODEL=Horizon-Labs/phishing-scam-detector-base uv run mcp dev src/cybersafe_mcp/server.py

# Windows PowerShell
$env:CYBERSAFE_ML_MODEL="Horizon-Labs/phishing-scam-detector-base"
uv run mcp dev src/cybersafe_mcp/server.py
```

## Remote Deployment (Streamable HTTP)
```bash
uv run cybersafe-mcp --transport streamable-http --host 0.0.0.0 --port 8000
```
Health endpoint: `GET /health` (also reports whether the AI/ML engine is enabled and which model is configured).


<!-- mcp-name: io.github.<kshitij9896>/cybersafe-mcp -->

TDQS

A4/5.0

Scored across 6 tools

Disambiguation5/5

Each tool targets a clearly distinct artifact: a URL, an email address, a message transcript, a threat feed, a password, and a daily tip. There is no overlap in inputs or purpose, so an agent can select the right tool from the input type alone.

Naming Consistency5/5

All six tools follow a consistent snake_case verb_noun pattern (check_url_safety, get_latest_alerts, analyze_scam_message, etc.). The check_/analyze_/get_ prefixes are all conventional verb forms and remain predictable across the set.

Tool Count5/5

Six tools is well-scoped for a consumer cybersecurity helper; each tool covers a distinct check with no redundancy. Nothing feels padded or missing at the structural level.

Completeness4/5

The surface covers the core consumer safety checks: link, email breach, message scam, vulnerability alerts, password, and tips. Minor gaps exist for adjacent checks such as IP/domain reputation or phone-number breach lookup, but agents can work around them.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues