
rust-panosmcp
io.github.mechubsecPublished by GitHub account mechubsecv0.17.0Updated Oct 29, 2026
PAN-OS firewall MCP server: scoped, audited, two-person change control. Rust.
The publisher's own server: rust.wiki
Overview
MCP server for Palo Alto Networks PAN-OS firewalls: read-only inspection plus scoped, audited, two-person-approved configuration changes.
- What you can do
- Inspect devices: list authorized firewalls, gather facts, read config at validated XPaths, page through rulebase and object entries, digest single entries.
- Run read-only operational commands and simulate security policy matches, with allowlist-gated command policy.
- Check health and posture: HA state, licenses, content and software versions, EDL feed status, bounded log queries.
- Review Panorama device groups, templates and push job status.
- Stage, diff, validate, commit or discard candidate configuration changes under fingerprints and config locks.
- Plan, approve, apply and inspect multi-action change sets with independent approval.
- When to use it
- Useful when an assistant should help operate or audit PAN-OS firewalls: checking rulebases, HA and license state, or preparing and reviewing policy changes that need validation, audit trails and a second human approver.
- Requirements
- Runs as a local process, typically via the published container image or a Linux release tarball (Rust 1.89+ to build). Needs a device inventory file with each firewall's endpoint and an API key referenced from an environment variable or a protected file, plus a writable state directory. The audit HMAC key file is required for startup. HTTP transport needs bearer tokens, TLS certificates and allowed host/origin settings.
Installation
In SourceWeft
- Open rust-panosmcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
rust-panosmcp
Async Rust Model Context Protocol server for Palo Alto Networks PAN-OS firewalls
a mechub project — sovereign network-security automation
Unofficial / community project. This is an independent community project and does not claim affiliation with or endorsement by Palo Alto Networks. Product names and trademarks are used only to identify the systems with which the software interoperates.
The repository contains the v0.17.0 release: a bearer-protected server with structured audit logging, guarded PAN-OS candidate configuration lifecycle, and hardened release packaging, with authentication and auditing provided by the shared mecmcp-auth and mecmcp-audit crates.
The project goal is a small, fast, production-oriented server with the same
security posture as rust-junosmcp: bearer-token authentication, per-token
device and tool scopes, TLS, strict remote-bind refusal rules, bounded input
and output, auditable change operations, and efficient connection reuse.
The architecture and delivery plan are in PLAN.md. Security boundaries and release-blocking controls are tracked in THREAT_MODEL.md.
Workspace
Quick start
Installation
Choose one of three install paths:
Release tarball (Linux x86_64)
Download the latest release from GitHub releases. Assets follow the pattern rust-panosmcp-v0.17.0-x86_64-unknown-linux-gnu.tar.gz with a corresponding .sha256 file.
This creates a dedicated rust-panosmcp system user and provisions /etc/rust-panosmcp (config, root-owned) and /var/lib/rust-panosmcp (state). The HMAC key at /etc/rust-panosmcp/audit-hmac.key is required for device-redaction in audit logs — the service will not start without it. The extracted archive includes configuration examples in config/ — use devices.example.json and tokens.example.json as starting templates under /etc/rust-panosmcp before starting. See packaging/systemd/ for unit details.
LXC (Debian 13)
For a dedicated unprivileged LXC container on Proxmox or standalone systemd-nspawn, the release tarball includes an idempotent installer that automates the manual sequence above. For a complete setup guide including container creation, see HOW-TO-SETUP-LXC.md.
The installer creates the rust-panosmcp user and directories via systemd-sysusers and systemd-tmpfiles, installs the binary and unit, creates an empty tokens.json with mode 0600, and never overwrites /var/lib/rust-panosmcp/mutation-state.json if it exists (change-set audit trail). The endpoint listens on http://127.0.0.1:30031/mcp by default. See packaging/lxc/install.sh for environment-variable overrides and upgrade behavior.
Docker / GHCR
Prebuilt images are published to ghcr.io/mechubsec/rustpanosmcp on every release tag. See .github/workflows/release-image.yml for the build pipeline. For a complete setup guide including both two-person and lab modes, see HOW-TO-SETUP-DOCKER.md.
The default CMD binds 127.0.0.1:30031 inside the container, so a bare
docker run with no -p and no --host/--allowed-host/--allowed-origin
starts cleanly but is not reachable from outside the container. Follow
HOW-TO-SETUP-DOCKER.md for a working two-person
or lab-mode docker run invocation (including the port publish and the flags
the baked-in ENTRYPOINT already supplies) or use the included
compose.example.yaml.
Run with Docker (stdio)
For MCP clients that launch a server over stdin/stdout, prepare an inventory
with the same shape as config/devices.example.json:
Export the API-key variable before launching the container. This passthrough
form keeps the key out of the command line, but Docker daemon access can still
expose environment values through inspection. For stricter handling, use the
file-based API-key form ({"type":"file","path":"/protected/path"})
documented in the configuration section below and mount that file read-only
with mode 0600.
Make the mounted inventory and state files readable and writable only by the
container user (uid:gid 65532:65532); secret-bearing files must have mode
0600. Stdio is unauthenticated at the process boundary: the launcher can
use every device in the mounted inventory and every tool, so scope access by
limiting that inventory and using a read-only PAN-OS API role. The state
directory must be writable because the server creates its audit state there.
The image ENTRYPOINT already supplies the config, token, state, and audit-key
paths, so do not repeat those flags after the image name. The token path is
only used by HTTP. This invocation leaves HTTP and listener TLS off: supplying
--transport stdio replaces the image CMD, including its HTTP bind and port
flags. Connections to the firewall still use HTTPS according to the
inventory's TLS trust settings.
Build from source
Requires Rust 1.89 or newer (MSRV).
Run (stdio)
Start from config/devices.example.json, keep the real inventory out of Git, and provide the referenced environment secret:
Run (streamable-http with auth)
First mint a least-privilege token, then start the TLS Streamable HTTP transport:
Capture the first command's stdout securely: that is the only display of the new bearer secret. See docs/PHASE2_OPERATIONS.md for token rotation, reload, refusal rules, reverse-proxy deployment, and all security defaults. Phase 1 inventory and firewall TLS details remain in docs/PHASE1_OPERATIONS.md.
Next: Learn the reader, writer, and reviewer MCP role workflow.
Status
Phase 1 implemented validated inventory and secret providers, strict HTTPS with
system roots/custom CA/exact leaf pinning, pooled async PAN-OS XML API calls,
typed errors, timeouts, cancellation, output caps, and a per-device semaphore.
Phase 2 added digest-only bearer tokens, exact device/tool scopes, atomic
inventory/token reload, TLS Streamable HTTP, Host/Origin validation, bounded
request bodies, IP/token rate limits, and audit-safe request tracing. Both
transports share the same 28 tools described in MCP tools
reference below; wildcard * token scopes reach only
the 17 read-only ones (list_devices, gather_device_facts,
execute_panos_op, get_panos_config, list_panos_entries,
get_panos_entry_digest, list_panorama_device_groups,
list_panorama_templates, get_panorama_push_status,
list_panos_rulebase_entries, get_panos_ha_state, get_panos_license_info,
get_panos_content_status, get_panos_feed_status, get_panos_software_status,
test_panos_security_policy_match, query_panos_logs); the 11
lifecycle/change tools must be named explicitly.
Phase 3 adds opt-in candidate fingerprints, narrow XPath policy, PAN-OS config
locks, per-device serialization, stage/diff/full validation, admin-scoped
partial commit/revert, job reconciliation, and structured mutation audit. Write
tools require explicit token scopes; * remains read-only.
Phase 4 adds a digest-pinned non-root distroless image, hardened systemd unit, read-only deployment guidance, PAN-OS release-family matrix, five parser fuzz targets, byte-reproducible archives, security/runbook documentation, and published Rust/Python measurements.
v0.2 adds persistent multi-action change sets, token-specific XPath/action grants and expiry, canonical-endpoint serialization, and independent approval bound to the exact owner/device/fingerprint/action digest. Approved sets apply under one PAN-OS config lock and automatically admin-revert if a later action fails. They then use the existing diff, full-validation, commit, or discard lifecycle. See docs/V0.2_CHANGE_SETS.md.
v0.2.1 makes PAN-OS configuration-lock release a confirmed state transition:
commit/discard records clear config_lock_held only after the device accepts
unlock, while a failed unlock is persisted as indeterminate for explicit
reconciliation. It also records the default-trusted TLS and lab rollout
evidence in docs/V0.2.1_ACCEPTANCE.md.
v0.2.2 updates the maintained Rust dependency graph and GitHub Actions while preserving the v0.2.1 PAN-OS tool, authorization, inventory, and mutation-state interfaces. The published release and guarded lab rollout evidence is in docs/V0.2.2_ACCEPTANCE.md. Multi-vsys, HA, and Panorama work remains deferred.
v0.3.0 moves authentication onto the shared
mecmcp-auth crate, retiring this
repository's own token, store, and token-file implementations in favour of one
shared, separately tested crate. The PAN-OS tool surface, authorization scopes,
inventory, and mutation-state interfaces are unchanged. Two operator-visible
changes: tokens.json must be mode 0600 or the server refuses to start, and the
on-disk envelope version is now preserved on write so a file this release touches
stays readable by the previous one. See CHANGELOG.md for the
upgrade steps.
The full HTTPS mock, MCP end-to-end, and explicitly configured panosvm lab
firewall acceptance suites pass. Phase 1 is complete; the reproducible evidence
is recorded in docs/PHASE1_ACCEPTANCE.md.
Phase 2 acceptance evidence is recorded in docs/PHASE2_ACCEPTANCE.md. Configuration mutation acceptance is in docs/PHASE3_ACCEPTANCE.md, with operator requirements in docs/PHASE3_OPERATIONS.md. Phase 4 release evidence is in docs/PHASE4_ACCEPTANCE.md. Production deployment, rotation, backup/recovery, and upgrades are covered by docs/OPERATIONS.md; see also docs/COMPATIBILITY.md, docs/BENCHMARKS.md, and SECURITY.md. For the PAN-OS-side least-privilege administrator accounts (distinct from the MCP bearer roles above), see docs/PANOS_ADMIN_ROLES.md.
MCP tools reference
The server exposes 28 MCP tools, grouped by operation type:
Read-only tools
list_devices— List authorized PAN-OS devices and safe metadata; never returns API keys.gather_device_facts— Gather hostname, model, serial, version, management IP, and uptime from an authorized device.execute_panos_op— Execute a read-only PAN-OS XML command rooted at<show>on an authorized device, with output caps.get_panos_config— Read running or candidate PAN-OS configuration at a validated/configXPath on an authorized device.list_panos_entries— Page through a rule or object list container's<entry>children as structured JSON, truncation-marked rather than erroring on a large rulebase.get_panos_entry_digest— Fetch and hash exactly one PAN-OS config entry by XPath, for single-rule drift detection.list_panorama_device_groups— List Panorama device groups and the serial numbers of their member firewalls.list_panorama_templates— List Panorama templates and the names of their declared variables.get_panorama_push_status— Read a Panorama commit-all/push job's overall and per-target-firewall status by job id.list_panos_rulebase_entries— List security rules, NAT rules, address objects, or service objects for a vsys as structured JSON, paginated and truncation-marked.get_panos_ha_state— Read PAN-OS high-availability state (enabled, mode, local and peer state) on an authorized device.get_panos_license_info— Read PAN-OS license status (feature, serial, issued, expires, expired) on an authorized device.get_panos_content_status— Read PAN-OS content version status (version, released, downloaded, current) on an authorized device.get_panos_feed_status— Read the status of mecfeedmcp EDL feeds subscribed on an authorized device (per feed: name, kind, url, valid, auth_valid, next_update, total_valid, total_ignored, total_invalid, content_etag, last_event). See Subscribing to a mecfeedmcp feed.get_panos_software_status— Read PAN-OS software version status (version, released, downloaded, current, latest) on an authorized device.test_panos_security_policy_match— Test which PAN-OS security rule, if any, a simulated packet would match on an authorized device.query_panos_logs— Fetch a bounded window of PAN-OS logs (traffic, threat, system, or config) on an authorized device; always capped, never unbounded.
Candidate lifecycle tools (mutation)
get_candidate_fingerprint— Return a SHA-256 fingerprint over all operator-authorized candidate subtrees.stage_panos_config— Stage one policy-bounded PAN-OS candidate set/delete using an expected fingerprint.diff_panos_candidate— Return a bounded PAN-OS change summary for the exact staged candidate fingerprint.validate_panos_candidate— Validate a staged candidate and make only the same fingerprint eligible for commit.commit_panos_candidate— Commit only a successfully validated operation using an exact candidate fingerprint.discard_panos_candidate— Discard a staged operation through an admin-scoped partial candidate revert.get_panos_operation— Return safe status for an owned PAN-OS candidate lifecycle operation.
Change-set tools (v0.2+)
create_panos_change_set— Plan and persist 1-64 ordered PAN-OS candidate actions under inventory and token XPath/action scopes.approve_panos_change_set— Approve an unexpired exact change-set digest; self-approval is refused.get_panos_change_set— Return the exact actions, digest, approval, expiry, and operation state for review or recovery.apply_panos_change_set— Apply an independently approved exact change set under one endpoint/config lock, reverting partial failure.
Write tools require explicit token scopes; wildcard * grants remain read-only.
Configuration
Three example files in config/ demonstrate the configuration surface:
devices.example.json— Device inventory with authentication, TLS validation modes (system roots, custom CA, or exact leaf pin), per-device concurrency limits, and optional admin override for candidate operations.tokens.example.json— Bearer-token store shape: digest-only storage, per-token device and tool allowlists, optional mutation grants (XPath roots, allowed actions), and expiry timestamps.devices.mutation.example.json— Inventory variant demonstrating mutation-root configuration and admin-scoped candidate workflow fields.
Inventory files never hold inline credentials: each device's api_key is a reference — {"type": "env", "name": "VAR_NAME"} for an environment variable or {"type": "file", "path": "/protected/path"} for a mode-restricted secret file.
Command policy (execute_panos_op, test_panos_security_policy_match)
A top-level policy key in the inventory file governs which operational
commands execute_panos_op will run, and the same gate applies to the
server-built <test><security-policy-match> command issued by
test_panos_security_policy_match:
-
mode: "allowlist"(fail-closed, the default) — a command is refused unless it matches an entry inallow(or, for piped output,allowed_pipes). This is what a freshly generated inventory, or one with nopolicysection at all, resolves to.config/devices.example.jsonships a starter read-only set:Allowlist entries are matched as exact element-tag paths taken from the command's own XML structure, not CLI text — there is no abbreviation expansion, so a shortened form such as
sh sys infois refused just like any other command that isn't inallow. Thetest security-policy-matchentry is required fortest_panos_security_policy_matchto run at all in allowlist mode — without it, every call is refused regardless of any other configuration. -
mode: "blocklist"(fail-open, legacy) — every command is allowed except one matching a deny rule under a device'sblocklist.commands. An inventory that has deny rules but no explicitpolicy.modekey loads in this mode for backward compatibility, and the server logs one startup WARN because fail-open blocklist mode has no allowlist to fall back on if a rule is missing a case. New deployments should setmode: "allowlist"instead.
Each device may extend the shared policy.allow / policy.allowed_pipes
lists with device-specific entries via that device's own blocklist.allow /
blocklist.allowed_pipes arrays, merged the same way blocklist.commands
deny rules are merged today.
Every refusal — either mode — is written to the audit log with the reason code from the underlying policy library.
Audit logging
v0.4.0 introduces structured audit logging via the shared mecmcp-audit crate. One event is emitted per tool call with caller attribution, target devices, outcome, and execution duration.
Change-set lifecycle auditing provides independent evidence of approval: the approve_panos_change_set event carries both the change-set id and the fingerprint digest, proving that a second principal reviewed the exact digest later applied via apply_panos_change_set.
Audit configuration flags
--audit-format {text|json}— Choosetext(default, human-readable) orjson(machine-parseable).--audit-log-file <PATH>— Write audit events to a file path.--audit-journald— Emit audit events to the systemd journal.--audit-redact— HMAC-pseudonymise declared fields (device names, caller identity) so the log can be shipped to a SIEM without leaking operational identifiers.--audit-hmac-key-file <PATH>— Path to the HMAC key for redaction; required when--audit-redactis enabled.
All audit targets are optional and can be combined. When no audit target is specified, audit events are not emitted.
Forwarding to the event store
The audit trail does not stay on this host. This server follows the family standard — AUDIT-FORWARDING-STANDARD.md.
An audit record that only exists on the machine that produced it is not an audit trail: it is a log file on a box whose operator is the party the record is about.
Emission (in effect now)
JSON is mandatory. The text format is for reading in a terminal and is not a
parse target. The file is the operator-facing artifact and must be rotated — the
server never truncates it.
Transport (specified, not yet implemented)
Records are written directly into SSDF's ssdf.audit as hash-chained rows,
per SSDF's merged evidence contract, so that deleting or editing a row is
detectable. Tracked in mecmcp#292.
A cheaper syslog path was designed and rejected: it works, but the records are
unchained, and every other link here is tamper-evident by construction — plan
digests bind approvals, approvals name a distinct principal, and
token_verified_fields separates vouched-for provenance from asserted. An
unchained final hop would discard that guarantee exactly where an auditor needs
it. The reasoning is recorded in the standard.
Reading the result
token_verified_fields names the provenance fields the token vouched for.
The rest of that group — client_name, model_id, session_id — is
client-asserted and authenticated by nothing. Do not read them as equivalent.
request_id correlates the transport event, the handler event, and (on Junos)
the device commit comment.
Security
See THREAT_MODEL.md and SECURITY.md for complete coverage. Key points:
- Authentication required for HTTP — bearer tokens with SHA-256 digest-only storage; no plaintext secrets persist.
- Loopback-only defaults — off-loopback HTTP requires TLS or explicit
--allow-insecure-bind; off-loopback TLS requires--allowed-host. - TLS verification always on — system roots, custom CA bundle, or exact leaf pin; no trust-on-first-use or disabled verification.
- Bounded I/O — output caps (512 KiB default, 5 MiB max), request body limits (1 MiB default), timeouts on all PAN-OS calls.
- Audited mutations — candidate operations serialize per device, record principal and fingerprint, require explicit commit after validation, and persist lock/job state for recovery.
CLI reference
--lab-mode
--lab-mode waives the second principal, for a single-operator lab where two-person control is theatre rather than a control. It is off by default and should stay off anywhere the estate matters.
What it does and does not change:
- The waiver is applied automatically when the change set is created. There is no waive tool, and the flow stays create → apply, identical to production.
- Planning, the plan digest, drift detection, and apply-time revalidation all still run. Lab mode removes the second reviewer, not the change record.
- No approver is ever fabricated. A waived change set records
approver: nullalongsideapproval_waiver: "lab-mode", and carries a waiver digest over(change_set_id, plan_digest, owner, approved_at). It is cryptographically distinguishable from a genuine two-person approval and cannot be relabelled afterwards — which matters if anyone later has to prove which changes had real separation of duties. - The server warns loudly at startup whenever it is enabled.
If you want solo write-testing without waiving the control, mint two tokens with different names and use one to create and the other to approve: the principal is the token name, and self-approval is refused. That gives one person the complete lifecycle with the control intact, and is the better choice wherever the ceremony has any value.
Enabling it
Add the flag to the service unit. On a package install, use a drop-in rather than editing the shipped unit, so an upgrade does not silently drop it:
Replacing ExecStart means restating it in full, so copy the shipped command and append the flag rather than writing a shorter one. Dropping other arguments would silently change the state file location or transport settings as a side effect of enabling lab mode:
Check it against packaging/systemd/rust-panosmcp.service before applying it — the shipped arguments are the authority, and this snippet is a copy that can age.
Confirm it took effect. The startup warning uses lab mode in the prose and approval_waiver=lab-mode in the outcome description:
Expected output:
Approver tokens must be human
approve_panos_change_set only accepts a second principal whose token is marked actor_type: human. Tokens issued without --actor-type are unknown, and they are refused as approvers, as are agent tokens. Issue approver tokens with rust-panosmcp token add ... --actor-type human. stdio sessions carry no caller identity and cannot approve; approvals go over authenticated HTTP.
--allow-direct-commit
commit_panos_candidate on an operation created by stage_config directly — not via create_panos_change_set / approve_panos_change_set / apply_panos_change_set — stages, validates, and commits in one lifecycle, with no independent second-principal review at all: there is no change set to point one at. Off by default: without this flag, that commit is refused before the firewall is ever touched, identically over stdio and HTTP (stdio carries no caller context at all, so it cannot be treated any more leniently than an authenticated session).
Residual risk. --allow-direct-commit is an escape hatch, not a fix. An operator who sets it has decided that running this specific path with no independent review is an acceptable risk for this deployment. That decision is:
- Logged loudly at startup, same as
--lab-modeabove. - Audited on every call. A
commit_panos_candidatecall that ran under the flag carriesdirect_commit_allowed=truein its audit record; a refusal is audited too, asauthorization=deniedwithreason=direct_commit_disabled.
It does not add a second-principal review; it only makes running without one visible. Prefer the change-set flow (create_panos_change_set → approve_panos_change_set → apply_panos_change_set) wherever your workflow can use it, and reserve this flag for operations that genuinely cannot fit that shape.
Enable it the same way as --lab-mode: append --allow-direct-commit to the service unit's ExecStart via a systemd drop-in, copying the shipped command in full. Confirm it took effect — unlike the lab-mode banner, this one is deliberately not grouped with the audit stream's per-call schema, so grep the plain startup message:
Validate
Create a deterministic release archive with scripts/build-release.sh, or
compile it twice and require byte identity with
scripts/verify-reproducible-build.sh. Container/systemd installation is
documented in the operator runbook.
License
Licensed under MIT.
[Image]
a mechub project · deterministic decides · the model explains · a human approves
github.com/fastrevmd-lab
Source: README.md at commit fad17d8
Tools
0Version history
3- v0.17.0LatestOct 29, 2026
- v0.16.2Oct 16, 2026
- v0.16.1Oct 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Other Rust integrations
rust.wiki
wiki.rustOfficial publisher
Remote rust.wiki endpoint giving an assistant live Rust game data: item and skin prices, loot tables, monuments, servers and market stats.

Plane (Rust)
Published by GitHub account ninerf
Unofficial single-binary MCP server that lets an assistant read and write Plane project management data: work items, comments, cycles, modules, pages and more.

AGZ Rust MCP
Published by GitHub account agzyazilim
A local stdio MCP server that gives an assistant Rust development tools: offline workspace inspection, compiler diagnostics, focused tests, Cargo runs and…

rust-proxmoxmcp
Published by GitHub account mechubsec
Proxmox VE MCP server for many clusters, with guest protection and plan/approve/apply change control for destructive operations.

rust-junosmcp
Published by GitHub account mechubsec
Juniper Junos/SRX MCP server: scoped, audited, two-person change control. Rust.