cloudwatch-mcp-multiprofile

v0.1.0
cloudwatch-mcp-multiprofile Checked 3 days ago Published 11 months ago

CloudWatch MCP Server with Multi-Profile Support - Fork of awslabs.cloudwatch-mcp-server

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

describe_log_groups

Lists AWS CloudWatch log groups and saved queries associated with them, optionally filtering by a name prefix. This tool retrieves information about log groups in the account, or log groups in accounts linked to this account as a monitoring account. If a prefix is provided, only log groups with names starting with the specified prefix are returned. Additionally returns any user saved queries that are associated with any of the returned log groups. Usage: Use this tool to discover log groups that you'd retrieve or query logs from and queries that have been sav…

ParameterTypeDescription
account_identifiersWhen include_linked_accounts is set to True, use this parameter to specify the list of accounts to search. IMPORTANT: Only has affect if include_linked_accounts is True
include_linked_accountsIf the AWS account is a monitoring account, set this to True to have the tool return log groups in the accounts listed in account_identifiers. If this parameter is set to true and acco…
log_group_classIf specified, filters for only log groups of the specified class.
log_group_name_prefixAn exact prefix to filter log groups by name. IMPORTANT: Only log groups with names starting with this prefix will be returned.
max_itemsThe maximum number of log groups to return.
profile_nameAWS CLI Profile Name to use for AWS access. By default uses the profile configured in MCP configuration.
regionAWS region to query. Defaults to AWS_REGION environment variable, then profile config, then boto3 defaults.

analyze_log_group

Analyzes a CloudWatch log group for anomalies, message patterns, and error patterns within a specified time window. This tool performs an analysis of the specified log group by: 1. Discovering and checking log anomaly detectors associated with the log group 2. Retrieving anomalies from those detectors that fall within the specified time range 3. Identifying the top 5 most common message patterns 4. Finding the top 5 patterns containing error-related terms Usage: Use this tool to detect anomalies and understand common patterns in your log data,…

ParameterTypeDescription
end_time *stringISO 8601 formatted end time for the CloudWatch Logs Insights query window (e.g., "2025-04-19T21:00:00+00:00").
log_group_arn *stringThe log group arn to look for anomalies in, as returned by the describe_log_groups tools
start_time *stringISO 8601 formatted start time for the CloudWatch Logs Insights query window (e.g., "2025-04-19T20:00:00+00:00").
profile_nameAWS CLI Profile Name to use for AWS access. By default uses the profile configured in MCP configuration.
regionAWS region to query. Defaults to AWS_REGION environment variable, then profile config, then boto3 defaults.

execute_log_insights_query

