fortigate-mcp

fortigate-mcp

An MCP server for managing and monitoring FortiGate firewalls via the FortiOS REST API, enabling natural language queries for status, policies, VPNs, and sessions.

Category
Visit Server

README

fortigate-mcp

An MCP (Model Context Protocol) server for managing and monitoring FortiGate firewalls through the FortiOS REST API.

Connect your AI assistant (Claude Code, Claude Desktop, or any MCP client) to one or more FortiGates and ask things like:

"Which firewall policies have never been hit?" "Is the IPsec tunnel to the branch office up?" "Show me all active sessions from 10.0.0.15."

Initial setup (creating the API user and token on the FortiGate) is automated over SSH — after that, everything runs over the REST API with a token. SSH credentials are never stored.

Features

Phase 1 — read-only (current):

Tool What it does
get_system_status Hostname, model, FortiOS version, HA mode, CPU/memory/session usage
list_interfaces Interfaces with link status, IP, speed, traffic counters
get_routing_table Active IPv4 routing table (connected, static, OSPF, BGP, …)
list_firewall_policies Policy list in evaluation order, optional hit counts
get_firewall_policy Full detail of a single policy
list_address_objects Address objects (subnet, FQDN, range, geography)
list_services Custom service objects
get_vpn_status IPsec tunnel status + active SSL-VPN sessions
search_sessions Session table search with src/dst/port filters

Roadmap:

  • Phase 2 — guarded write operations (create/update policies and objects, block an IP) with a read_only kill-switch and dry-run support
  • Phase 3 — analysis tools (unused policies, shadowed rules, config audit)
  • Optional SSH transport for diagnose/execute commands not exposed by REST

FortiOS version support

Primary target is FortiOS 7.0 – 7.6, with best-effort support for 6.4. Versions below 6.4 are rejected (end-of-life). The device version is detected automatically from API responses; per-version differences live in one place (src/fortigate_mcp/quirks.py).

Quick start

# 1. Install (Python 3.10+)
git clone https://github.com/irfanharis/fortigate-mcp.git
cd fortigate-mcp
python -m venv .venv
.venv/Scripts/activate          # Windows  (Linux/macOS: source .venv/bin/activate)
pip install -e .

# 2. Bootstrap your FortiGate (creates the API user over SSH, one time)
fortigate-mcp-bootstrap --host 192.168.1.99 --ssh-user admin \
    --trusthost 192.168.1.50 --name lab

# 3. Register with your MCP client, e.g. Claude Code
claude mcp add fortigate -- fortigate-mcp

See the Usage Guide for full documentation: manual setup without SSH, multi-device and multi-VDOM configuration, per-tool examples, and troubleshooting.

Security model

  • Read-only by default, at two layers: the access profile created on the FortiGate only grants read, and the MCP config has read_only: true (used to reject write tools in Phase 2). Pass --read-write to bootstrap only when you need write access.
  • Trusthost pinning: with --trusthost, the token only works from the machine running the MCP server.
  • No stored SSH credentials: SSH is used once for bootstrap; only the API token is persisted, in a config file that is git-ignored.

License

MIT — see LICENSE.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured