cloudarmor-mcp
cloudarmor-mcp is a read-only MCP server that patrols Google Cloud Armor WAF logs and reports DENY activity from Cloud Logging.
daily_brief— one-call morning summary: enforced DENYs by rule priority, home-region false-positive check, and preview DENYs.enforce_denies— enforced DENY counts per rule priority over a window (since_hours, default 26).home_region_denies— enforced DENYs from IPs geolocating to your home region; anything not marked known-normal is a false-positive candidate (requiresCLOUDARMOR_HOME_REGION).preview_denies— dry-run/preview DENY counts; a preview rule staying quiet is a candidate for promotion to enforce.health_check— version, config presence, and a minimal Cloud Logging probe, returninghealthy/degraded/error.All tools are read-only; counts are capped (default 2000 entries per query) and reported as
>= N (capped), never exact totals.Configured via env vars: project ID, service-account key path, optional backend-service filter, home region, max entries, and a rules INI for human-readable labels plus known-normal priorities.
Also ships a CLI (
--version,--check,--brief) and batchdeny-export/traffic-exportJSON exporters for per-request log data.
Provides tools to patrol Google Cloud Armor WAF logs, summarizing denied requests per rule, checking home-region false positives, and reviewing preview rules, with data from Cloud Logging.
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., "@cloudarmor-mcpRun the daily WAF brief"
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.
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 |
| One-call morning summary: enforced DENYs by rule priority, home-region false-positive lens, preview DENYs |
| Enforced DENY counts per rule priority |
| Enforced DENYs whose source IP geolocates to your home region — anything not marked known-normal is a false-positive candidate |
| Preview (dry-run) DENY counts — a quiet preview rule is a promotion candidate |
| 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.
Related MCP server: gke-cred-audit
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.com2. Install
pip install cloudarmor-mcp
# or
uv tool install cloudarmor-mcp3. Environment variables
Variable | Required | Meaning |
| yes | GCP project ID that receives the load-balancer logs |
| yes | Path to the service-account key file |
| no | Comma-separated backend service names to filter (default: all) |
| no | ISO region code treated as home traffic, e.g. |
| no | Path to a rules INI (labels + known-normal priorities, see below) |
| 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, 6005. 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-mcpThe 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-mcpwith 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)Exporting one day of DENY entries (batch)
cloudarmor-mcp deny-export --date 2026-09-22 --tz Asia/Tokyo > out.tmp && mv out.tmp 2026-09-22.jsonWrites one JSON document to stdout with one record per DENY log entry of that
calendar day ([00:00, 24:00) in --tz, default UTC): the enforced and preview
policy verdicts (policy, priority, action, outcome, rule_ids), source IP,
region code and ASN as Cloud Armor logged them, method, host, path (query string
dropped — only its length is kept), status, User-Agent (200 chars) and backend.
--kind both (default) fetches entries where either policy says DENY in a single
query, so a request that matched a preview rule and was denied appears once with
both sections filled. --backend a,b overrides CLOUDARMOR_BACKEND_SERVICES.
This and traffic-export (below) are the only outputs of the package that contain per-request log data; it is
meant for an operator batch on the same host that aggregates the day itself. The
document ends with count, fetched, malformed and capped: when capped is
true the export stopped at --max-entries (default 200000; CLOUDARMOR_MAX_ENTRIES
does not apply) and is a prefix of the day, oldest first. Records are streamed, so
memory does not grow with the day, and pages are fetched at most one per 1.2 s to stay
under the Cloud Logging read quota (60 requests per minute), so a day with 200,000 entries
takes a few minutes. A day that has not ended yet is refused. Run it
some minutes after local midnight — Cloud Logging entries arrive with a delay — and
write to a temporary file first: on a query failure the exit code is 1 and stdout may
hold an unterminated document.
Exporting a sampled day of all requests (batch)
cloudarmor-mcp traffic-export --date 2026-09-22 --tz Asia/Tokyo --sample 0.01 > out.tmp && mv out.tmp 2026-09-22.jsonSame document layout and record fields as deny-export, but for every
load-balancer request of the day — allowed, denied and served from the CDN cache —
thinned by Cloud Logging's sample(insertId, RATE) (--sample, default 0.01).
The sample is a hash of each entry's insertId, so it is spread evenly over the day
and the same rate selects the same entries on every run; scale counts by
1 / sample to estimate the day — but not when capped is true: entries are read
oldest first, so a capped export covers only the early part of the day (lower
--sample or raise --max-entries instead). Each record adds cache_hit. When no
backend security policy evaluated a request (a CDN cache hit, for example) it has
enforced: null and no region code or ASN; use cache_hit, not enforced, to tell
cache hits apart.
The header carries sample instead of kind. Use it to see who visits — browsers,
crawlers, AI agents — which the DENY logs cannot show. The per-request caveats of
deny-export apply: the records include legitimate visitors' addresses.
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_prioritieslist 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
Available Tools
5 toolsdaily_briefB
Morning patrol summary: enforced DENYs by rule, home-region
false-positive check, and preview DENYs, in one call.
| Name | Required | Description | Default |
|---|---|---|---|
| since_hours | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. The words 'summary', 'check', and 'preview' strongly imply a read-only, non-destructive operation, which is useful behavioral context. However, it does not explicitly state side effects, authentication requirements, or return format. The description adds context beyond the name but lacks a clear safety declaration.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that is concise, front-loaded, and free of fluff. It efficiently lists the three components of the brief, making every word earn its place. This is an excellent example of brevity without sacrificing meaning.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that the tool has an output schema and only one optional parameter, the description covers the core purpose well. The main gap is the undocumented 'since_hours' parameter, but the schema's default and the simple nature of the tool partially mitigate this. The description is complete enough for a low-complexity tool with an output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema describes one parameter, 'since_hours', with a default of 26, but the description does not mention it at all. Schema description coverage is 0%, so the description must compensate, but it fails to explain what 'since_hours' represents or how it affects the brief. The parameter name suggests a time window, but this is not linked to the 'morning patrol' context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool provides a 'Morning patrol summary' covering three specific components: enforced DENYs by rule, home-region false-positive check, and preview DENYs. This distinguishes it from sibling tools like enforce_denies, preview_denies, and home_region_denies, which are individual operations. The verb is implied ('summary') rather than explicit, but the scope and content are unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'Morning patrol summary' implies use for a routine daily check, and 'in one call' suggests it consolidates multiple separate operations. However, there is no explicit guidance on when to use this tool versus the sibling alternatives, nor when not to use it. The context is clear but not explicit about exclusions or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
enforce_deniesD
Enforced DENY counts per Cloud Armor rule priority over the window.
| Name | Required | Description | Default |
|---|---|---|---|
| since_hours | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description carries the full burden of behavioral disclosure. It only states what is counted without explaining whether this is a read-only operation, how the 'window' is defined, or what 'Enforced' means in contrast to preview.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single short phrase, but it is under-specified rather than concise. It omits critical context needed to invoke the tool correctly, so the brevity is not a strength.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having only one parameter and an output schema, the description is too sparse to provide a complete picture of the tool's behavior. It does not clarify key terms like 'window' or 'Enforced', making it inadequate for confident tool selection and invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has one parameter (since_hours) with 0% description coverage, and the description does not mention it at all. The meaning and effect of the parameter are completely unexplained.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description mentions the resource (Cloud Armor rule priority) and metric (enforced DENY counts), but lacks a clear verb and the phrase 'over the window' is ambiguous. It distinguishes from sibling 'preview_denies' via the word 'Enforced', but not explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like preview_denies or health_check. There is no mention of appropriate use cases, exclusions, or conditions for selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
health_checkA
Service health: version, config presence and a minimal API probe.
Returns a fixed shape (status/service/version + backend fields) so a monitoring caller never has to branch on missing keys. status is "healthy" when the config loads and a 1-entry probe query succeeds, "degraded" when config loads but the probe fails, "error" when the config itself is unusable.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description fully explains the behavior by defining the three possible statuses (healthy, degraded, error) and their conditions. It also discloses that the response has a fixed shape, which is valuable for callers.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two focused sentences, front-loaded with the tool's purpose, and every sentence adds behavioral value. It is concise without being under-specified.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter health check with no output schema, the description fully covers purpose, behavior, and return shape. It gives a complete picture for an agent to invoke and interpret the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
This tool has zero parameters, so the schema already provides complete coverage. The description adds no parameter details, but none are needed; the baseline of 4 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states this is a service health check that reports version, config presence, and a minimal API probe. It identifies the exact resource and action, and is distinctly different from sibling tools like enforce_denies or daily_brief.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides clear context by mentioning a 'monitoring caller' and explains why the fixed shape is beneficial (no branching on missing keys). However, it does not explicitly state when not to use this tool or name alternative tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
home_region_deniesA
Enforced DENYs whose source IP geolocates to the home region.
This is the false-positive lens: home-region users being denied on a priority that is not marked known-normal deserves review. Requires CLOUDARMOR_HOME_REGION.
| Name | Required | Description | Default |
|---|---|---|---|
| since_hours | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must carry the transparency burden. It discloses a prerequisite (CLOUDARMOR_HOME_REGION) and implies a read-only review operation, but it does not explicitly state that no changes are made or describe the output shape beyond the output schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences long, front-loaded with the primary action, and the second sentence provides valuable context. There is no filler or repetition, making it highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple, has an output schema, and the description covers purpose and usage context well. However, it omits any explanation of the since_hours parameter and the concept of 'known-normal', which are relevant to effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has one parameter (since_hours) with no description, and the description never mentions it. Since schema coverage is 0%, the description should compensate, but it doesn't, leaving the parameter's role and default behavior undocumented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states exactly what the tool does: it lists enforced DENYs whose source IP geolocates to the home region, framing it as a false-positive lens. This is a specific verb-resource combination that clearly distinguishes it from siblings like enforce_denies or preview_denies.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear usage context: use this when reviewing home-region users being denied on a priority not marked known-normal. It does not explicitly name alternatives or when-not-to-use, but the context is sufficient for most agents.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
preview_deniesA
Preview (dry-run) DENY counts per rule priority over the window.
A preview rule that stays free of false positives is a candidate for promotion to enforce.
| Name | Required | Description | Default |
|---|---|---|---|
| since_hours | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the transparency burden. The term 'dry-run' clearly communicates non-destructive behavior, and the false-positive evaluation context adds behavioral insight. It could explicitly state no changes are made, but the meaning is clear.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences that front-load the core purpose. The second sentence adds context without fluff. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one optional param, output schema present), the description covers the purpose and use case well. The main gap is the lack of explicit mapping from 'window' to since_hours, and some domain terms like 'rule priority' are undefined, but overall it is sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, and the description does not explain the since_hours parameter or its relationship to the 'window'. The parameter name is self-explanatory, but the description adds no parameter-specific meaning, so it does not compensate for the lack of schema description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function with specific verb 'Preview' and resource 'DENY counts per rule priority over the window'. It distinguishes itself from the sibling enforce_denies by explicitly labeling itself as a dry-run and mentioning promotion to enforce.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies a clear use case: preview rules to evaluate false positives before promoting to enforce. However, it does not explicitly mention alternatives or state when not to use, so it falls short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.0- First observed
daily_brief - First observed
enforce_denies - First observed
health_check - First observed
home_region_denies - First observed
preview_denies
TDQS
Scored across 5 tools
health_check is clearly distinct. enforce_denies vs preview_denies are differentiated by mode. home_region_denies is a specialized subset of enforced denies, which could be confused with enforce_denies, but the description clarifies its specific lens. daily_brief aggregates the others, but its purpose as a combined summary is evident from the description.
Tool names mix conventions: verb_noun (enforce_denies, preview_denies), noun_verb (health_check), noun_noun (home_region_denies), and adjective_noun (daily_brief). While all are snake_case, the inconsistent verb/noun order and variable parts of speech make naming less predictable.
5 tools is an appropriate scope for a specialized Cloud Armor deny analytics server. The count is neither too sparse to cover the core workflow nor bloated with redundant functionality, and each tool serves a distinct purpose within the defined domain.
The tools cover deny counts (enforced and preview), home-region analysis, and a summary brief, which addresses the primary monitoring workflow. However, there are notable gaps: no way to list or retrieve rule details to map priorities to rule names, and no allow-count or total-traffic metrics. These omissions could require agents to work around the lack of context when analyzing denies.
Maintenance
Related MCP Connectors
Hosted MCP server for GA4, Google Ads and Search Console. Google OAuth, nothing to install.
Read-only Google Search Console MCP server for AI assistants.
1Read-only MCP server for AIStatusDashboard status, incidents, metrics, and fallback recommendations.
Read-only Google Analytics 4 MCP server for AI assistants.
1
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceThis MCP Server provides a natural language interface to interact with Google's Policy Analyzer API, allowing users to analyze policies and evaluate compliance through conversations.-
- AlicenseNot gradedqualityDmaintenanceDefensive credential-exposure auditor for GKE that inventories workload identity, service account tokens, and RBAC posture, exposing findings via an MCP server at /mcp.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceMCP server for AI agent security guardrails. Provides input validation, prompt injection detection, PII redaction, output filtering, policy enforcement, rate limiting, and comprehensive audit logging.64 npm1MIT
- FlicenseNot gradedqualityBmaintenanceEnterprise MCP server for Google SecOps (Chronicle) SIEM/SOAR, enabling alert triage, UDM telemetry search, YARA-L detection rule management, log ingestion, and parser administration via Streamable HTTP.-