Executes a CloudWatch Logs Insights query and waits for the results to be available. IMPORTANT: The operation must include exactly one of the following parameters: log_group_names, or log_group_identifiers. CRITICAL: The volume of returned logs can easily overwhelm the agent context window. Always include a limit in the query (| limit 50) or using the limit parameter. Usage: Use to query, filter, collect statistics, or find patterns in one or more log groups. For example, the following query lists exceptions per hour. ``` filter @mess…

ParameterTypeDescription
end_time *stringISO 8601 formatted end time for the CloudWatch Logs Insights query window (e.g., "2025-04-19T21:00:00+00:00").
query_string *stringThe query string in the Cloudwatch Log Insights Query Language. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html.
start_time *stringISO 8601 formatted start time for the CloudWatch Logs Insights query window (e.g., "2025-04-19T20:00:00+00:00").
limitThe maximum number of log events to return. It is critical to use either this parameter or a `| limit <int>` operator in the query to avoid consuming too many tokens of the agent.
log_group_identifiersThe list of up to 50 logGroupIdentifiers to query. You can specify them by the log group name or ARN. If a log group that you're querying is in a source account and you're using a monitoring account,…
log_group_namesThe list of up to 50 log group names to be queried. CRITICAL: Exactly one of [log_group_names, log_group_identifiers] should be non-null.
max_timeoutintegerMaximum time in second to poll for complete results before giving up
profile_nameAWS CLI Profile Name to use for AWS access. By default uses the profile configured in MCP configuration.
regionAWS region to query. Defaults to AWS_REGION environment variable, then profile config, then boto3 defaults.

get_logs_insight_query_results

Retrieves the results of a previously started CloudWatch Logs Insights query. Usage: If a log query is started by execute_log_insights_query tool and has a polling time out, this tool can be used to try to retrieve the query results again. Returns: -------- A dictionary containing the final query results, including: - status: The current status of the query (e.g., Scheduled, Running, Complete, Failed, etc.) - results: A list of the actual query results if the status is Complete. - statistics: Query pe…

ParameterTypeDescription
query_id *stringThe unique ID of the query to retrieve the results for. CRITICAL: This ID is returned by the execute_log_insights_query tool.
profile_nameAWS CLI Profile Name to use for AWS access. By default uses the profile configured in MCP configuration.
regionAWS region to query. Defaults to AWS_REGION environment variable, then profile config, then boto3 defaults.

cancel_logs_insight_query

Cancels an ongoing CloudWatch Logs Insights query. If the query has already ended, returns an error that the given query is not running. Usage: If a log query is started by execute_log_insights_query tool and has a polling time out, this tool can be used to cancel it prematurely to avoid incurring additional costs. Returns: -------- A LogsQueryCancelResult with a "success" key, which is True if the query was successfully cancelled.

ParameterTypeDescription
query_id *stringThe unique ID of the ongoing query to cancel. CRITICAL: This ID is returned by the execute_log_insights_query tool.
profile_nameAWS CLI Profile Name to use for AWS access. By default uses the profile configured in MCP configuration.
regionAWS region to query. Defaults to AWS_REGION environment variable, then profile config, then boto3 defaults.

get_metric_data

Retrieves CloudWatch metric data for a specific metric. This tool retrieves metric data from CloudWatch for a specific metric identified by its namespace, metric name, and dimensions, within a specified time range. It can use either standard GetMetricData API or CloudWatch Metrics Insights for more advanced querying. The function automatically determines whether to use standard GetMetricData or Metrics Insights based on the parameters provided. If any Metrics Insights specific parameters are provided (group_by_dimension, schema_dimension_keys,…

ParameterTypeDescription
metric_name *string
namespace *string
start_time *The start time for the metric data query (ISO format or datetime)
dimensionsarray
end_timeThe end time for the metric data query (ISO format or datetime), defaults to current time
group_by_dimensionDimension name to group by in Metrics Insights mode. Must be included in schema_dimension_keys.
limitMaximum number of results to return in Metrics Insights mode (used with LIMIT clause).
order_by_statisticStatistic to use in the ORDER BY clause. Required if sort_order is specified.
profile_nameAWS CLI Profile Name to use for AWS access. By default uses the profile configured in MCP configuration.
regionAWS region to query. Defaults to AWS_REGION environment variable, then profile config, then boto3 defaults.
schema_dimension_keysarrayList of dimension keys to include in the SCHEMA definition for Metrics Insights query.
sort_orderSort order for results when using ORDER BY in Metrics Insights. Can be 'ASC', 'DESC', or None.
statisticstringThe statistic to use for the metric
target_datapointsintegerTarget number of data points to return (default: 60). Controls the granularity of the returned data.

get_metric_metadata

Gets metadata for a CloudWatch metric including description, unit and recommended statistics that can be used for metric data retrieval. This tool retrieves comprehensive metadata about a specific CloudWatch metric identified by its namespace and metric name. Usage: Use this tool to get detailed information about CloudWatch metrics, including their descriptions, units, and recommended statistics to use. Args: ctx: The MCP context object for error handling and logging. namespace: The metric namespace (e.g., "AWS/EC2", "A…

ParameterTypeDescription
metric_name *stringThe name of the metric (e.g., 'CPUUtilization', 'Duration')
namespace *stringThe namespace of the metric (e.g., 'AWS/EC2', 'AWS/Lambda')
profile_nameAWS CLI Profile Name to use for AWS access. By default uses the profile configured in MCP configuration.
regionAWS region to query. Defaults to AWS_REGION environment variable, then profile config, then boto3 defaults.

analyze_metric

Analyzes CloudWatch metric data to determine seasonality, trend, data density and statistical properties. This tool provides RAW DATA ONLY about historical metric data and performs analysis including: - Seasonality detection - Trend analysis - Data density and publishing period - Advanced statistical measures (min/max/median, std dev, noise) Usage: Use this tool to get objective metric analysis data. Args: ctx: The MCP context object for error handling and logging. namespace: The metric namespace (e.g., "AWS/EC2…

ParameterTypeDescription
metric_name *stringThe name of the metric (e.g., 'CPUUtilization', 'Duration')
namespace *stringThe namespace of the metric (e.g., 'AWS/EC2', 'AWS/Lambda')
dimensionsarrayList of dimensions that identify the metric, each with name and value
profile_nameAWS CLI Profile Name to use for AWS access. Falls back to AWS_PROFILE environment variable if not specified, or uses default AWS credential chain.
regionAWS region to query. Defaults to AWS_REGION environment variable, then profile config, then boto3 defaults.
statisticstringThe statistic to use for the metric analysis

get_active_alarms

Gets all CloudWatch Alarms currently in ALARM state. This tool retrieves all CloudWatch Alarms that are currently in the ALARM state, including both metric alarms and composite alarms. Results are optimized for LLM reasoning with summary-level information. Usage: Use this tool to get an overview of all active alarms in your AWS account for troubleshooting, monitoring, and operational awareness. Args: ctx: The MCP context object for error handling and logging. max_items: Maximum number of alarms to return (default: 50).…

ParameterTypeDescription
max_itemsMaximum number of alarms to return (default: 50). Large values may cause context window overflow and impact LLM performance.
profile_nameAWS CLI Profile Name to use for AWS access. Falls back to AWS_PROFILE environment variable if not specified, or uses default AWS credential chain.
regionAWS region to query. Defaults to AWS_REGION environment variable, then profile config, then boto3 defaults.

get_alarm_history

Gets the history for a CloudWatch alarm with time range suggestions for investigation. This tool retrieves the history for a specified CloudWatch alarm, focusing primarily on state transitions to ALARM state. It also provides suggested time ranges for investigation based on the alarm's configuration and history. Usage: Use this tool to understand when an alarm fired and get useful time ranges for investigating the underlying issue using other CloudWatch tools. The tool is particularly useful for identifying patterns like alarm flapping (going i…

ParameterTypeDescription
alarm_name *stringName of the alarm to retrieve history for
end_timeThe end time for the history query in ISO format (e.g., '2023-01-01T00:00:00Z') or as a datetime object. Defaults to current time.
history_item_typeType of history items to retrieve. Possible values: 'ConfigurationUpdate', 'StateUpdate', 'Action'. Defaults to 'StateUpdate'.
include_component_alarmsFor composite alarms, whether to include details about component alarms. Defaults to false.
max_itemsMaximum number of history items to return (default: 50). Large values may cause context window overflow and impact LLM performance. Adjust time-range to limit responses.
profile_nameAWS CLI Profile Name to use for AWS access. By default uses the profile configured in MCP configuration.
regionAWS region to query. Defaults to AWS_REGION environment variable, then profile config, then boto3 defaults.
start_timeThe start time for the history query in ISO format (e.g., '2023-01-01T00:00:00Z') or as a datetime object. Defaults to 24 hours ago.