search_aliasesLABSCO SUMMARY
Firewall changes an AI can make, safely.
Letting a model touch a production firewall is only reasonable if the plumbing is right, and that is where this one puts its weight: every destructive tool needs an explicit confirm, a config revision is snapshotted first, and the response hands you back the exact one-line rollback. The dry_run preview and verify_descr guard against the classic mistake — deleting the right-numbered but wrong rule after IDs shift. Setup has one real gotcha, the pfSense self-signed CA: export it and set PFSENSE_CA_FILE, because turning verification off leaves the credential exposed to anyone on the path.
What it is
An MCP server that connects Claude Desktop, Claude Code and other MCP clients to a pfSense firewall through its REST API. You describe what you want; it makes the API calls, validates inputs, and runs every change through a guardrail pipeline that backs up the config and can roll it back.
What you get
- The README counts 333 tools across every major subsystem — firewall rules, aliases, NAT, VPN (OpenVPN, IPsec, WireGuard), routing, DNS, DHCP, certificates, users, interfaces, system, services, logs, traffic shaping and packages
- A confirmation gate on destructive operations: the 52 delete/reboot/halt tools require
confirm=True, and a config revision is captured before each one - A one-line rollback returned with every destructive change, as
restore_config_backup(revision_id=…) - Rate limiting, positive input validation (IP/port/MAC/CIDR), path-traversal and XSS screening, and secrets redacted from logs and echoed API errors
- A
dry_run=Truepreview of any destructive operation, and averify_descrcheck that guards against deleting the wrong rule after an ID shift - A read-only mode via
MCP_READ_ONLY=trueexposing only the read/search/diagnose tools, and aMCP_ALLOWED_TOOLSallowlist
Requirements
Python 3.11+ and a pfSense instance with the REST API v2 package installed. Run without cloning via uvx --from git+https://github.com/gensecaihq/pfsense-mcp-server pfsense-mcp-server, or clone and pip install -r requirements.txt. PFSENSE_URL and an auth method — basic, api_key or jwt — are set in .env or the client's env block, with the matching PFSENSE_USERNAME/PFSENSE_PASSWORD or PFSENSE_API_KEY. Because pfSense uses a self-signed CA that Python does not trust by default, export the CA and point PFSENSE_CA_FILE at it; VERIFY_SSL=false also connects but leaves the firewall unauthenticated. The pyproject names the package pfsense-mcp-server at 1.0.0. The README urges REST API package v2.10.0+, which fixes a command-injection flaw in the interface-group endpoints.
Setup effort
One command plus credentials — uvx --from git+https://github.com/gensecaihq/pfsense-mcp-server pfsense-mcp-server, then supply credentials
USE CASES
Blocking a host without clicking through the web UI
Describe the block in plain English and get the rule created and applied, with a rollback command handed back.
Diagnosing why a host cannot reach the internet
Ask the question and let it run diagnostics across gateways and rules to find the cause.
Previewing a deletion before committing
Pass dry_run=True to see what a destructive operation would do, and verify_descr to confirm you are deleting the intended rule.
Giving an assistant look-but-not-touch access
Set MCP_READ_ONLY=true so only the search, get and diagnose tools are exposed.
333 tools
Listed in project code.
manage_alias_addressescreate_aliasupdate_aliasdelete_aliassearch_certificatescreate_certificateupdate_certificatedelete_certificategenerate_certificaterenew_certificateexport_certificate_pkcs12search_certificate_authoritiescreate_certificate_authorityupdate_certificate_authoritydelete_certificate_authoritysearch_crlscreate_crlupdate_crldelete_crlsearch_dhcp_leasessearch_dhcp_static_mappingscreate_dhcp_static_mappingupdate_dhcp_static_mappingdelete_dhcp_static_mappingget_dhcp_server_configupdate_dhcp_server_configsearch_dhcp_address_poolscreate_dhcp_address_poolupdate_dhcp_address_pooldelete_dhcp_address_poolsearch_dhcp_custom_optionscreate_dhcp_custom_optionupdate_dhcp_custom_optiondelete_dhcp_custom_optionapply_dhcp_changesupdate_dhcp_backendrun_ping_diagnosticreboot_systemhalt_systemget_config_historyget_config_revisiondelete_config_revisionsearch_pf_tablesget_pf_tablerestore_config_backupcompare_config_revisionsget_dns_forwarder_settingssearch_dns_forwarder_host_overridescreate_dns_forwarder_host_overrideupdate_dns_forwarder_host_overridedelete_dns_forwarder_host_overridesearch_dns_forwarder_host_override_aliasesmanage_dns_forwarder_host_override_aliasapply_dns_forwarder_changesget_dns_resolver_settingsupdate_dns_resolver_settingssearch_dns_host_overridescreate_dns_host_overrideupdate_dns_host_overridedelete_dns_host_overridesearch_dns_host_override_aliasessearch_dns_domain_overridescreate_dns_domain_overrideupdate_dns_domain_overridedelete_dns_domain_overridesearch_dns_access_listscreate_dns_access_listapply_dns_resolver_changesupdate_dns_access_listdelete_dns_access_listsearch_firewall_rulesfind_blocked_rulescreate_firewall_rule_advancedmove_firewall_ruleupdate_firewall_ruledelete_firewall_rulebulk_block_ipsapply_firewall_changesget_pf_rulessearch_firewall_schedulescreate_firewall_scheduleupdate_firewall_scheduledelete_firewall_schedulesearch_schedule_time_rangescreate_schedule_time_rangeupdate_schedule_time_rangedelete_schedule_time_rangesearch_firewall_statesdelete_firewall_stateget_firewall_state_sizeget_firewall_advanced_settingssearch_interface_configscreate_interfaceupdate_interfacedelete_interfaceapply_interface_changessearch_vlanscreate_vlanupdate_vlandelete_vlansearch_interface_bridgescreate_interface_bridgesearch_interface_groupscreate_interface_groupget_available_interfacesget_firewall_loganalyze_blocked_trafficsearch_logs_by_ipget_ntp_settingsupdate_ntp_settingssearch_ntp_time_serversmanage_ntp_time_serversearch_cron_jobscreate_cron_jobdelete_cron_jobsearch_service_watchdogsmanage_service_watchdogget_ssh_settingsupdate_ssh_settingssend_wake_on_lansearch_nat_port_forwardscreate_nat_port_forwarddelete_nat_port_forwardupdate_nat_port_forwardsearch_nat_onetoone_mappingscreate_nat_onetoone_mappingupdate_nat_onetoone_mappingdelete_nat_onetoone_mappingapply_nat_onetoone_changessearch_nat_outbound_mappingscreate_nat_outbound_mappingupdate_nat_outbound_mappingdelete_nat_outbound_mappingget_nat_outbound_modeupdate_nat_outbound_modeapply_nat_changessearch_acme_certificatescreate_acme_certificateupdate_acme_certificatedelete_acme_certificatesearch_acme_certificate_domainsmanage_acme_certificate_domainissue_acme_certificaterenew_acme_certificatesearch_acme_account_keyscreate_acme_account_keyregister_acme_account_keyget_acme_settingssearch_bind_zonescreate_bind_zoneupdate_bind_zonedelete_bind_zonesearch_bind_zone_recordsmanage_bind_zone_recordget_bind_settingsupdate_bind_settingssearch_bind_access_listsmanage_bind_access_listsearch_freeradius_userscreate_freeradius_userupdate_freeradius_userdelete_freeradius_usersearch_freeradius_clientscreate_freeradius_clientupdate_freeradius_clientdelete_freeradius_clientsearch_haproxy_backendscreate_haproxy_backendupdate_haproxy_backenddelete_haproxy_backendsearch_haproxy_backend_serversmanage_haproxy_backend_serversearch_haproxy_frontendscreate_haproxy_frontendupdate_haproxy_frontenddelete_haproxy_frontendsearch_haproxy_frontend_addressesmanage_haproxy_frontend_addresssearch_haproxy_frontend_certificatesmanage_haproxy_frontend_certificatesearch_haproxy_filesmanage_haproxy_fileget_haproxy_settingsupdate_haproxy_settingsapply_haproxy_changessearch_gatewayscreate_gatewayupdate_gatewaydelete_gatewayget_default_gatewayupdate_default_gatewaysearch_gateway_groupscreate_gateway_groupupdate_gateway_groupdelete_gateway_groupsearch_static_routescreate_static_routeupdate_static_routedelete_static_routeapply_routing_changesget_gateway_statussearch_servicescontrol_servicesystem_statussearch_interfacesfind_interfaces_by_statusget_arp_tableget_system_timezoneupdate_system_timezoneget_system_consoleupdate_system_consoleget_webgui_settingsupdate_webgui_settingsget_email_notification_settingsupdate_email_notification_settingsget_log_settingsupdate_log_settingsget_dhcp_relay_settingsupdate_dhcp_relay_settingsupdate_firewall_advanced_settingsupdate_firewall_state_sizeget_system_dnsupdate_system_dnsget_system_hostnameupdate_system_hostnamesearch_system_tunablescreate_system_tunableupdate_system_tunabledelete_system_tunableget_system_versionget_carp_statusupdate_carp_maintenancesearch_installed_packagessearch_traffic_shaperscreate_traffic_shaperupdate_traffic_shaperdelete_traffic_shapersearch_shaper_queuescreate_shaper_queueupdate_shaper_queuedelete_shaper_queuesearch_traffic_limiterscreate_traffic_limiterupdate_traffic_limiterdelete_traffic_limiterdiagnose_connectivitydiagnose_blocked_trafficdiagnose_interface_issuesdiagnose_vpn_statusdiagnose_dhcp_issuesdiagnose_dns_resolutiondiagnose_service_healthdiagnose_high_availabilityget_system_health_reportsearch_audit_trailsearch_userscreate_userupdate_userdelete_usersearch_groupscreate_groupupdate_groupdelete_groupsearch_auth_serverscreate_auth_serverupdate_auth_serverdelete_auth_serverfollow_api_linkenable_hateoasdisable_hateoasrefresh_object_idsfind_object_by_fieldget_api_capabilitiestest_enhanced_connectionget_guardrail_statuscheck_tool_risksearch_virtual_ipscreate_virtual_ipupdate_virtual_ipdelete_virtual_ipapply_virtual_ip_changessearch_ipsec_phase2_encryptionscreate_ipsec_phase2_encryptionupdate_ipsec_phase2_encryptiondelete_ipsec_phase2_encryptionsearch_wireguard_tunnel_addressesmanage_wireguard_tunnel_addressget_openvpn_server_statusget_openvpn_client_statussearch_openvpn_server_connectionsdisconnect_openvpn_clientsearch_openvpn_server_routessearch_openvpn_client_export_configssearch_ipsec_phase1screate_ipsec_phase1update_ipsec_phase1delete_ipsec_phase1search_ipsec_phase2screate_ipsec_phase2update_ipsec_phase2delete_ipsec_phase2search_ipsec_phase1_encryptionscreate_ipsec_phase1_encryptiondelete_ipsec_phase1_encryptionapply_ipsec_changesget_ipsec_statusget_ipsec_child_sa_statussearch_openvpn_serverscreate_openvpn_serverupdate_openvpn_serverdelete_openvpn_serversearch_openvpn_clientscreate_openvpn_clientupdate_openvpn_clientdelete_openvpn_clientsearch_openvpn_csosmanage_openvpn_csoget_openvpn_statusexport_openvpn_client_configsearch_wireguard_tunnelscreate_wireguard_tunnelupdate_wireguard_tunneldelete_wireguard_tunnelsearch_wireguard_peerscreate_wireguard_peerupdate_wireguard_peerdelete_wireguard_peersearch_wireguard_peer_allowed_ipsmanage_wireguard_peer_allowed_ipget_wireguard_settingsupdate_wireguard_settingsapply_wireguard_changesBEFORE YOU INSTALL
What to know first
Tools you get
333 tools registered in the project's code.
Requires
- uvx on PATH
- PFSENSE_PASSWORD in your environment
- PFSENSE_USERNAME in your environment
Optional
PFSENSE_API_KEY in your environment
Where it runs
Both documented setups run the server on your machine.
INSTALLATION
Connect your client
Server setup
uvx --from git+https://github.com/gensecaihq/pfsense-mcp-server pfsense-mcp-serverMCP Clients
Claude Desktop — uvx
{
"mcpServers": {
"pfsense": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/gensecaihq/pfsense-mcp-server",
"pfsense-mcp-server"
],
"env": {
"PFSENSE_URL": "https://192.168.1.1",
"AUTH_METHOD": "basic",
"PFSENSE_USERNAME": "admin",
"PFSENSE_PASSWORD": "<YOUR_PFSENSE_PASSWORD>",
"PFSENSE_VERSION": "CE_2_8_1",
"PFSENSE_CA_FILE": "<YOUR_PFSENSE_CA_FILE>"
}
}
}
}Both blocks sign in with AUTH_METHOD basic, your pfSense username and password. To sign in with a REST API key instead, set AUTH_METHOD to api_key and add PFSENSE_API_KEY (created under System > REST API > Keys); the username and password are then not used.
Claude Desktop — local build
Clone it and install the dependencies: git clone https://github.com/gensecaihq/pfsense-mcp-server.git, then cd pfsense-mcp-server and pip install -r requirements.txt
Add this block, with cwd set to the folder you cloned:
{
"mcpServers": {
"pfsense": {
"command": "python3.11",
"args": [
"-m",
"src.main"
],
"cwd": "<YOUR_PATH_TO_PFSENSE_MCP_SERVER>",
"env": {
"PFSENSE_URL": "https://192.168.1.1",
"AUTH_METHOD": "basic",
"PFSENSE_USERNAME": "admin",
"PFSENSE_PASSWORD": "<YOUR_PFSENSE_PASSWORD>",
"PFSENSE_VERSION": "CE_2_8_1",
"PFSENSE_CA_FILE": "<YOUR_PFSENSE_CA_FILE>"
}
}
}
}Both blocks sign in with AUTH_METHOD basic, your pfSense username and password. To sign in with a REST API key instead, set AUTH_METHOD to api_key and add PFSENSE_API_KEY (created under System > REST API > Keys); the username and password are then not used.