FortiAnalyzer MCP Server
Provides tools for interacting with FortiAnalyzer, Fortinet's log management and analytics platform, including system health, ADOM and device inventory, alerts, reports, LogView searches, and documented read endpoints via the JSON-RPC API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FortiAnalyzer MCP Server What's the current system status and device inventory?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
FortiAnalyzer MCP Server
A Python Model Context Protocol server for the FortiAnalyzer JSON-RPC API. It provides structured tools for system health, ADOM and device inventory, alerts, reports, LogView searches, and documented long-tail read endpoints.
The bundled offline catalog contains searchable factual metadata derived from the public FortiAnalyzer JSON-RPC API documentation. It includes generated summaries and links back to each source page; the source documentation itself is not redistributed in this repository. See NOTICE for provenance and licensing details.
The searchable catalog preserves the guide's published endpoint paths. Endpoint compatibility can vary by appliance release, so validate the tools you plan to use in a non-production environment first.
This is an independent project and is not affiliated with or endorsed by Fortinet. Fortinet and FortiAnalyzer are trademarks of Fortinet, Inc.
Highlights
API-key and username/password session authentication
Secure TLS verification by default, with custom CA support
Lazy, concurrency-safe login and one read retry after documented session expiry (
-10)Bounded LogView submit/poll/fetch/cleanup workflows
Structured MCP output with request and endpoint metadata
Offline API-document metadata search plus an opt-in generic read tool
Server-managed credentials and session IDs are never exposed in tool schemas or server-generated metadata
Generic state-changing access disabled by default
stdio, Streamable HTTP, and SSE transports
Related MCP server: Zabbix MCP Server
Requirements
Python 3.10 or newer
Network access to a FortiAnalyzer appliance
A least-privileged FortiAnalyzer API user
A FortiAnalyzer release that supports the selected JSON-RPC endpoints
Install
git clone https://github.com/forticrevs/fortianalyzer-mcp.git
cd fortianalyzer-mcp
python3 -m venv .venv
. .venv/bin/activate
python -m pip install .Copy the example environment file and configure one authentication method:
cp .env.example .envAPI-key authentication is preferred for long-running automation:
FAZ_HOST=https://fortianalyzer.example.com
FAZ_API_KEY=replace-with-a-secret-from-your-secret-store
FAZ_VERIFY_SSL=trueSession authentication is also supported:
FAZ_HOST=https://fortianalyzer.example.com
FAZ_USERNAME=mcp-readonly
FAZ_PASSWORD=replace-with-a-secret-from-your-secret-store
FAZ_VERIFY_SSL=trueDo not commit .env; it is ignored by Git.
Run the stdio server:
fortianalyzer-mcpAn MCP client can launch that executable directly. A representative client configuration is:
{
"mcpServers": {
"fortianalyzer": {
"command": "/absolute/path/to/.venv/bin/fortianalyzer-mcp",
"env": {
"FAZ_HOST": "https://fortianalyzer.example.com",
"FAZ_API_KEY": "${FAZ_API_KEY}",
"FAZ_VERIFY_SSL": "true"
}
}
}
}Environment interpolation depends on the MCP client. If it is unsupported, use the client's secret facility or arrange for the server process to inherit the variables.
Tools
Tool | Purpose |
| Search bundled API-guide metadata and public source URLs |
| Show non-secret local connection settings |
| Read version, model, license, disk, and memory status |
| Read CPU, memory, and disk performance |
| Inspect administrative domains |
| List managed devices in an ADOM |
| List unregistered devices |
| Query bounded event-management alerts |
| Read basic and correlation event-handler configuration |
| List SQL report layouts |
| List report templates |
| List report schedules |
| Read global log-forwarding configuration |
| Run a bounded one-page LogView workflow |
| Start a manual/paginated LogView task |
| Poll or page through a LogView task |
| Cancel and release a LogView task |
| Call an appliance-local endpoint with JSON-RPC |
faz_raw_write is registered only when FAZ_ENABLE_WRITE_TOOLS=true. It
requires confirm=true, cannot call authentication or reboot endpoints, and
does not automatically replay a mutation after session expiry or an ambiguous
transport failure. The confirmation argument and MCP annotations are not an
authorization or human-approval boundary. Enabling this tool grants connected
clients broad mutation capability within the FortiAnalyzer account's
permissions; use a separate least-privileged account and an external approval
control. Keep it disabled for read-only deployments.
Log search behavior
Device scope is always explicit. Use a concrete list such as
["branch-fgt-01"]; use ["All_FortiGate"] only intentionally.
Relative searches default to the last hour. Absolute times must be paired, FortiAnalyzer-local timestamps:
2025-01-15 09:00:00By default:
a specific-device search is limited to 24 hours;
an all-device search is limited to 1 hour;
one tool result is limited to 200 rows;
LogView fetch pages never exceed the appliance limit of 500 rows;
at most eight LogView searches can be active or starting concurrently;
the convenience workflow times out after 30 seconds;
task deletion is attempted after completion, timeout, errors, and server shutdown; failed cleanup remains tracked for a later shutdown retry.
For pagination, start a task and retrieve each required offset. A completed full
page does not prove that all rows were consumed, so the server conservatively
keeps that task alive even when cleanup_when_done=true. Set
cleanup_when_done=false while managing pages explicitly, then call
faz_cancel_log_search. The convenience faz_search_logs workflow intentionally
returns one page and always attempts to release its task.
Configuration
Variable | Default | Meaning |
| required | HTTPS origin, optionally ending in |
|
|
|
| Bearer API key ( | |
| Session credentials | |
|
| Verify the appliance certificate |
| PEM bundle for a private CA | |
|
| Explicit development-only HTTP opt-in |
|
| Normal API timeout |
|
| Default ADOM |
|
| Maximum rows accepted by bounded tools |
|
| Convenience search timeout |
|
| Specific-device search window |
|
| All-device search window |
|
| Maximum active/starting LogView tasks |
|
| Register the guarded raw mutation tool |
|
|
|
|
| Network transport bind address |
|
| Network transport port |
| Comma-separated browser-origin allowlist | |
| Additional comma-separated Host header allowlist | |
|
| Streamable HTTP stateless mode |
|
| Use JSON rather than SSE response bodies |
|
| Server logging level |
For self-signed appliance certificates, install the issuing CA and set
FAZ_CA_BUNDLE. FAZ_VERIFY_SSL=false is available for development but should
not be used in production.
Network transports do not add client authentication to the MCP endpoint. Keep the default loopback binding or place the server behind an authenticated, TLS-protected gateway.
Browser clients must be explicitly allowed. For example:
FAZ_MCP_ALLOWED_ORIGINS=http://model.example.test,https://another-ui.exampleOrigins are exact HTTP(S) origins without paths or trailing slashes. A terminal
port wildcard such as http://model.example.test:* is supported. The setting drives
both DNS-rebinding validation and CORS/preflight responses. Localhost origins
remain allowed automatically. If a proxy forwards a non-local Host header,
allow that separately, for example
FAZ_MCP_ALLOWED_HOSTS=model.example.test,model.example.test:*.
These allowlists are request-validation controls, not client authentication.
Development
Install the development extra and run the test suite:
python -m pip install -e '.[dev]'
pytestRebuild the offline catalog from a documentation tree you are authorized to use:
python scripts/build_catalog.py \
--source /path/to/fortianalyzer-api-docs \
--output src/fortianalyzer_mcp/data/api_catalog.jsonThe automated suite uses mocked HTTP transports and does not require an appliance. Validate against your appliance because releases can differ in endpoint-specific request and response fields.
faz_raw_get accepts any syntactically valid appliance-local path except
blocked authentication paths; catalog membership is guidance, not an enforced
allowlist. It prevents request-field overrides and always sends JSON-RPC
get, but returns endpoint data without field-level redaction or a generic
response-size cap. Use a least-privileged account, call only trusted endpoints,
and pass endpoint-specific limit, range, or field-selection parameters.
Available Tools
19 toolsfaz_cancel_log_searchCIdempotent
Cancel and delete a LogView task to release FortiAnalyzer resources.
Inputs: tid (required), adom. Returns: object
faz_connection_infoARead-onlyIdempotent
Show non-secret connection and safety configuration.
This does not make an appliance request and never returns credentials or session identifiers.
Inputs: no named parameters. Returns: object
faz_get_adomARead-onlyIdempotent
Get one ADOM. An empty ADOM uses FAZ_DEFAULT_ADOM.
Inputs: adom. Returns: object
faz_get_log_searchA
Poll or fetch one page from a LogView task.
The task is deleted automatically only after FortiAnalyzer proves that this is the last page. A full page is retained conservatively because more rows may exist; fetch the next offset or call faz_cancel_log_search. Set cleanup_when_done=false whenever pagination is managed explicitly.
Inputs: tid (required), adom, limit, offset, +1 more. Returns: object
faz_get_system_performanceARead-onlyIdempotent
Get current FortiAnalyzer CPU, memory, and disk performance metrics.
Inputs: no named parameters. Returns: object
faz_get_system_statusARead-onlyIdempotent
Get FortiAnalyzer version, model, hostname, license, disk, and memory status.
Inputs: no named parameters. Returns: object
faz_list_adomsARead-onlyIdempotent
List administrative domains, optionally returning only selected fields.
Inputs: fields. Returns: object
faz_list_alertsARead-onlyIdempotent
List event-management alerts with bounded pagination.
Times are FortiAnalyzer-local values in YYYY-MM-DD HH:MM:SS form and
must be supplied as a pair. filter_expression uses alert-filter syntax;
prefer event_type and severity for common filters.
Inputs: adom, limit, offset, end_time, +4 more. Returns: object
faz_list_devicesARead-onlyIdempotent
List managed devices in an ADOM, optionally selecting response fields.
Inputs: adom, fields. Returns: object
faz_list_event_handlersARead-onlyIdempotent
List basic and correlation event handlers in an ADOM.
Inputs: adom. Returns: object
faz_list_log_forwardersARead-onlyIdempotent
List global FortiAnalyzer log-forwarding configurations.
Inputs: no named parameters. Returns: object
faz_list_report_layoutsBRead-onlyIdempotent
List SQL report layouts in an ADOM.
Inputs: adom. Returns: object
faz_list_report_schedulesARead-onlyIdempotent
List configured SQL report schedules in an ADOM.
Inputs: adom. Returns: object
faz_list_report_templatesARead-onlyIdempotent
List available report templates in an ADOM.
Inputs: adom. Returns: object
faz_list_unregistered_devicesBRead-onlyIdempotent
List devices that are visible to FortiAnalyzer but not registered.
Inputs: fields. Returns: object
faz_raw_getARead-onlyIdempotent
Call an appliance-local read endpoint not covered by a high-level tool.
First use faz_search_api_docs to find the candidate path, then consult
its linked source page for parameter placement. Catalog membership is
not enforced. params contains members beside url; credentials,
session, request id, method, and host cannot be overridden. Results are
returned without field-level redaction, and response size is controlled
by the selected endpoint. Use only trusted endpoints and pass documented
limit/range/field selectors when available.
Inputs: path (required), params, jsonrpc_version. Returns: object
faz_search_api_docsARead-onlyIdempotent
Search metadata extracted from the FortiAnalyzer API guide.
Use this before faz_raw_get or when a high-level tool does not cover an endpoint. Results include JSON-RPC methods, API paths, generated summaries, relative source paths, and public documentation URLs. Consult the linked source page for exact request parameters. The catalog is local and does not contact the appliance.
Inputs: query (required), limit, category. Returns: object
faz_search_logsA
Run a bounded LogView submit/poll/fetch/cleanup workflow.
This convenience tool returns one result page and always attempts to delete its server-side task on completion, timeout, or error. Failed cleanup stays tracked for a shutdown retry. For manual pagination, use faz_start_log_search and faz_get_log_search instead.
Inputs: devices (required), adom, limit, offset, +9 more. Returns: object
faz_start_log_searchA
Start an asynchronous LogView search and return its task ID.
Device names are explicit; use ["All_FortiGate"] only intentionally. Supply start_time and end_time together for an absolute appliance-local range, otherwise last_n_hours is used. Call faz_get_log_search next.
Inputs: devices (required), adom, end_time, log_type, +6 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Each tool targets a distinct resource or lifecycle stage: list/get for different entity types, start/get/cancel/search for log search, and status vs performance are clearly separated. Even the raw_get fallback is distinct from high-level tools, and search_api_docs is unique. The only near-overlap (search_logs vs start+get) is clearly differentiated by description.
Names consistently follow faz_<verb>_<noun> pattern for almost all tools (list_*, get_*, start_*, search_*). The lone outlier is faz_connection_info, which is a noun phrase rather than a verb phrase, and faz_raw_get mixes an adjective before the verb. Overall the pattern is highly predictable with minor deviations.
19 tools is on the heavier side but appropriate for a comprehensive FortiAnalyzer management interface covering system, ADOMs, devices, alerts, reports, logs, and a raw API fallback. The count feels slightly above the ideal 3-15 range, but each tool serves a distinct function and nothing feels redundant.
The tool set covers a broad read-only surface: system status/perf, ADOM listing/getting, device listing (registered and unregistered), alerts, event handlers, reports (layouts/templates/schedules), log search with full lifecycle, and a raw read endpoint for uncovered paths. Missing write operations and per-item get-by-ID are notable but align with the apparent read/query purpose; the raw_get gap-filler increases completeness.
Maintenance
Related MCP Connectors
Query Fathom Analytics sites, stats, current visitors and events, and manage sites and events.
Remote MCP for 1,500+ APIs. Vault-managed credentials; OAuth or API key. Search, load, and execute.
Query and manage PacketFabric NaaS: ports, virtual circuits, cloud routers, pricing, metrics.
Lets AI agents analyze API metrics, request logs, and traces, and manage apps and alerts.
Related MCP Servers
- FlicenseBqualityNot gradedmaintenanceEnables management of Palo Alto firewalls through their REST API, including system information retrieval, PAN-OS upgrades, HA firewall management via Panorama, content updates, and certificate management.6-
- AlicenseBqualityBmaintenanceProvides advanced, programmable access to Zabbix monitoring data and management features, enabling querying, automation, and integration of Zabbix resources.53276 PyPI11MIT
- AlicenseBqualityAmaintenanceEnables AI assistants to interact with FortiManager for centralized firewall policy management, device provisioning, and network configuration through the FortiManager JSON-RPC API.25410MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with FortiAnalyzer for log analysis, reporting, security monitoring, and SOC operations via the JSON-RPC API.17MIT