by gensecaihq
Model Context Protocol (MCP) server for pfSense firewall management. Control firewall rules, VPNs, DNS, DHCP and diagnostics in natural language from Claude Desktop, Claude Code or any MCP client — 333 wire-format-verified tools for the pfSense REST API, with safety guardrails, config backup and rollback on every change.
# Add to your Claude Code skills
git clone https://github.com/gensecaihq/pfsense-mcp-serverGuides for using mcp servers skills like pfsense-mcp-server.
pfsense-mcp-server is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by gensecaihq. Model Context Protocol (MCP) server for pfSense firewall management. Control firewall rules, VPNs, DNS, DHCP and diagnostics in natural language from Claude Desktop, Claude Code or any MCP client — 333 wire-format-verified tools for the pfSense REST API, with safety guardrails, config backup and rollback on every change. It has 124 GitHub stars.
pfsense-mcp-server's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/gensecaihq/pfsense-mcp-server" and add it to your Claude Code skills directory (see the Installation section above).
pfsense-mcp-server is primarily written in Python. It is open-source under gensecaihq on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh pfsense-mcp-server against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
332 tools across every subsystem · wire-format verified against the pfSense REST API · safety guardrails on every change
You: Block all traffic from 203.0.113.5 on WAN
Claude: ✓ created block rule → ✓ applied changes → rollback point: config revision 42
You: Why can't 192.168.1.50 reach the internet?
Claude: ran diagnostics → gateway WAN_DHCP is down, and a block rule on LAN matches this host
You: Add a WireGuard peer for my laptop and show me the config
Claude: ✓ created peer on tun_wg0 → here's the client config to import
pfSense MCP Server connects Claude Desktop, Claude Code, and any other MCP client to your pfSense firewall. Ask questions, diagnose issues, and change configuration through conversation. Every destructive action needs explicit confirmation, and the server records the config revision it can be rolled back to.
Letting an AI change a production firewall is only safe if the details are right, and that's where the work went:
Latest release: v1.1.0 · Changelog
[!TIP] Jump to the Quick Start. Setup takes about two minutes with
uvx, and you don't need to clone anything. If this project is useful to you, a ⭐ helps others find it.
Why this exists · Quick start · What you can do · Safety · Supported versions · Authentication · Deployment · Configuration · Testing · MCP compliance · Known limitations · Architecture · Contributing
Managing a pfSense firewall means clicking through web UI tabs, remembering field names, and hoping you don't fat-finger a rule that locks you out. With this MCP server, you describe what you want in plain English and the AI handles the REST API calls, validates inputs, and warns you before anything destructive happens.
What makes it different:
Prerequisites:
[!IMPORTANT] This project is not published on PyPI. A different, unrelated project uses the PyPI name
pfsense-mcp-server, so never runpip install pfsense-mcp-server. Install from Git or from the release assets as shown below.
Option A: run without cloning (uvx):
uvx --from git+https://github.com/gensecaihq/[email protected] pfsense-mcp-server
Option B: clone for development:
git clone https://github.com/gensecaihq/pfsense-mcp-server.git
cd pfsense-mcp-server
pip install -r requirements.txt
cp .env.example .env
# Edit .env: set PFSENSE_URL, AUTH_METHOD, and credentials
Connect to Claude Desktop. Add the server to claude_desktop_config.json:
~/Library/Application Support/Claude/%APPDATA%\Claude\Using the installed entry point (Option A):
{
"mcpServers": {
"pfsense": {
"command": "uvx",
"args": ["--from", "git+https://github.com/gensecaihq/[email protected]", "pfsense-mcp-server"],
"env": {
"PFSENSE_URL": "https://192.168.1.1",
"AUTH_METHOD": "basic",
"PFSENSE_USERNAME": "admin",
"PFSENSE_PASSWORD": "your-password",
"PFSENSE_VERSION": "CE_2_8_1",
"PFSENSE_CA_FILE": "/path/to/pfsense-ca.pem"
}
}
}
}
Or running from a clone (Option B):
{
"mcpServers": {
"pfsense": {
"command": "python3",
"args": ["-m", "src.main"],
"cwd": "/path/to/pfsense-mcp-server",
"env": {
"PFSENSE_URL": "https://192.168.1.1",
"AUTH_METHOD": "basic",
"PFSENSE_USERNAME": "admin",
"PFSENSE_PASSWORD": "your-password",
"PFSENSE_VERSION": "CE_2_8_1",
"PFSENSE_CA_FILE": "/path/to/pfsense-ca.pem"
}
}
}
}
Remove PFSENSE_CA_FILE if your pfSense certificate is signed by a public CA.
About the CA file. pfSense ships with a self-signed certificate from its own
CA, and Python does not read your OS trust store, so verification fails out of
the box. Export the CA at System > Cert. Manager > CAs (the export-certificate
icon), save the PEM anywhere readable, and point PFSENSE_CA_FILE at it. A
missing or unparseable file is a startup error, never a silent downgrade.
VERIFY_SSL=false also connects, and is fine for a throwaway lab. Understand what
it costs: nothing authenticates the firewall, so anything that can intercept the
connection can read the API key and act as the firewall. This tool changes
firewall rules — treat that credential accordingly.
Start talking to your firewall. Open Claude Desktop and ask:
332 tools across every major pfSense subsystem:
| Domain | Tools | What You Can Do |
|---|---|---|
| Firewall Rules | 9 | Create, update, delete, reorder rules. Bulk block IPs. View compiled pf ruleset. |
| Aliases | 5 | Manage host/network/port/URL aliases. Add and remove addresses. |
| NAT | 16 | Port forwards, outbound NAT, 1:1 NAT — full lifecycle management. |
| VPN | 51 | OpenVPN servers and clients, IPsec tunnels, WireGuard peers — CRUD, status, apply. |
| Routing | 16 | Gateways, gateway groups, static routes, default gateway management. |
| DNS | 23 | Unbound resolver and dnsmasq forwarder: host overrides, domain overrides, access lists. |
| DHCP | 17 | Leases, static mappings, address pools, custom options, server config. |
| Certificates | 15 | Certs, CAs, CRLs — generate, renew, export PKCS12. |
| Users | 12 | User accounts, groups, LDAP/RADIUS auth server config. |
| Interfaces | 14 | Interface config, VLANs, bridges, groups. |
| System | 43 | Status, settings, diagnostics, state table, config history, reboot, ping. |
| Services | 14 | Start/stop/restart services. NTP, cron, SSH, service watchdog. |
| Logs | 4 | Firewall log analysis with parsed IPv4/IPv6 filterlog data. Raw tail/grep reads of the dhcpd/filter/resolver/system/auth log files. |
| Traffic Shaping | 12 | Shapers, queues, and limiters for bandwidth management. |
| Schedules | 8 | Time-based firewall rule scheduling. |
| Virtual IPs | 5 | CARP, ProxyARP, and IP Alias management. |
| Troubleshooting | 10 | Diagnose connectivity, blocked traffic, VPN, DHCP, DNS, HA. Full health report. |
| Packages | 49 | HAProxy, ACME/Let's Encrypt, BIND DNS, FreeRADIUS. |
| Utility | 9 | HATEOAS navigation, object ID management, guardrail status. |
AI managing a production firewall needs guardrails. This server has 9 layers:
"Delete firewall rule 5"
1. CLASSIFY → HIGH risk (destructive)
2. ALLOWLIST → tool is permitted
3. SANITIZE → parameters clean (no injection)
4. RATE LIMIT → under 10 deletes/minute
5. DRY RUN? → user can preview first
6. CONFIRM → blocked until confirm=True
7. BACKUP → config revision captured
8. EXECUTE → API call made
9. AUDIT LOG → action recorded with redacted params
Response includes:
"config_backup": {
"pre_change_revision_id": 42,
"rollback_instruction": "To undo this change, restore revisio