Skip to main content
Glama

FortiCloud MCP server

A read-only MCP server for Fortinet FortiCloud. Claude can ask which FortiGates are offline in FortiGate Cloud, what firmware they run, how their config backups are set, and, from Asset Management, which support and FortiGuard entitlements expire soon.

It uses the same framework as Cititec's other MCP servers: TypeScript, @modelcontextprotocol/sdk, a stdio transport, vitest tests, tsup and a Docker image.

The APIs

One FortiCloud IAM API user reaches two portals, each with its own OAuth token:

Portal

API

Token client_id

FortiGate Cloud (being renamed FortiManagement Cloud)

GET https://api.fortigate.forticloud.com/forticloudapi/v1/... (/devices, /devices/{sn}, /devices/{sn}/configbackups/setting, /subaccounts)

fortigatecloud

Asset Management v3

POST https://support.fortinet.com/ES/api/registration/v3/... with a JSON query (products/list, products/details, contracts/list, folders/list)

assetmanagement

  • Tokens: POST https://customerapiauth.fortinet.com/api/v1/oauth/token/ (the trailing slash matters) with {username: <API ID>, password, client_id, grant_type: "password"}. The token is cached for its expires_in less two minutes. A token that FortiCloud rejects early (HTTP 401) is replaced once.

  • Failed sign-ins: FortiCloud answers bad credentials with HTTP 400 invalid_grant. Repeated failures are reported to lock the API user out of every portal for 15 to 30 minutes, so after a refusal this server does not try to sign in again for 10 minutes.

  • Regions: FortiGate Cloud has Global (which is also Canada), US, Europe and Japan hosts (api., usapi., euapi., jpapi.fortigate.forticloud.com). The API only shows the region you call. The token and Asset Management hosts are global.

  • Read-only: every Asset Management call this server can make is one of its read endpoints (a fixed list in src/client.ts), and FortiGate Cloud is only called with GET. The other Asset Management v3 endpoints (register, decommission, transfer, folders/create...) are not reachable. Give the API user a read-only permission profile anyway.

What is not confirmed yet

Fortinet's full API reference (FNDN) needs a login. The endpoints and fields above come from Fortinet's public docs and KB articles and from open-source clients. These are handled defensively and need a live check:

  • the token lifetime (14,400 s, 3,660 s and 3,600 s are all reported); the server uses whatever expires_in says;

  • FortiGate Cloud /devices paging (limit and offset): the server stops on a short page, on a page with nothing new, or at the total the items carry;

  • a "last seen" time on a device: the public sample has none, so lastSeen is filled from any of several likely field names, and forticloud_get_device shows every other field the API returns (otherFields);

  • a list of config backup revisions: only the automatic backup settings (configbackups/setting) are documented;

  • /subaccounts (account names), Asset Management's page size (25) and totalPages, and the fields folderPath and status on list items;

  • the bodies of 429 answers. The documented quotas: Asset Management 100 calls a minute, 1,000 an hour and 10 errors an hour; FortiGate Cloud reportedly 100 calls a second and 15 errors a minute.

Every endpoint and client_id is a setting, so a change on Fortinet's side needs no new image.

Related MCP server: FortiAnalyzer MCP Server

Configuration

Variable

FORTICLOUD_API_ID

The IAM API user's API ID (from its credentials file).

FORTICLOUD_API_PASSWORD

Its password. Never logged; removed from every error message, as are tokens.

FORTICLOUD_AUTH_URL

Default https://customerapiauth.fortinet.com/api/v1/oauth/token/.

FORTICLOUD_ASSET_URL

Default https://support.fortinet.com/ES/api/registration/v3.

FORTICLOUD_FGT_URL

Default https://api.fortigate.forticloud.com/forticloudapi/v1 (Global and Canada).

FORTICLOUD_ASSET_CLIENT_ID

Default assetmanagement.

FORTICLOUD_FGT_CLIENT_ID

Default fortigatecloud.

FORTICLOUD_TIME_ZONE

IANA time zone that dates are shown in, e.g. Australia/Melbourne (the Cititec host). Default UTC. See "Dates and days left".

FORTICLOUD_UNTRUSTED_MARKERS

off disables the <forticloud-data> wrapper (below).

LOG_LEVEL

debug, info (default), warn, error, to stderr. Tool arguments and secrets are never logged.

All URLs must be https.

Tools

Tool

What it does

forticloud_status

Gets a token for each portal and makes one cheap read in each: FortiGates in FortiGate Cloud (online/offline) and Asset Management folders. Each portal is reported on its own.

