AWS CloudWatch MCP Server – Logs Insights queries, log stream events, alarm status, and metric statistics for security investigations
CloudWatch MCP has well-structured tool definitions with clear naming, comprehensive descriptions, and properly defined JSON schemas using Zod. All 6 tools follow verb_noun naming conventions. Descriptions are detailed and include use-case guidance. Schemas include type constraints, ranges, and enums where appropriate. However, there are notable gaps: output schemas are not documented (tools return unstructured text via token-limited handlers rather than typed responses), error handling lacks recovery guidance, and no idempotency markers are present for read-only tools. The `break_token_rule` parameter on multiple tools is unusual, it's a configuration override rather than a domain parameter, suggesting potential token management concerns in the underlying implementation. Parameter descriptions are generally strong (averaging 80-120 chars), exceeding the 72-char baseline, and all tools have substantive descriptions (194-380 chars, well within the 34-392 baseline range).
List and inspect CloudWatch alarms and their current state (OK / ALARM / INSUFFICIENT_DATA). Filter by alarm name, prefix, or state. Ideal for: rapid triage of active incidents, validating monitoring coverage, checking if anomaly thresholds were breached during an incident.
Retrieve raw log events from a specific CloudWatch log stream. Use list_log_streams first to find the stream name. Supports time filtering and pagination. Ideal for: detailed incident timeline reconstruction, specific Lambda invocation logs.
Retrieve time-series statistics for a CloudWatch metric. Supports AWS built-in metrics (EC2, Lambda, ELB, RDS, etc.) and custom metrics. Ideal for: correlating resource usage spikes with security events, verifying network traffic anomalies, investigating error rate changes during incidents.
List CloudWatch log groups in the current region. Use this first to discover available log groups before running queries. Supports prefix filtering to narrow results.
List log streams within a CloudWatch log group, sorted by last event time (newest first). Use this to find the specific stream name before calling get_log_events. Supports prefix filtering.
Output schemas are not documented. Tools return unstructured text responses wrapped in MCP content objects rather than typed response objects with documented fields. LLMs cannot plan downstream calls or extract structured data without knowing the schema of returned log events, alarm states, or metric statistics.
Error handling lacks recovery guidance. The token limiter returns a basic error message when limits are exceeded, but does not advise the LLM on corrective actions (e.g., 'reduce the limit parameter' or 'narrow the time range'). Per pattern:recovery-guide, errors should tell agents what to do next.
`break_token_rule` parameter is a code-smell. This is a configuration override disguised as a domain parameter, suggesting the tool's token management is fragile. The presence of this flag indicates the service may fail under normal loads, and the workaround shifts responsibility to the LLM to know when to bypass safety guardrails.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 8 | <=2025-11-25 | v2 |
| 2026-03-09 | C | 60 | - | v1 |
Run a CloudWatch Logs Insights query against one or more log groups. Supports full Logs Insights SQL-like syntax: filter, stats, sort, limit. Ideal for: VPC Flow Log anomaly detection, application error analysis, access pattern investigation, Lambda execution tracing. IMPORTANT: Always include a LIMIT clause (e.g. "limit 20") to avoid token overflow.
No pagination support on listing tools. `list_log_groups` and `list_log_streams` accept a `limit` parameter but do not return pagination tokens (cursor or nextToken). If a user's AWS account has more than 50 log groups, the agent cannot discover all of them. Per pattern:paginated-result, list tools should support cursor-based or offset-based pagination.
Tool annotations missing. No tools are marked with readOnlyHint (all are read-only and safe to call), idempotentHint (all are idempotent), or destructiveHint. These annotations help agents understand safety properties and plan retries correctly.
Dimensions parameter in `get_metric_statistics` requires manual object construction. While the schema is correct, the description does not provide examples of valid dimension pairs (e.g., InstanceId for EC2 metrics). This forces LLMs to guess valid dimension names and risks API errors.