Repository navigation
v1.44 - 2026-11-28
A server that listens on all interfaces serves the clients that reach it by its address again (#112, @omyhub, with a fix for the IP allowlist by @Ankur1911 in #113), the admin portal shows who was refused and why, and the fixes found by a review of the code and of every tool on 5.0 to 8.0. Every fix has a regression test that fails without it.
Upgrading
host = "0.0.0.0"withoutpublic_urland withoutallowed_origins(the Docker default, a plain LAN install): clients that address the server by its IP or name are served again; since v1.34 they were answered421 Invalid Host headerand onlylocalhostworked. Nothing to change. The Host / Origin check is off in this setup, as the documentation and the startup log always said; setpublic_urlto switch it on.allowed_hosts(the IP allowlist) no longer switches the Host / Origin check on. A setup with only the IP allowlist refused every request before, so nothing that worked changes. One narrow case does:public_urlset, the server's own address also inallowed_hosts, and a client on the server itself addressing it by that bare address on the default port. That request was let through by accident and is now answered 421 like every address other thanpublic_url; use thepublic_urladdress orlocalhost.allowed_originswithoutpublic_urlon a server other machines reach: onlylocalhostgot through before (421 for everybody else), so nothing that worked changes. TheOriginis now checked against the list and theHostis not, since the addresses clients use are not known withoutpublic_url. Setpublic_url(andadditional_hosts) to have theHostchecked too.- SLA
effective_dategiven as a date or date-time is now stored as 00:00 UTC of the day written, which is what Zabbix shows and counts from. East of UTC it was stored as the day before. An SLA created through this server with a text date may therefore start one day early: check it withsla_get(effective_date_localnow shows the stored UTC day) and correct it withsla_update. - A switch written in quotes in
config.toml(enabled = "false") was read as on. It is read as written now; a server that relied on"false"meaning on changes behaviour, which only a config with that typo does. install.sh updateon a checked-out tag or commit installs that version and no longer moves the tree to the newest code. This is the way back after a bad update:git checkout v1.43 && sudo ./deploy/install.sh update. A clone onmainupdates as before.public_urlset: the same clients are served as before, and a few more: the address with or without the scheme's default port, in the spelling as written,localhoston any port, and the origins ofcors_origins. Nothing that was accepted is refused.[oauth] enabled = truewithout an https address (no httpspublic_url, no TLS, not on a local address) did not start before either; it now says why and exits instead of a traceback.- A name in
allowed_hosts("mcp.example.com") stopped the start with a traceback; it is now a configuration error that says the list takes client addresses. A list with addresses and networks is unaffected. install.sh updateexits 1 when the server does not answer after the restart (it printed "Update complete" and exited 0), and no longer stops half-way on a${VAR}inconfig.tomlthat is set only in the service's environment. The logrotate rule is rewritten to coverserver.logonly.host = "127.0.0.1"behind a reverse proxy and stdio behave as before.
Added
-
Admin portal, Dashboard: "Client access". The requests the server refused before they reached a tool, since it started: the address the client used (
Hostheader, HTTP 421), the web origin (Originheader, HTTP 403) and the client address outside the IP allowlist (HTTP 403), each with the value sent, the number of requests and when it was last seen, and one sentence on which setting does it and what to change. A client sees only the status code, and the operator saw nothing outside the log. The card also states what is enforced right now: the listen address, the accepted addresses and origins, the IP allowlist. The record lives in memory, is capped (25 values per kind, 120 characters each) and is fed from request headers, so it is shown escaped. -
[server].additional_hosts: further addresses clients use to reach the server, next topublic_url(["10.1.2.3:8080", "zabbix-mcp"]): the address by IP for clients inside the network, a container's service name. Withpublic_urlset, a request addressed to anything else was refused (421) and no setting could add a second address. A name without a port is accepted on any port. Also in the portal (Settings, "Additional addresses"), and the "Client access" card names it when it sees such a refusal. -
The portal refuses what the server would not start with. Settings are run through the server's own loader before they are saved, plus what the loader does not check (TLS files that are missing or are not a certificate and its key, a portal port equal to the MCP port, a listen address that is not one, numbers typed as
8e3): "Not saved: the server would not start with these settings" and the reason. "Restart" checksconfig.tomlthe same way first and stays up when it does not load, since the portal lives in the process that would exit. A file that was already broken can still be edited from the portal. -
python -m zabbix_mcp.healthcheck [port]: the health probe the image and the compose file now use. It tries http and then https, so a container withtls_cert_fileset is no longer unhealthy for good.
Security
- Admin portal: a request body is limited by route (64 KB for the login form, 1 MB for other forms, 8 MB for uploads and report templates; HTTP 413 above). Nothing limited it: one unauthenticated POST of a few hundred megabytes to
/loginwas read into memory by the process that also serves MCP (measured: 83 MB to 474 MB resident for one request). - A failed login with an oversized user name is refused before it is logged (64 characters). The name went to the audit log and the server log in full, a megabyte per attempt, which pushed real audit entries out of the three rotated files.
auth_tokenthat resolves to an empty string ("${MCP_AUTH_TOKEN}"with the variable defined but empty, which the compose file always does) meant "no token" without a word. It is said on stderr and in the log at start. Behaviour is unchanged: a deployment that runs this way keeps starting.- Deleting the last token says that the next restart leaves the MCP endpoint without authentication.
Fixed
- A server on
0.0.0.0answered421 Invalid Host headerto every client that did not uselocalhost(#112, since v1.34, the move to the MCP SDK 2.0). The listen address was not handed to the SDK, which then took every server for a local one and, with nopublic_urland noallowed_origins, accepted onlylocalhostas theHost. The startup log said "DNS rebinding protection is OFF" all the while. The listen address is handed on now, and the log says what is enforced: on a local address "ENABLED ... only localhost", on0.0.0.0"OFF". - The SSE transport ignored
public_urlandallowed_origins: its app was built without any settings, so it acceptedlocalhostonly, whatever was configured. It gets the same settings as the HTTP transport. - An IP allowlist (
[server].allowed_hosts) made every request fail with "Invalid Host header" (#113, @Ankur1911). The list holds client addresses and networks, but it was also handed to the SDK as the list of validHostheader values, which are the address a client used to reach the server (10.1.2.3:8080). A network never matches aHostvalue, and a bare address lacks the port. The list is no longer used for theHostcheck and no longer switches DNS-rebinding protection on by itself;public_urlandallowed_originsdo, as documented, and the IP allowlist keeps being enforced as before. public_urlwas compared too literally.https://mcp.example.com:443accepted onlyHost: mcp.example.com:443, which no client sends; an IPv6 literal lost its brackets and matched nothing;MCP.Example.commatched only in lower case; andlocalhostwas accepted on the listen port only, so a published Docker port (-p 9000:8080) was refused. Both forms of a default port, the brackets, the spelling as written andlocalhoston any port are accepted now.cors_originscould not serve an MCP client in a browser. OnlyAuthorizationandContent-Typewere allowed, so the preflight of every request that carriesMcp-Session-IdorMcp-Protocol-Versionwas refused, and the session id ofinitializewas not exposed to the page. Withpublic_urlset, an origin fromcors_originspassed CORS and was then refused by the Origin check (403). The MCP headers are allowed and exposed, and acors_originsentry counts as an allowed origin ("*"does not).host = "::1"or"::"with authentication did not start: the server's URL was built ashttp://::1:8080. IPv6 literals are bracketed in the URL and in the log. ("::"listens on IPv6 only.)- An IP allowlist without
127.0.0.1made the container unhealthy:/healthfrom the machine itself was refused. A direct request to/healthfrom a loopback address is answered; every other path, and a/healthforwarded by a proxy, goes by the list as before. - The admin portal behind
--host/--transport(the compose file passes--host 0.0.0.0) showed the address and transport ofconfig.toml: the client wizard offered127.0.0.1and no address picker. It goes by what the server runs with. Its status dot showed "offline" for a server with TLS (the probe was plain http). - Admin portal, token edit: "Never expires" did nothing. The date field is disabled when the box is ticked and was not posted, so the stored date stayed while the form said "Token updated". The date is removed.
- A token expiry was checked against the local clock and read as UTC at use: "tomorrow" typed in the evening west of UTC made a token that was refused on its first call. Both are UTC now (a date is 00:00 UTC of that day).
- Admin portal settings:
0or2026typed into a text setting (host,log_file) was written as a number; the lower bound of "Response max chars" was 1024 while the server needs 5000; the login lockout message said 30 seconds for a 5 minute window. - Startup log: the SSE endpoint was printed as
/mcp;host = "localhost"and"::1"were reported as an unauthenticated, unencrypted network server; with OAuth or[tokens.*]in use the summary still listedauth_tokenas a disabled feature; stdio printed "Listening on 127.0.0.1:8080". install.sh generate-token <name>was refused as "Unknown argument" in every release that documented it. The name is taken.install.sh test-configprinted nothing for an invalid config, only exit code 1. It says what is wrong.install.shmigrated a legacyauth_tokenwrongly when the line had a trailing comment or the token contained=: the hash written to[tokens.legacy]was of another string. The value is read with a TOML parser.- The installer's logrotate rule emptied
audit.logevery night (*.logwithcopytruncate), and the portal's audit page reads only that file. The rule coversserver.log; the audit log rotates itself by size. - An Origin allowlist without a Public URL refused every client on another machine (421, since v1.26): the Host check ran against
localhostalone. See Upgrading. sla_create/sla_update:effective_dateas a date was stored one day early east of UTC (Europe/Prague:2026-11-28became the 27th in the Zabbix frontend), andeffective_date_localin the answer hid it. Confirmed on 6.0, 7.2 and 8.0.user.logoutcould be sent on the server's own connection (zabbix_raw_api_call, oruser_logoutwith an emptyauth_sessionid): on alegacy_authserver (5.0 / 5.2) that ended the one session every tool and token shares, and every call failed until a restart. It is refused before anything is sent, with what to use instead.usergroup_updatewithuserdirectoryid: "0"was answered with success while the group stayed on its LDAP directory (confirmed on 6.2, 6.4, 7.2): the "0" was dropped as a default. It is sent.- Custom report templates never reached the PDF:
report_generateknew the built-in types only, and a built-in file shadowed a custom template of the same name. - Availability reports left out problems that began before the period and counted overlapping ones twice; the backup report took any text containing "1" for success.
trigger_getwithselectDependencies,event_getwithselectRelatedObject: the expression of the nested trigger stayed in the stored form ({35867}<{$UP.MIN}); it is expanded like the trigger's own.- Zabbix 5.2 / 5.4: 43 properties those releases have were dated "since 6.0" in the read contracts and refused or dropped from compact output (
user_getbyusernameon 5.4, login and role missing). - Zabbix 5.0 to 5.4:
module_get/module_create/module_update/module_deletewere refused as "requires Zabbix 6.0"; the API has them from 5.0 (probed without a login on all ten releases). - Zabbix 5.0 / 5.2:
user_getcould not find a user by login (alias): the filter was refused as "silently ignored", which is true from 5.4 on and not before. request_timeout = 0madeuser_logout,user_checkauthenticationanduserdirectory_testwith a session fail before anything was sent; it means the 300 s default there too, as for every other call.stdio_allow_raw_json = truenever worked (since v1.26): the check imported a function that does not exist and always refused.install.sh request-tlscould leave the service unable to start: with TLS on, anhttp://public_urlis refused by the loader, and the command restarted without checking. Apublic_urlon the same host name is switched tohttps://, the config is validated before the restart, and put back as it was when it does not load.configuration_importwithsource_fileon Windows raisedAttributeError:O_NOFOLLOWandO_NONBLOCKdo not exist there. The flags are used where the platform has them, and a symbolic link is refused by an explicit check where it does not (from the fork of Gaven George, @ggeorge-git).legacy_auth(Zabbix 5.0 / 5.2): an expired Zabbix session is no longer the end of the server. A session that Zabbix ended (the user's autologout, a logout, a password change) is answered "Session terminated, re-login, please." as an API error, which the server did not take as a reason to log in again: every call to that server failed until the MCP server was restarted. It now logs in once more and sends the call again (Zabbix refused it, so this holds for writes as well). Only that exact answer counts: any other API error, also one whose text mentions a re-login (a script's output), is passed on as before; token servers are not affected.user_logoutanduserdirectory_testwithauth_sessionidon Zabbix before 6.4. The caller's session went only in theAuthorizationheader, which Zabbix reads from 6.4 on; 5.x to 6.2 answered "Not authorized" and the session stayed open. Before 6.4 the session now goes in the request body; from 6.4, and when the release is unknown, the header as before.user_loginon Zabbix 5.0 / 5.2: the account is sent asuser, the name those releases know (they refusedusername: 'unexpected parameter "username"').severity_minoutside 0 to 5 (problem_get,event_get) was dropped without a word and the call returned every severity; it is now refused with the range, and nothing is sent to Zabbix.zabbix_raw_api_call:report.*keepactive_since/active_tillas the"YYYY-MM-DD"strings Zabbix wants (they were turned into Unix time, asreport_create/report_updatealready avoided), andparamstakes a JSON array for the methods that take one (host.delete: ["10084"],history.clear,user.unblock); an array of reports keeps the dates of each.usermacro_getwithglobalmacro: theoutputschema offers the properties of a global macro (globalmacroid, ...) as well. The server checksoutputagainst the global macro object in that case and its own description namesglobalmacroid, but a client that holds the model to the schema could not send it.configuration_importdescribed old uuids wrongly. A copy of a template imported with the old uuids does not answer "already exists": it changes the original (updateExisting) or answerstrueand creates nothing (createMissingalone), which a model took for a copy that was made. The description now says so and asks to confirm a copy withtemplate_get.
Documentation
- Zabbix 5.4 with an API token needs
skip_version_check = true:zabbix-utilsrefuses every release below 6.0 and the check is relaxed automatically only forlegacy_authentries. The README said the normal configuration applies. allowed_hostsis the client IP allowlist and has nothing to do with theHostheader:SECURITY.md,config.example.toml, the Origin allowlist tooltip anddocs/OAUTH.mdsaid or implied otherwise.config.example.tomlsays next tohostthat a local listen address accepts only requests addressed to localhost, and thatpublic_urlis what a reverse proxy setup needs.config.example.toml: a commented[report_templates.my_custom_report]header sat in the middle of[server], so the server options below it (allowed_hosts,tls_*, ...) landed in the wrong table for anybody who uncommented the header. Docker:ADMIN_PORTonly changes the published port, the portal listens on[admin].port(.env.example, INSTALL.md, compose).- A reverse proxy in front of a server on
127.0.0.1needspublic_url: README and INSTALL.md ("Option A") did not say so, and a proxy that passes the public name on inHostwas answered 421.config.example.toml: the rate limit is per token (all clients without a token share one counter), not per session. [server].strip_write_params = falsesends the measured keys as they are; the hand-written write rules (an action's operation IDs and escalation fields, a script's or a maintenance period's fields by type, a host's select echoes, a filter'sformula/formulaid) apply either way. README,config.example.tomland the admin portal said "every payload as-is".
Tests
tests/test_bind_host_e2e.pystarts real servers (all interfaces, withpublic_url, with only an IP allowlist, on a local address, SSE) and addresses them the way a client on another machine does. The suite and the lab only ever used127.0.0.1, which is how the 421 stayed unseen for ten releases.- The version gate tests follow the
zabbix-utilsmaximum that is installed: 2.0.5 (within the supported>=2.0.2,<3.0) supports 8.0, and the tests that took 8.0.0 as newer than the library failed on a fresh install.