FortiOS 7.6.x MCP Server

FortiOS 7.6.x MCP Server

A complete MCP server for Fortinet FortiOS 7.6.x that exposes the entire REST API as typed MCP tools for use with MCP-compatible clients like Claude Desktop.

Category
访问服务器

README

FortiOS 7.6.x MCP Server

<p align="center"> <img src="https://img.shields.io/badge/FortiOS-7.6.x-EE3124?style=for-the-badge&logo=fortinet&logoColor=white" alt="FortiOS version"> <img src="https://img.shields.io/badge/MCP-Model_Context_Protocol-5A67D8?style=for-the-badge" alt="MCP"> <img src="https://img.shields.io/badge/Python-3.11%2B-3776AB?style=for-the-badge&logo=python&logoColor=white" alt="Python"> <img src="https://img.shields.io/github/license/paoloamato2/fortinet-mcp-server?style=for-the-badge" alt="License"> <img src="https://img.shields.io/github/stars/paoloamato2/fortinet-mcp-server?style=for-the-badge" alt="Stars"> </p>

<p align="center"> <strong>A complete <a href="https://modelcontextprotocol.io">Model Context Protocol (MCP)</a> server for Fortinet FortiOS 7.6.x — exposing the entire REST API (1536 endpoints) as typed MCP tools usable from Claude Desktop, Cursor, or any MCP-compatible client.</strong> </p>


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 # Tools Description
Generic 5 cmdb_list/get/create/update/delete, monitor_get/action, log_get, service_call — cover ALL endpoints
System 27 Interfaces, DNS, NTP, admins, DHCP, SNMP, certificates, VDOMs, syslog
Firewall 32 Policies (IPv4/IPv6), addresses, address groups, services, VIPs, IP pools, schedules, sessions
VPN 22 IPsec Phase 1/2, SSL VPN portals/settings, tunnel up/down, VPN certificates
Router 17 Static routes, OSPF, BGP, RIP, prefix lists, route maps, SD-WAN health
User 18 Local users, groups, RADIUS, LDAP, TACACS+, SAML, authenticated sessions
Monitor 18 ARP, FortiView top talkers, endpoint control, IPS stats, switch controller, config backup
Log 18 Traffic, event, VPN, user, virus, webfilter, IPS, app-ctrl, DNS logs + log config
Security 29 IPS, AV, webfilter, app control, DLP, email filter, DNS filter, WAF, ICAP, ssh-filter, ZTNA
Wireless 18 AP profiles, WTPs, SSIDs (VAPs), Hotspot 2.0, connected clients, rogue APs

Total: 204+ tools


Requirements

Requirement Version
Python 3.11+
Package manager uv (recommended) or pip
FortiGate FortiOS 7.6.x
Auth REST 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

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

cp .env.example .env

Edit .env:

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

uv run mcp dev server.py

5. Install in Claude Desktop

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

Or manually add to claude_desktop_config.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:

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

# 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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选