fwrule-mcp
Supports analysis of firewall rules from Cisco ASA, FTD, IOS/IOS-XE, and IOS-XR platforms, enabling detection of rule overlaps, conflicts, shadowing, and duplicates.
Supports analysis of firewall rules from Fortinet FortiOS/FortiGate, enabling detection of rule overlaps, conflicts, shadowing, and duplicates.
Supports analysis of firewall rules from Nokia SR OS, enabling detection of rule overlaps, conflicts, shadowing, and duplicates.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@fwrule-mcp Check firewall rule conflict for new TCP 443 rule in PAN-OS config."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
FWRule MCP — Firewall Rule Analyzer
An MCP server that analyzes firewall rule overlap, duplication, shadowing, and conflicts across multi-vendor firewall policies.
Supported Vendors
Vendor | Format | Versions |
Palo Alto PAN-OS / Panorama | XML config export | 9.x - 11.x |
Cisco ASA |
| 9.x+ |
Cisco FTD | JSON export from FMC | 6.x - 7.x |
Cisco IOS / IOS-XE |
| 12.x - 17.x |
Cisco IOS-XR |
| 6.x+ |
Check Point | JSON | R80.x - R82.x |
Juniper SRX |
| 19.x+ |
Juniper Junos (MX/PTX/QFX) |
| 18.x+ |
Nokia SR OS | MD-CLI info/flat format | 20.x+ |
Fortinet FortiOS / FortiGate |
| 6.x - 7.x |
Related MCP server: Support Engineer MCP Server
Quick Start
# Install
uv sync
# Run tests
uv run pytest
# Start the MCP server
uv run fwrule-mcpMCP Tools
analyze_firewall_rule_overlap
Analyze whether a candidate firewall rule overlaps with an existing ruleset. Supports two input modes.
Mode 1 — Vendor-native configs (built-in parsers):
vendor— Vendor identifier (panos,asa,ftd,ios,iosxr,checkpoint,juniper,junos,sros,fortios)ruleset_payload— Complete firewall config in vendor-native formatcandidate_rule_payload— Single candidate rule in vendor-native formatos_version— Optional OS version stringcontext_objects— Optional JSON with supplemental object definitions
Mode 2 — Pre-normalized JSON (caller extracts structured rules):
existing_rules— JSON string: array of normalized rule objectscandidate_rule— JSON string: single normalized rule object
Shared:
candidate_position— Optional 1-based intended insertion position
Normalized rule schema:
{
"id": "rule-1",
"position": 1,
"enabled": true,
"action": "permit",
"source_zones": ["trust"],
"destination_zones": ["untrust"],
"source_addresses": ["10.0.0.0/24", "192.168.1.0/24"],
"destination_addresses": ["any"],
"services": [{"protocol": "tcp", "ports": "443"}],
"applications": ["any"]
}Detects:
Exact duplicates
Shadowed rules (candidate would never fire)
Action conflicts (overlapping traffic, opposing actions)
Partial overlaps
Superset/subset relationships
parse_policy
Parse a vendor-native firewall config and return normalized JSON rules. Use this to inspect what the built-in parser extracts before running overlap analysis.
vendor— Vendor identifierruleset_payload— Complete firewall configos_version— Optional OS version stringcontext_objects— Optional JSON with supplemental object definitions
Returns the same normalized schema accepted by analyze_firewall_rule_overlap.
batch_analyze_overlap
Analyze multiple candidate rules against the same existing ruleset in a single call. More efficient than calling analyze_firewall_rule_overlap multiple times — existing rules are parsed once and reused for each candidate.
existing_rules— Array of normalized rule objects (fromparse_policyoutput)candidate_rules— Array of candidate rule objects to analyze
Returns {"success": true, "results": [{"candidate_id": "...", ...analysis result...}, ...]}.
list_supported_vendors
List all supported firewall vendors with format requirements.
Testing
# Full test suite
uv run pytest
# Mock payload tests (vendor parsers)
uv run pytest tests/test_mock_payloads.py -v
# Normalized input tests
uv run pytest tests/test_normalized_input.py -v
# Testing agent with formatted report
uv run python tests/test_agent.py
# Single vendor / scenario
uv run python tests/test_agent.py --vendor panos --scenario conflict --verboseArchitecture
MCP Client Request
│
├── Mode 1: vendor + raw config
│ │
│ v
│ Vendor Parser (plugin registry)
│ [PAN-OS │ ASA │ FTD │ IOS │ IOS-XR │ CP │ SRX │ Junos │ SR OS │ FortiOS]
│ │
│ v
│ Normalization Layer (object resolution, address expansion)
│ │
│ └──────────────┐
│ v
├── Mode 2: normalized JSON ──> Schema Validation
│ │
│ v
└──────────────────> Analysis Engine (6-dimension set intersection)
│
v
Result Generator
│
v
Compact JSON ResponseLicense
Apache 2.0
Addendum: Why Two Input Modes?
This MCP server is designed for automated compliance checking over large firewall rulesets where false positives and false negatives have real security consequences. The architecture balances two competing concerns:
The case for built-in parsers (Mode 1)
Firewall configs contain named object graphs — a rule may reference PROD-SERVERS, which is an address group containing WEB-TIER and DB-TIER, each referencing CIDRs. Resolving these correctly requires recursive expansion with cycle detection and conservative fallback (unresolvable references treated as any to avoid false negatives). The built-in parsers do this deterministically. An LLM doing this via reasoning will occasionally miss nested group members or hallucinate resolutions — margins that matter for security policy decisions.
The case for normalized input (Mode 2)
The vendor parsers are the fragility source. Each parser is ~400 lines of format-specific code that can break when vendor OS versions change output formats. We've already seen bugs in the PAN-OS parser (wrong XML element selection in wrapped configs). When a parser gets a format wrong, the analysis engine produces incorrect results — and the caller has no way to know.
The hybrid solution
Mode 2 (normalized JSON) addresses the fragility problem while preserving correctness:
When the caller already has structured data (e.g., from a REST API, or when the AI agent can reliably extract fields), it bypasses the fragile parsers entirely and sends resolved addresses directly to the analysis engine.
When the caller has raw CLI/config output, Mode 1's parsers handle the complex extraction and object resolution.
parse_policybridges the gap — the caller can inspect what the parser extracted, verify rule counts and address resolution, and decide whether to trust the parser output or re-extract manually.
The analysis engine — the part that does CIDR arithmetic, port range intersection, and multi-dimensional set comparison — is the irreplaceable value. It's vendor-agnostic, deterministic, and well-tested. The parsers are a convenience layer; the normalized schema is the true API surface.
Available Tools
4 toolsanalyze_firewall_rule_overlapA
Analyze whether a candidate firewall rule overlaps with an existing ruleset. Detects exact duplicates, shadowed rules, action conflicts, and partial overlaps. Two input modes: (1) vendor-native configs via vendor + ruleset_payload + candidate_rule_payload, or (2) pre-normalized JSON via existing_rules + candidate_rule. Use parse_policy first to inspect parser output before analysis.
Inputs: vendor, os_version, candidate_rule, existing_rules, +4 more. Returns: object
batch_analyze_overlapA
Analyze multiple candidate rules against the same existing ruleset in a single call. More efficient than calling analyze_firewall_rule_overlap multiple times — existing_rules is parsed once and reused for each candidate. Use parse_policy first to get normalized rules, then pass all candidates at once.
Inputs: existing_rules, candidate_rules. Returns: object
list_supported_vendorsA
List all supported firewall vendors and their configuration format requirements. Use this to understand what vendor identifiers and payload formats are accepted by analyze_firewall_rule_overlap and parse_policy.
Inputs: no named parameters. Returns: result
parse_policyA
Parse a vendor-native firewall config and return normalized JSON rules. Use this to inspect what the built-in parser extracts — verify rule counts, object resolution, and address expansion before running overlap analysis. The output uses the same normalized schema accepted by analyze_firewall_rule_overlap.
Inputs: vendor (required), os_version, context_objects, ruleset_payload. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: parsing, listing vendors, single rule analysis, and batch analysis. No overlap or ambiguity.
All tool names follow a consistent verb_noun snake_case pattern (e.g., analyze_firewall_rule_overlap, batch_analyze_overlap, list_supported_vendors, parse_policy), making them predictable.
With 4 tools, the set is well-scoped for firewall rule overlap analysis, covering all necessary operations without being overly large or sparse.
The tool surface is complete for the domain: parsing configs, listing vendors, and performing both single and batch overlap analysis. No obvious gaps.
Maintenance
Related MCP Connectors
The MCP server that vets MCP servers: identity, risk grade and per-tool risk before you install.
MCP server: static security scanner for MCP servers, agent skills & plugins. 17 attack patterns.
MCP server for querying and analyzing data from ad platforms, analytics tools, and spreadsheets
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables natural language management of FortiGate firewalls via the FortiOS REST API, offering 393 tools for system, policy, routing, VPN, and security configuration.MIT
- -licenseNot gradedqualityBmaintenanceA vendor-agnostic MCP server for technical support engineers, providing knowledge search, ticket analysis, and resolution suggestions.-
- AlicenseNot gradedqualityDmaintenanceMCP server for managing OPNsense firewalls, providing read-only tools for firewall rules, aliases, interface statistics, and gateway status with multi-instance support.MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for comprehensive OPNsense firewall management, enabling AI assistants to manage firewall rules, NAT, VLANs, and network diagnostics, plus execute SSH/CLI commands. Supports safety modes like read-only and dry-run for safe operation.102 npmMIT