npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fortigate-monitor-plugin

v0.1.2

Published

FortiGate & FortiAnalyzer read-only monitoring MCP plugin — Claude Code, Codex & OpenCode compatible

Readme

fortinet-monitor-plugin

Plugin MCP de solo lectura para monitorear equipos Fortinet. Soporta dos productos: FortiGate (FortiOS REST API) y FortiAnalyzer (API JSON-RPC). Compatible con Claude Code, Codex y OpenCode.

Qué hace

  • FortiGate (19 tools fortigate_*, GET-only): salud y versión, CPU/memoria, licencias, HA, interfaces, ruteo, ARP, DHCP, SD-WAN, sesiones, políticas y hit counts, túneles VPN IPsec/SSL y logs. La capa HTTP solo hace GET y restringe los paths a /api/v2/monitor, /api/v2/cmdb y /api/v2/log.
  • FortiAnalyzer (12 tools faz_*, read-only): salud/versión, estado del sistema, HA, dispositivos administrados (FortiGates que reportan), ADOMs, uso de disco, usuarios admin, historial de tareas, búsqueda de logs (faz_log_search) y salud SD-WAN centralizada de todas las sucursales (faz_sdwan_health). El transporte JSON-RPC solo permite method:"get" (la búsqueda de logs y el SD-WAN health usan una consulta efímera que no modifica configuración).

El producto se elige en el instalador y se persiste en la variable FORTI_PRODUCT (fortigate por defecto, o faz).

Requisitos en el equipo

Antes de instalar: este plugin necesita su propio API token, generado con un perfil de administración read-only. Nunca reutilices el token de un admin con permisos de escritura.

  • FortiGate:
    1. Crear un perfil de administración con acceso read-only (o usar el perfil super_admin_readonly si ya existe), vía GUI en System > Admin Profiles o por CLI:
      config system accprofile
          edit "api-readonly"
              set ftviewgrp read
              set sysgrp read
              set netgrp read
              set loggrp read
          next
      end
    2. Crear el api-user con ese perfil y restringir trusthost a la IP del equipo donde corre el plugin:
      config system api-user
          edit "mcp-monitor"
              set accprofile "api-readonly"
              set vdom "root"
              set trusthost1 <IP_DEL_PLUGIN> 255.255.255.255
          next
      end
    3. Generar el token: execute api-user generate-key mcp-monitor. Guardalo: no se puede volver a consultar, solo regenerar.
  • FortiAnalyzer: crear un admin con un perfil que tenga JSON API Access = Read (nunca Read-Write) y permisos de lectura sobre Device Manager / Log View / System Settings (si faltan, las tools devuelven -11 No permission). Generar el API token del usuario desde System Settings > Administrators.

Instalación

npm install
npm run build   # compila y genera los instaladores de dist-installer/
npm run setup   # asistente: producto, host, puerto, token, TLS → Claude/Codex/OpenCode

El asistente permite elegir varios clientes a la vez (Claude Code, Codex, OpenCode) y registrar varias conexiones en una corrida: primero pregunta si el equipo es FortiGate o FortiAnalyzer, y registra cada conexión como un MCP server independiente fortigate-<alias> o fortianalyzer-<alias> (la acción "Agregar equipo" suma sin tocar los existentes). Pre-carga valores desde .env o de una instalación previa, prueba cada conexión y reporta el equipo detectado.

Instalación multiplataforma (sin clonar el repo)

npm run build genera en dist-installer/ instaladores self-extracting:

  • Mac / Linux: bash fortinet-monitor-plugin-<version>-setup.sh
  • Windows: powershell -File fortinet-monitor-plugin-<version>-setup.ps1

Validan Node ≥ 20, extraen el plugin en ~/.fortinet-monitor-plugin, instalan dependencias y lanzan el configurador.

Uso

  • fortigate_health / faz_health — siempre primero: valida token y detecta la versión.
  • fortigate_version_info / faz_version_info — guía y enlaces de doc oficial para la familia detectada (7.0/7.2/7.4/7.6).
  • fortigate_api_get / faz_api_get — acceso genérico read-only para recursos sin tool dedicada.
  • faz_log_search — busca logs en el FortiAnalyzer (por ADOM, device, tipo, rango y filtro); es asíncrona y espera a que la búsqueda complete.
  • faz_sdwan_health — salud de los enlaces SD-WAN de todas las sucursales vista desde el FAZ: último estado por enlace (latencia, jitter, packet loss, MOS, ancho de banda) y ranking de enlaces con más caídas SLA en la ventana. Requiere que el FortiGate de cada sucursal tenga configurado el log de eventos SD-WAN hacia este FAZ (Health Check SLA status).

Catálogo de endpoints FortiOS en docs/fortios-api-reference.md y patrones de uso para agentes en skills/fortigate-monitor/SKILL.md.

Seguridad

  • El token solo vive en la configuración del host MCP (~/.claude.json, ~/.codex/config.toml, opencode.jsonc) o en .env local (no commiteado).
  • Las respuestas redactan secretos (tokens, psksecret, passwords y campos FAZ adm_pass/psk/private_key).
  • TLS verificado por defecto. El FortiGate no envía el certificado intermedio en el handshake, por lo que el plugin incluye certs/sectigo-intermediate.pem (CA pública de Sectigo) que el instalador pre-carga vía NODE_EXTRA_CA_CERTS — la verificación queda completa sin desactivar nada. La solución definitiva es instalar la cadena completa (cert + intermedio) en el FortiGate.