forticloud_list_accounts

FortiGate Cloud sub-accounts (an MSSP's clients) with device and offline counts.

forticloud_list_devices

FortiGates with model, serial, firmware, sub-account and connection to FortiGate Cloud (online/offline from tunnelAlive), offline first. Filters: account, connection, model, firmware, name or serial.

forticloud_get_device

One FortiGate: FortiGate Cloud details and any other fields, its config backup settings, and its Asset Management record.

forticloud_firmware_summary

Devices per firmware version (oldest first) and per major version, optionally with the devices on each.

forticloud_config_backup_status

The automatic config backup settings for one device or a page of devices; stops after three errors.

forticloud_search

Devices by name, serial or account; Asset Management products by serial.

forticloud_list_assets

Registered products by serial prefix (FG FortiGates, FS switches, FP APs, F all), 25 a page, with support end and next expiry.

forticloud_get_asset

One product: every entitlement with days left, contracts, licence numbers, warranty, end of order and end of support.

forticloud_list_expiring

Entitlements that end within N days (and, if asked, ended in the last N days), soonest first. Only the latest entitlement of each type per product counts, so a renewed service is not listed.

forticloud_list_contracts

Contracts with SKU, status, terms and end date.

forticloud_list_folders

Asset Management folders (often one per client).

Lists return total, count, offset and nextOffset (Asset Management lists: totalPages and nextPage), and each response is capped at 60,000 characters. The device list is read once a minute at most and shared by the tools in one session. When FortiGate Cloud does not return the whole device list (paging stops before its advertised total), every result built on it (status, accounts, devices, firmware, config backups, search) carries complete: false and a warning, so a partial inventory is never presented as the whole fleet.

Dates and days left

One rule for every tool:

  • daysLeft counts whole 24-hour periods from now to the exact expiry moment, rounded down, and is worked out from FortiCloud's original timestamp. It does not depend on a time zone. 0 means it ends within the next 24 hours (later today included); a negative number means it has ended (-1 within the last 24 hours).

  • Dates shown (end, start, the window of forticloud_list_expiring) are calendar dates. A FortiCloud time with an offset (Asset Management writes times like ...-8:00) or an epoch number is shown as the date it falls on in FORTICLOUD_TIME_ZONE. A date with no zone (end-of-support dates, for example) is shown as written.

  • Something with several end dates (a contract's terms) takes the latest moment, not the latest text. Contracts, their terms, entitlements and licences all use the same calculation, so they always agree.

Untrusted text

A FortiGate's host name and description are set on the device by whoever administers it, and asset descriptions and folder names are free text. Every result except forticloud_status is wrapped in a <forticloud-data> block followed by a reminder that it is data, not instructions. A closing tag inside the data is neutralized, so it cannot end the block early. This is a label, not a guarantee; what bounds the damage is that every tool is read-only.

Rate limits

A 429 (or a 503 with a wait) on a read is retried once when the wait is 10 s or less. Otherwise the tool returns an error that says Try again in N s. with structuredContent: { error_type: "rate_limited", retry_after_seconds: N } (60 s when FortiCloud gives no wait). Every request this server makes is a read: Asset Management's POSTs are queries. Writes would never be retried, but there are none. The Cititec MCP host also applies its own per-service budget.

Development

npm ci
npm run lint    # tsc --noEmit
npm test        # vitest
npm run build   # tsup -> dist/index.js

Docker

docker build -t forticloud-mcp .
docker run --rm -i --env-file forticloud.env forticloud-mcp

stdio only: the Cititec MCP host runs one container per connection with the service's env file. The Cititec release workflow tags a release with semantic-release on every merge to main and pushes ghcr.io/cititec-pty-ltd/forticloud-mcp:vX.Y.Z (and :latest).

Licence

Apache 2.0. See LICENSE and NOTICE.

Available Tools

12 tools
forticloud_config_backup_statusA
Read-onlyIdempotent

FortiGate Cloud's automatic config backup settings for one FortiGate (serial) or a page of FortiGates (optionally one account). Reads one setting per device, so pages are small; stops after three errors.

Inputs: limit, offset, serial, account.

forticloud_firmware_summaryA
Read-onlyIdempotent

FortiGate firmware across FortiGate Cloud: devices per firmware version (oldest first) with models and offline counts, and per major version (7.0, 7.2, 7.4...). Optionally for one account or model, and with the devices on each version.

Inputs: model, account, list_devices.

forticloud_get_assetA
Read-onlyIdempotent

One registered product from Asset Management by serial: model, folder, every entitlement (support, FortiGuard services) with start, end and days left, contracts and their terms, licence numbers, warranty, end of order and end of support dates.

Inputs: serial (required).

forticloud_get_deviceA
Read-onlyIdempotent

One FortiGate by serial: FortiGate Cloud details (connection, firmware, account, any other fields the API returns), its automatic config backup settings, and (include_asset) its Asset Management record with entitlements and expiry.

Inputs: serial (required), include_asset.

forticloud_list_accountsB
Read-onlyIdempotent

FortiGate Cloud sub-accounts (for an MSSP account, usually one per client), with how many FortiGates each has and how many are offline.

Inputs: name, limit, offset.

forticloud_list_assetsA
Read-onlyIdempotent

Registered products in Asset Management whose serial starts with serial_prefix (FG = FortiGates, FS = FortiSwitches, FP = FortiAPs, F = everything), 25 per page: model, description, folder, registration, support end and the next entitlement to expire. Decommissioned products are left out unless asked.

Inputs: page, model, pages, folder, +2 more.

forticloud_list_contractsB
Read-onlyIdempotent

Contracts in Asset Management (support and service contracts) with SKU, status, terms and end date, soonest end first.

Inputs: limit, offset, status, contract_number.

forticloud_list_devicesA
Read-onlyIdempotent

FortiGates in FortiGate Cloud with model, serial, firmware, sub-account (client) and whether the management tunnel to FortiGate Cloud is up (connection: online/offline), offline first. Filter by account, connection, model, firmware or name/serial. Each page has total and nextOffset.

Inputs: name, limit, model, offset, +3 more.

forticloud_list_expiringA
Read-onlyIdempotent

Support, FortiGuard and other entitlements that expire within days (default 60), soonest first, from Asset Management. Only the latest entitlement of each type per product counts, so a renewed service is not listed. include_expired_days also shows ones that ended in the last N days. Filter by serial_prefix (FG for FortiGates), entitlement type or folder.

Inputs: days, type, limit, folder, +4 more.

forticloud_list_foldersC
Read-onlyIdempotent

Asset Management folders (often one per client or site), with their paths and IDs.

Inputs: name, limit, offset.

forticloud_statusA
Read-onlyIdempotent

Checks the FortiCloud connection: gets a token for FortiGate Cloud and Asset Management, counts the FortiGates in FortiGate Cloud (online/offline) and the Asset Management folders. Each portal is reported separately, so one failing does not hide the other. Start here when other tools fail.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 12 tools

    Disambiguation4/5

    Most tools target a clear resource+action (list_devices vs list_assets vs list_contracts vs list_expiring are easy to tell apart). There is real overlap: forticloud_get_device with include_asset duplicates forticloud_get_asset, and it also returns the config backup settings that forticloud_config_backup_status exists for, while forticloud_search overlaps both list_devices and list_assets. The descriptions do a good job stating when to prefer one over the other, so misselection risk is low but nonzero.

    Naming Consistency4/5

    All twelve tools share the forticloud_ prefix and mostly follow verb_noun (list_folders, get_asset, list_expiring, list_contracts). Three deviate to bare noun phrases: forticloud_status, forticloud_firmware_summary and forticloud_config_backup_status, which breaks the pattern slightly. Still highly readable and predictable overall.

    Tool Count5/5

    Twelve tools is squarely in the well-scoped range for a monitoring/inventory server covering two portals plus an aggregation view. Each tool maps to a distinct query an operator would actually run (firmware rollup, expiring entitlements, contracts, backup settings), with no filler.

    Completeness4/5

    The read-only surface is strong: connectivity check, folders, accounts, device and asset detail, search, firmware rollup, config backup, expiring entitlements and contracts. Gaps are minor but real: no per-folder or per-account detail tool, no contract detail by ID, and no write/management operations (account or device actions), which may be intentional for a read-only inspection server. Agents can work around these via the list tools.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides programmatic access to FortiGate devices for managing firewall policies, routing, virtual IPs, and device operations, enabling integration with MCP-compatible clients like Claude Desktop.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Read-only MCP server for the Action1 RMM REST API, enabling access to endpoints, missing updates, vulnerabilities, installed software, policies, automations, and reports.
      21
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables language models to read FortiGate/FortiOS firewalls and answer operational questions about firewall policies, network configuration, and live client state. Provides question-shaped diagnostic tools for reference checks, configuration searches, device lookups, routing, DHCP, ARP, wireless clients, and multi-appliance targeting without allowing configuration changes.
      17
      Apache 2.0