fortigate-readonly-mcp
v0.2.0Local read-only MCP server for Fortigate administration over SSH
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
fortigate_list_allowed_commands
List predefined read-only Fortigate commands supported by this MCP server. Returns: str: JSON-formatted mapping from logical command names to exact Fortigate CLI commands.
fortigate_run_readonly_command
Run a manually supplied Fortigate CLI command if it passes the read-only allowlist. Args: command (str): Fortigate CLI command. Must match the read-only allowlist. response_format (ResponseFormat): markdown or json output. Returns: str: Command output, exit status, stderr if present, and truncation metadata.
| Parameter | Type | Description |
|---|---|---|
command * | string | Read-only Fortigate CLI command. Allowed examples: 'get system status', 'show firewall policy'. |
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_system_status
Run 'get system status' on the Fortigate and return version/license/uptime details.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_interfaces
Run 'get system interface' on the Fortigate and return interface state/configuration.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_routes
Run 'get router info routing-table all' on the Fortigate and return the routing table.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_lookup_route_for_ip
Find the best matching route for an IPv4 destination using the current Fortigate routing table. Use this for troubleshooting reachability, asymmetric routing, VPN routing, and policy analysis. The tool only runs `get router info routing-table all`; longest-prefix matching is done locally.
| Parameter | Type | Description |
|---|---|---|
ip * | string | IPv4 address to search in firewall address objects and policies. |
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_policy_routes
Return policy-based routing rules that can override normal routing-table lookup. Use this before concluding how a flow should route, because PBR may override longest-prefix routing.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_firewall_policies
Run 'show firewall policy' on the Fortigate and return firewall policy configuration.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_local_in_policy
Return local-in firewall policy config for traffic destined to the Fortigate itself. Use this when auditing management, VPN, routing protocols, ping, or other services that terminate on the firewall.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_ipsec_vpns
Return IPsec tunnel status and phase1/phase2 VPN configuration.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_ssl_vpn_users
Run 'get vpn ssl monitor' and return currently connected SSL-VPN users.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_run_audit_readonly
Run a closed set of read-only audit commands and return security findings. The audit checks firmware age, admin exposure, broad firewall policies, SSL-VPN posture, IPsec tunnel status, logging availability, and basic health signals. Sensitive configuration fields are redacted before analysis/output.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_public_exposure
List VIP/public NAT exposure and firewall policies that reference VIP objects.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_nat_overview
Return DNAT/VIP, VIP groups, IP pools, central SNAT, and firewall NAT policy references. Use this when troubleshooting translated traffic or auditing public/internal NAT exposure.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_proxy_policy_overview
Return explicit-proxy and access-proxy policy configuration that can affect proxied traffic.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_find_policy_by_ip
Find firewall policies that reference address objects containing an IPv4 address.
| Parameter | Type | Description |
|---|---|---|
ip * | string | IPv4 address to search in firewall address objects and policies. |
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_find_policy_for_flow
Find candidate firewall policies for a source/destination/protocol flow. Use this for read-only policy troubleshooting when debug flow is not appropriate. The result is a static approximation based on address objects, service objects, policy order, and route lookup.
| Parameter | Type | Description |
|---|---|---|
dst_ip * | string | IPv4 address to search in firewall address objects and policies. |
protocol * | integer | IP protocol number, for example 6 for TCP, 17 for UDP, or 1 for ICMP. |
src_ip * | string | IPv4 address to search in firewall address objects and policies. |
dst_port | Optional TCP/UDP port filter, 1-65535. | |
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_explain_flow
Explain a Fortigate flow by combining routes, PBR, policies, NAT, sessions, traffic logs, and SD-WAN context. Use this as the first tool for end-to-end traffic troubleshooting from an agent. It is read-only and bounded: logs are limited, session filters are specific, and no debug flow is enabled.
| Parameter | Type | Description |
|---|---|---|
dst_ip * | string | IPv4 address to search in firewall address objects and policies. |
protocol * | integer | IP protocol number, for example 6 for TCP, 17 for UDP, or 1 for ICMP. |
src_ip * | string | IPv4 address to search in firewall address objects and policies. |
dst_port | Optional TCP/UDP port filter, 1-65535. | |
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_policy_risk_summary
Summarize firewall policy risks such as broad objects, service ALL, disabled logging, and disabled rules.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_security_profiles_overview
Show security profiles referenced by firewall policies plus UTM profile definitions. Use this when traffic is allowed by policy but may be blocked or inspected by AV, IPS, webfilter, app control, or SSL inspection.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_traffic_controls
Return DoS policies, traffic shapers, and per-IP shapers that can drop or rate-limit traffic.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_admin_access_surface
Audit Fortigate administrative exposure from interfaces, admin accounts, and local-in policy. Use this to find SSH/HTTPS/HTTP/Telnet management access, admins without trusted hosts, and local-in rules.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_external_attack_surface
Summarize externally reachable Fortigate services and published internal services. Use this for perimeter audits. It aggregates WAN-like interface management, VIP/DNAT, ZTNA/access-proxy, SSL-VPN settings, IPsec peers, and local-in policy without changing the firewall.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_interface_health
Return link/speed/duplex/drop health for physical Fortigate interfaces.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_vpn_overview
Return SSL-VPN users and IPsec tunnel status in one concise view.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_vpn_error_summary
Summarize IPsec/SSL-VPN tunnel state and recent VPN-related error logs.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_sdwan_status
Return SD-WAN runtime status and configuration if SD-WAN is available on the Fortigate.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_dynamic_routing_status
Return BGP/OSPF runtime status and routing database views where available.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_export_readonly_snapshot
Save a redacted local JSON snapshot of key read-only Fortigate state.
| Parameter | Type | Description |
|---|---|---|
label | Optional snapshot label. Only letters, numbers, dot, dash, and underscore are kept. | |
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_compare_snapshots
Compare two local read-only snapshot JSON files exported by this MCP. Use this for audits that need to identify configuration or state changes between two collection times. The comparison is local-only and reports changed command sections plus added/removed line samples.
| Parameter | Type | Description |
|---|---|---|
snapshot_a * | string | Snapshot filename previously created under the local snapshots directory. |
snapshot_b * | string | Snapshot filename previously created under the local snapshots directory. |
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_get_ssl_vpn_lan_connections
Show current LAN destinations reached by connected SSL-VPN users.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |
fortigate_trace_session
Inspect current Fortigate session-table entries for a bounded connection filter. Use this to follow live connections, confirm policy IDs, NAT/session state, and routing hooks. At least one IP address is required; optional port and protocol filters narrow the session lookup. The tool clears only the temporary CLI session filter before and after listing sessions.
| Parameter | Type | Description |
|---|---|---|
dst_ip | Optional IPv4 address filter. | |
dst_port | Optional TCP/UDP port filter, 1-65535. | |
protocol | Optional IP protocol number, for example 6 for TCP or 17 for UDP. | |
response_format | Output format: markdown for human-readable output, json for structured output. | |
src_ip | Optional IPv4 address filter. | |
src_port | Optional TCP/UDP port filter, 1-65535. |
fortigate_search_logs
Search recent Fortigate logs with bounded `execute log` filters. Use this for read-only troubleshooting of authentication, VPN, traffic, UTM, and system events. The command scope is intentionally narrow: one optional field/value filter and at most 500 displayed lines.
| Parameter | Type | Description |
|---|---|---|
category | Fortigate log category to search. Use 'event' for admin, VPN, system, and authentication events. | |
field | Optional Fortigate log field to filter, for example srcip, dstip, user, action, subtype, status, or level. | |
response_format | Output format: markdown for human-readable output, json for structured output. | |
value | Value for the selected log field. Spaces and shell metacharacters are not allowed. | |
view_lines | integer | Maximum log lines to display. Kept bounded to reduce Fortigate log-search impact. |
fortigate_search_traffic_logs
Search bounded traffic logs by fields such as srcip, dstip, policyid, service, action, or dstport. Use this to confirm whether traffic matched a policy, was accepted/denied, and how NAT was applied.
| Parameter | Type | Description |
|---|---|---|
field | Optional Fortigate log field to filter, for example srcip, dstip, user, action, subtype, status, or level. | |
response_format | Output format: markdown for human-readable output, json for structured output. | |
value | Value for the selected log field. Spaces and shell metacharacters are not allowed. | |
view_lines | integer | Maximum log lines to display. Kept bounded to reduce Fortigate log-search impact. |
fortigate_sniff_packets
Run a tightly bounded packet sniffer with a mandatory BPF-style filter and packet count. This is read-only but higher impact than `show`/`get` commands. Keep filters narrow, counts low, and use it only for active troubleshooting.
| Parameter | Type | Description |
|---|---|---|
packet_filter * | string | Required BPF-style packet filter, for example 'host 10.0.0.10 and port 443'. Keep it narrow. |
count | integer | Maximum packets to capture, limited to 1-20. |
interface | string | Fortigate interface to sniff. Use 'any' unless you need a specific interface. |
response_format | Output format: markdown for human-readable output, json for structured output. | |
verbosity | integer | Fortigate sniffer verbosity, limited to 1-4. |
fortigate_get_recent_errors
Review recent event logs and summarize warning/error/failure patterns. Use this as a first troubleshooting step when the user asks what is failing now. It reads bounded event logs only and highlights errors by subtype, source, destination, and status.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. | |
view_lines | integer | Maximum log lines to display. Kept bounded to reduce Fortigate log-search impact. |
fortigate_get_auth_attack_summary
Review recent event logs for admin/SSL-VPN username-password failures.
| Parameter | Type | Description |
|---|---|---|
response_format | Output format: markdown for human-readable output, json for structured output. |