Skip to main content

cloudarmor-mcp

English | 日本語

MCP server for Google Cloud Armor WAF log patrol — deny summaries per rule, home-region false-positive checks, and preview (dry-run) rule review, straight from Cloud Logging.

Built for a daily "is the WAF healthy?" patrol: one daily_brief call answers what did we block, did we block anyone we shouldn't have, and are the preview rules ready to promote.

Documentation: https://shigechika.github.io/cloudarmor-mcp/

Tools

Tool Purpose
daily_brief One-call morning summary: enforced DENYs by rule priority, home-region false-positive lens, preview DENYs
enforce_denies Enforced DENY counts per rule priority
home_region_denies Enforced DENYs whose source IP geolocates to your home region — anything not marked known-normal is a false-positive candidate
preview_denies Preview (dry-run) DENY counts — a quiet preview rule is a promotion candidate
health_check Version, config presence, and a minimal Cloud Logging probe

All tools are read-only. Counts are hard-capped (default 2000 entries per query) and a capped result is reported as >= N (capped), never as an exact total.

Setup

1. Least-privilege service account

Create a service account with roles/logging.viewer only and download a key. Unlike human accounts, service accounts are not subject to organization re-authentication policies, so an unattended patrol never silently expires.

gcloud iam service-accounts create waf-log-viewer --project=YOUR_PROJECT
gcloud projects add-iam-policy-binding YOUR_PROJECT \
  --member=serviceAccount:waf-log-viewer@YOUR_PROJECT.iam.gserviceaccount.com \
  --role=roles/logging.viewer
gcloud iam service-accounts keys create key.json \
  --iam-account=waf-log-viewer@YOUR_PROJECT.iam.gserviceaccount.com

2. Install

pip install cloudarmor-mcp
# or
uv tool install cloudarmor-mcp

3. Environment variables

Variable Required Meaning
CLOUDARMOR_PROJECT yes GCP project ID that receives the load-balancer logs
GOOGLE_APPLICATION_CREDENTIALS yes Path to the service-account key file
CLOUDARMOR_BACKEND_SERVICES no Comma-separated backend service names to filter (default: all)
CLOUDARMOR_HOME_REGION no ISO region code treated as home traffic, e.g. JP. Enables the false-positive lens
CLOUDARMOR_RULES_INI no Path to a rules INI (labels + known-normal priorities, see below)
CLOUDARMOR_MAX_ENTRIES no Max entries fetched per query (default 2000)

4. Optional rules INI

Keep your rule numbering out of prompts and give the reports human-readable labels:

[rules]
101 = block non-home deep-path crawlers
500 = AutoDiscover probe block
1002 = OWASP LFI protection

[home]
; home-region DENYs on these priorities are expected, not false positives
known_normal_priorities = 500, 600

5. Claude Code (plugin)

This repository doubles as a single-plugin marketplace, so Claude Code can install the server for you:

/plugin marketplace add shigechika/cloudarmor-mcp
/plugin install cloudarmor-mcp@cloudarmor-mcp

The plugin launches uvx cloudarmor-mcp and reads the same environment variables described in Environment variables above; export them before starting Claude Code. GOOGLE_APPLICATION_CREDENTIALS still has to point at a service-account key file that exists on your own machine — the plugin can't ship or fetch that file for you, so this server can't be fully configured through the plugin's own settings alone.

uvx must be on the PATH of the process that runs Claude Code — a login shell usually has it, but a GUI-launched app may not; install uv system-wide if the plugin fails to start.

6. Claude Code (manual)

claude mcp add cloudarmor -- cloudarmor-mcp

with the environment variables above in the server's env.

CLI

cloudarmor-mcp --version   # print version
cloudarmor-mcp --check     # config + API probe (exit 0 when healthy)
cloudarmor-mcp --brief     # print daily_brief to stdout (cron / smoke tests)

Reading the report

  • Enforced DENY by rule — your normal blocking volume. Sudden shifts in the mix are worth a look.
  • Home-region DENY — requests from your own country/region that were blocked. Legitimate users and legitimate crawlers being denied show up here; scanner traffic that happens to originate locally will too, so the known_normal_priorities list keeps expected rules (e.g. an AutoDiscover block) out of the suspicious list.
  • Preview DENY — rules in dry-run. A preview rule that stays free of home-region hits over time is a candidate for promotion to enforce.

License

MIT

Release files for cloudarmor-mcp 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cloudarmor-mcp 0.4.0
File Size Uploaded
cloudarmor_mcp-0.4.0.tar.gz 15.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cloudarmor-mcp 0.4.0
File Interpreter ABI Platform
cloudarmor_mcp-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.8 kB

Release files / cloudarmor_mcp-0.4.0.tar.gz

Download URL cloudarmor_mcp-0.4.0.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
162778957b52e6080a120401ab7ea3d2734bcdfca93da9fc7aab09c9455a533d
BLAKE2b-256 checksum
How to use checksums
a5269589e6527df5da2db7c4b596f495d186ba688d46da0f9fcee877311c2444
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.

Transparency log

Release files / cloudarmor_mcp-0.4.0-py3-none-any.whl

Download URL cloudarmor_mcp-0.4.0-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc7d6e9822fcca87322d585b7042af7eed5bae172594bdfbaeba83d5083f31ce
BLAKE2b-256 checksum
How to use checksums
dd6adf436ba3bd901f7249accb51c9c0efe6d907e169b63e5c8f251929fdac87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page