Wordfence MCP — AI Security Monitoring for WordPress (17 Tools)
What is Wordfence MCP?
Wordfence MCP means running your WordPress security through an AI assistant that can read Wordfence's data and act on it. Cowboy MCP's Wordfence integration gives an AI agent 17 security tools over the Model Context Protocol, so your assistant can scan for malware, watch live traffic, review failed logins, and block attackers — working as a security analyst while you stay the approver.
MCP is the open standard that lets an AI client discover and call those tools, and the same Cowboy MCP plugin that manages the rest of your site surfaces the Wordfence tools automatically whenever Wordfence is active. Instead of you reading scan logs and traffic tables by hand, the agent pulls them, explains what it sees in plain English, and proposes the next step.
What can an AI agent do for site security?
An agent can run the routine security work a busy site owner rarely gets to: trigger scans and triage the findings, watch live traffic for suspicious patterns, review failed and invalid-username logins, block hostile IPs and countries, and check the firewall's status. Each of the 17 tools maps to a real Wordfence action, and the read-only ones let the agent investigate before it recommends anything.
The tools group into five areas. The names below are the real tool identifiers the agent sees.
Scans
| Tool | What it does |
|---|---|
wp_wordfence_start_scan |
Kick off an asynchronous malware and vulnerability scan |
wp_wordfence_get_scan_status |
Check scan progress and the latest results |
wp_wordfence_list_scan_issues |
List findings, filtered by status, type, or severity |
wp_wordfence_resolve_scan_issue |
Ignore an issue permanently, ignore until it changes, or delete it |
wp_wordfence_delete_scan_issues |
Bulk-clear resolved or ignored issues |
Blocking
| Tool | What it does |
|---|---|
wp_wordfence_list_blocks |
List existing IP, country, and pattern blocks |
wp_wordfence_block_ip |
Block an IP, with self-lockout prevention and an optional expiry |
wp_wordfence_unblock_ip |
Remove an IP block by address or ID |
wp_wordfence_block_country |
Block countries from login or the whole site (Wordfence Premium) |
wp_wordfence_block_pattern |
Block by IP range, hostname, user agent, or referrer |
Firewall
| Tool | What it does |
|---|---|
wp_wordfence_firewall_status |
Read firewall mode, WAF state, and brute-force protection |
wp_wordfence_set_firewall_mode |
Switch the firewall between enabled, learning, and disabled |
Traffic and login monitoring
| Tool | What it does |
|---|---|
wp_wordfence_get_live_traffic |
Read recent traffic hits, filtered by IP, status code, or action |
wp_wordfence_get_login_attempts |
Review login history, including failed and invalid-username attempts |
wp_wordfence_get_activity_report |
Summarize top blocked IPs, countries, failed logins, and attack counts |
Settings
| Tool | What it does |
|---|---|
wp_wordfence_get_settings |
Read Wordfence settings by category |
wp_wordfence_update_settings |
Update allowlisted settings; sensitive keys like the API key are blocked |
Three real prompts, to make it concrete:
- "Scan the site and block every IP that failed login more than ten times today."
- "Show me the top blocked countries and the failed-login attempts from the last 24 hours."
- "Run a full scan and list every new high-severity issue it finds, then explain each one."
Who stays in control — the AI or you?
The framing is AI as security analyst, human as approver. The agent does the tedious investigation — reading scans, traffic, and login history are all read-only tools it can run freely — but the operations that change your site's security state stay under your control. It surfaces the evidence and recommends action; you decide whether to take it.
The safeguards are concrete, and they match the tools' real safety flags:
- Safe mode confirms before it runs the state-changing operations flagged destructive: starting a scan, switching firewall mode, bulk-deleting issues, and updating settings all require your explicit confirmation while safe mode is on.
- Blocks are logged, and IP and pattern blocks are reversible. Blocking an IP, country, or pattern runs as a recorded write, not a silent one:
wp_wordfence_block_ipincludes self-lockout prevention so an agent can't lock you out of your own site. An IP or pattern block is undone with a single unblock; country blocks are managed from the Wordfence dashboard. - Dry run lets any write tool preview its effect before it acts, and the audit log records every tool call, so you can see exactly what the agent scanned, read, or blocked.
- Sensitive settings are off-limits. The settings tool accepts only allowlisted keys; the Wordfence API key and license flags are blocked outright, so an agent can adjust protection without touching credentials.
Your MCP client also asks you to approve each tool call, so a human stays in the loop at both layers. The full guardrail model lives on the security page.
What are Wordfence MCP's limits?
Cowboy MCP orchestrates Wordfence; it does not replace it. Wordfence still does the scanning, firewalling, and blocking — the tools drive its existing features through its own APIs, so the agent inherits Wordfence's behavior and its limits. Country blocking and some protections need Wordfence Premium, and the agent cannot clean infected files beyond what Wordfence itself offers or act as a firewall in Wordfence's place.
In practice that means Wordfence must be installed and active for any of this to work, and the quality of the analysis depends on Wordfence's own data. The agent's value is in triage and response speed — noticing an attack pattern in live traffic and blocking the source in one conversation — not in reinventing the security engine underneath.
How do I set it up?
Setup takes about five minutes and needs no code. Install the Cowboy MCP plugin, make sure Wordfence is active so the security tools register, then connect your AI assistant and start with a read-only request like a firewall-status check. The Wordfence tools appear automatically once both plugins are running — there is nothing extra to switch on.
- Install the plugin. In wp-admin, go to Plugins → Add New, search for "Cowboy MCP", and click Install then Activate. It is free on the WordPress.org plugin directory (opens in new tab) and needs WordPress 6.2+ and PHP 8.0+.
- Connect your AI. Open Settings → Cowboy MCP and follow the guided setup. See how to connect WordPress to Claude or how to connect WordPress to ChatGPT for the full walkthrough.
- Ask for something real. Start read-only — "what's my firewall status and any failed logins today?" — then let it act. Safe mode confirms before it runs a scan or changes firewall mode.
FAQ
Does Wordfence MCP replace Wordfence?
No. It drives your existing Wordfence install rather than replacing it — Wordfence still runs the scans, firewall, and blocking, and the tools simply call those features over MCP. Wordfence must be installed and active for the security tools to register; without it, the agent does not see them.
Can the AI accidentally block my own IP and lock me out?
The IP-block tool includes self-lockout prevention, so an agent cannot block the address it would need to reach your site. Every block is recorded in the audit log, and an IP or pattern block is reversed with a single unblock, while country blocks are managed from the Wordfence dashboard. You can also preview a block with a dry run first.
Does it need Wordfence Premium?
Not for the core work. Scanning, IP blocking, live traffic, login history, and firewall control all work with the free version of Wordfence. Country blocking and a few advanced protections require Wordfence Premium — the country-block tool says so — but everything else runs on the free tier.