Flow of our MCP Agent

Modern phishing attacks are smarter than ever. They impersonate executives, mimic trusted brands, and evade traditional filters with ease. To fight back, I built an autonomous AI phishing detector — a system that uses Claude AI as an intelligent agent capable of analyzing, reasoning, and acting like a real security analyst.

The Vision

The goal was simple:
Create an AI-powered system that thinks for itself — identifying phishing attempts in real time, using contextual reasoning and external threat intelligence only when necessary.

Unlike rule-based or static ML models, this system is self-directed. It decides when to investigate, which tools to use, and how to synthesize results into a final verdict.

The Problem

Modern phishing campaigns are growing exponentially:

Traditional defenses fail because:

What’s needed is an autonomous system that acts like a security analyst: adaptive, context-aware, and tireless.

The Solution: An Autonomous AI Agent

This system uses Claude 4 via the Model Context Protocol (MCP) to autonomously detect, verify, and classify phishing emails.

Core Capabilities

  1. Understands natural language and email intent
  2. Extracts and investigates suspicious URLs/domains
  3. Decides autonomously whether to call threat intelligence APIs
  4. Synthesizes findings into explainable recommendations
  5. Operates continuously, without human intervention

Architecture Overview

Orchestration: n8n
Agent: Claude Sonnet 4
Threat Intel: VirusTotal
Framework: Model Context Protocol (MCP)
Email I/O: Gmail API

Flow Summary:

  1. n8n triggers every 5 minutes to fetch unread Gmail messages
  2. Claude AI analyzes emails and extracts potential IOCs (Indicators of Compromise)
  3. If necessary, it calls a custom check_virustotal tool
  4. It reevaluates findings with reputation data
  5. A JavaScript node formats a threat report and emails the SOC team

How the AI Agent Thinks

Here’s what autonomy looks like in practice:

  1. Initial Review — Claude reads sender, subject, and body, looking for red flags like urgency or typosquatting.
  2. Tool Decision — If URLs appear suspicious, it independently calls the check_virustotal tool.
  3. Verification — VirusTotal returns domain reputation data (e.g., 12/95 malicious detections).
  4. Synthesis — Claude combines results into a contextual risk score and provides an explainable recommendation: Allow, Quarantine, or Block.

Example

Email:
From: security@paypa1-verify.com
Subject: URGENT: Verify Your Account

Claude’s Reasoning:

This reasoning and final decision are automatically emailed to the security team.

Below you can see our agent running in real time:

Why MCP Matters

The Model Context Protocol is what enables Claude to act like an autonomous analyst. Instead of hardcoding logic (“always call VirusTotal”), MCP allows the model to reason about tool usage contextually.

That means:

Performance Snapshot

Metric Result Detection Accuracy High (context-adaptive) False Positives <5% Avg. Processing Time 8–15 seconds per email Daily Throughput ~2,800 emails Cost per Email $0.01–$0.03 VirusTotal Calls 10–20/day

Final Report Print Out

Key Advantages

1. True Autonomy

The AI agent determines its own investigation path — no static rules or manual triggers.

2. Context-Aware Intelligence

Understands linguistic cues, sender reputation, and behavioral context to differentiate legitimate emails from scams.

3. Explainable AI

Every decision comes with full reasoning and confidence scores, empowering analysts to trust (and audit) outcomes.

4. Scalable & Extensible

Add tools like WHOIS, URLScan, or Passive DNS with minimal setup — Claude learns to use them dynamically.

5. Cost Efficiency

By reasoning before acting, the system drastically reduces unnecessary API usage.

Future Enhancements

Tool Additions:

Integrations:

Real-World Use Cases

Enterprise SOCs

Automate triage, cut analyst workload by 80%, and maintain 24/7 coverage.

Financial Services

Prevent business email compromise (BEC) and fraudulent wire requests with real-time detection.

SMBs

Affordable AI-based protection without needing a full security team.

Sample Detections

Contributing

This is an open-source initiative. Contributions are welcome in:

About the Creator

Max Matkovski
AI/ML Engineer | Security Automation Enthusiast
📧 maxmatkovski [at] gmail [dot] com
🔗 linkedin.com/in/maxmatkovski