Valkyrian Labs logo

forti-mcp

forti-mcp is an MCP server for FortiGate firewalls. It lets an AI client (Claude Code, Codex or any other MCP client) discover, read and change FortiOS configuration through the FortiOS REST API only. It never runs SSH or CLI commands on the device.

ReleaseCILicense
1claude mcp add --scope user forti -- forti-mcp     # or: forti install mcp

What you get

Runtime

Native and on demand

One executable that the AI client starts over stdio when it needs it and that exits when the client closes it. No daemon, no network listener, no background service.

Tools

Four tools

forti_discover (profiles, device identity and mode, resource search, attributes), forti_read (configuration and monitor data), forti_plan (validates a change and stores it as a plan) and forti_apply (executes a stored plan, by id only).

Modes

The operator decides what may change

Each device profile has a mode, read-only (the default), guarded or autonomous, set in forti configure. Nothing an MCP client sends can change a mode or approve a plan.

Paging

Bounded results

Every tool result fits a byte budget (48 KiB of JSON by default) and is always complete JSON; when a listing is cut, the result says where to continue.

Security

Secrets stay out of the conversation

Device secrets in read results come back as "<redacted>", and API tokens never appear in the client's configuration.

Protocol

Both protocol eras

MCP 2026-07-28 (stateless) and the initialize-based 2025-11-25 and 2025-06-18 revisions.

How it relates to forti-cli

forti-mcp compiles in the command engine of forti-cli, the forti command-line tool, which is built on the forti-api SDK. The engine owns the semantics (resource catalog, validation, plans, modes, approvals, audit); forti-mcp maps MCP tool calls to engine requests and back. It never runs the forti executable, so the two packages install independently.

Install forti as well

You still want forti next to forti-mcp. Device profiles and credentials are created with forti configure, guarded-mode approvals are given with forti plan approve, and forti install mcp registers this server with Claude Code and Codex. Both programs read the same configuration (~/.config/forti) and state, so a plan made in one can be inspected, approved or applied in the other.

Where to go next

Getting started

Installation

Install forti-mcp from the APT repository or Homebrew, or build it from source.

Getting started

Connecting AI clients

Configure a device profile and register forti-mcp with Claude Code, Codex or another MCP client.

Guide

The workflow: discover, read, plan, apply

How a model uses the four tools, learns a profile's mode and handles guarded approvals.

Guide

Safety and modes

What each mode allows, what guarded mode does not stop, and the limits of recovery.

Reference

Tools reference

The four tools, their input schemas, results and annotations.

Reference

Protocol

Supported MCP versions, methods, error codes and the stdio transport rules.