Fortinet MCP Server logo

Fortinet MCP Server

Community
paoloamato2

A complete Model Context Protocol (MCP) server for Fortinet FortiOS 7.6.6

Publisherpaoloamato2
Repositoryfortinet-mcp-server
LanguagePython
Forks
4
Stars
11
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Fortinet MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    11 stars and 4 forks from the linked repository.

FortiOS 7.6.x MCP Server


Table of Contents


Features

  • 204+ typed MCP tools organized by functional area (system, firewall, VPN, router, user, monitor, log, security, wireless)
  • 5 generic pass-through tools that cover all 1,536 FortiOS API endpoints
  • Async HTTP client with Bearer-token authentication via httpx
  • Full support for CMDB, Monitor, Log, and Service API sections
  • Configurable SSL verification (self-signed certificates supported)
  • Compatible with multi-VDOM environments
  • Runs as stdio (Claude Desktop) or HTTP server (remote/cloud use)

Tool Categories

Module# ToolsDescription
Generic5cmdb_list/get/create/update/delete, monitor_get/action, log_get, service_call — cover ALL endpoints
System27Interfaces, DNS, NTP, admins, DHCP, SNMP, certificates, VDOMs, syslog
Firewall32Policies (IPv4/IPv6), addresses, address groups, services, VIPs, IP pools, schedules, sessions
VPN22IPsec Phase 1/2, SSL VPN portals/settings, tunnel up/down, VPN certificates
Router17Static routes, OSPF, BGP, RIP, prefix lists, route maps, SD-WAN health
User18Local users, groups, RADIUS, LDAP, TACACS+, SAML, authenticated sessions
Monitor18ARP, FortiView top talkers, endpoint control, IPS stats, switch controller, config backup
Log18Traffic, event, VPN, user, virus, webfilter, IPS, app-ctrl, DNS logs + log config
Security29IPS, AV, webfilter, app control, DLP, email filter, DNS filter, WAF, ICAP, ssh-filter, ZTNA
Wireless18AP profiles, WTPs, SSIDs (VAPs), Hotspot 2.0, connected clients, rogue APs

Total: 204+ tools


Requirements

RequirementVersion
Python3.11+
Package manageruv (recommended) or pip
FortiGateFortiOS 7.6.x
AuthREST API admin account with Bearer token

Quick Start

1. Create API Token on FortiGate

  1. Log into your FortiGate Web UI
  2. Navigate to System > Administrators
  3. Click Create New > REST API Admin
  4. Assign an admin profile (super_admin for full access, or a restricted profile following least-privilege)
  5. Copy the generated API token — it is shown only once

2. Install dependencies

bash
git clone https://github.com/paoloamato2/fortinet-mcp-server.git
cd fortinet-mcp-server

# Using uv (recommended)
uv sync

# Or using pip
pip install -e .

3. Configure environment

bash
cp .env.example .env

Edit .env:

dotenv
FORTIOS_HOST=https://192.168.1.1
FORTIOS_API_TOKEN=your-token-here
FORTIOS_VDOM=root
FORTIOS_VERIFY_SSL=false
FORTIOS_TIMEOUT=30

4. Run with MCP Inspector

bash
uv run mcp dev server.py

5. Install in Claude Desktop

bash
uv run mcp install server.py --name "FortiOS"

Or manually add to claude_desktop_config.json:

json
{
  "mcpServers": {
    "fortios": {
      "command": "uv",
      "args": [
        "run",
        "--directory", "/absolute/path/to/fortinet-mcp-server",
        "python", "server.py"
      ],
      "env": {
        "FORTIOS_HOST": "https://192.168.1.1",
        "FORTIOS_API_TOKEN": "your-api-token",
        "FORTIOS_VDOM": "root",
        "FORTIOS_VERIFY_SSL": "false"
      }
    }
  }
}

On macOS, claude_desktop_config.json is at ~/Library/Application Support/Claude/claude_desktop_config.json.
On Windows, it is at %APPDATA%\Claude\claude_desktop_config.json.


HTTP Mode

To run as a remote HTTP server instead of stdio:

bash
MCP_TRANSPORT=streamable-http MCP_PORT=8000 uv run server.py

Connect via http://localhost:8000/mcp.

This mode is useful for shared team setups or cloud-hosted deployments.


Usage Examples

Via Claude Desktop

Once installed, you can ask Claude natural-language questions such as:

  • "Show me all firewall policies that deny traffic"
  • "Which IPsec tunnels are currently down?"
  • "List all interfaces with their IP addresses"
  • "Which route would be used to reach 8.8.8.8?"
  • "Show the top 20 traffic sources in FortiView"
  • "Are there any failed admin login attempts in the logs?"

Direct Tool Invocations

python
# List firewall policies filtered by action
firewall_policy_list(filter_action="deny")

# Get system status
system_status()

# Check IPsec VPN tunnels
monitor_vpn_ipsec()

# Query forward traffic logs for a specific source IP
log_traffic_forward(srcip="10.10.1.100", rows=50)

# Generic: list any CMDB resource (full API coverage)
cmdb_list("casb/profile")
cmdb_list("wireless-controller.hotspot20/hs-profile")

# Generic: get any monitor data
monitor_get("registration/forticloud")

Project Structure

fortinet-mcp-server/
├── server.py              # FastMCP entry point, lifespan, tool registration
├── fortios_client.py      # Async HTTP client (CMDB/Monitor/Log/Service)
├── pyproject.toml         # Project metadata and dependencies
├── .env.example           # Environment variable template
├── README.md              # This file
└── tools/
    ├── __init__.py
    ├── generic.py         # Generic pass-through tools (all 1536 endpoints)
    ├── system.py          # System config + monitoring
    ├── firewall.py        # Firewall policies, addresses, VIPs, sessions
    ├── vpn.py             # IPsec + SSL VPN config and monitoring
    ├── router.py          # Static routes, OSPF, BGP, SD-WAN
    ├── user.py            # Local users, groups, RADIUS, LDAP, sessions
    ├── monitor.py         # Network monitoring, FortiView, endpoint control
    ├── log.py             # Log retrieval and configuration
    ├── security.py        # IPS, AV, webfilter, DLP, WAF, ZTNA profiles
    └── wireless.py        # WiFi APs, SSIDs, clients, rogue APs

Security Notes

  • The API token grants the same access level as its associated admin profile. Follow the principle of least privilege — create a restricted profile if you only need read access.
  • Set FORTIOS_VERIFY_SSL=true in production and ensure your FortiGate has a valid TLS certificate.
  • The server runs locally over stdio by default — it is not exposed over the network unless HTTP mode is enabled.
  • Never commit your .env file or expose your API token in logs, issues, or code.
  • Rotate your API token regularly and revoke it immediately if compromised.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md before submitting a pull request.


License

This project is licensed under the MIT License — see LICENSE for details.

Disclaimer: This project is not affiliated with or endorsed by Fortinet, Inc. FortiOS and FortiGate are trademarks of Fortinet, Inc.

Use Fortinet MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Fortinet MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Fortinet MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Fortinet MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "fortinet-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Fortinet MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Fortinet MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Fortinet MCP Server to help me with this task?
Fortinet MCP Server
Sure. I read it.
Here is what I found using Fortinet MCP Server.

Frequently asked questions

What is the Fortinet MCP Server MCP server used for?

Fortinet MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Fortinet MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Fortinet MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Fortinet MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Fortinet MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Fortinet MCP Server MCP to TypingMind?

Fortinet MCP Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Fortinet MCP Server MCP provide in TypingMind?

Fortinet MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Fortinet MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Fortinet MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