An AWS Labs Model Context Protocol (MCP) server for cloudwatch
Project description
AWS Labs cloudwatch MCP Server
This AWS Labs Model Context Protocol (MCP) server for CloudWatch enables your troubleshooting agents to use CloudWatch data to do AI-powered root cause analysis and provide recommendations. It offers comprehensive observability tools that simplify monitoring, reduce context switching, and help teams quickly diagnose and resolve service issues. This server will provide AI agents with seamless access to CloudWatch telemetry data through standardized MCP interfaces, eliminating the need for custom API integrations and reducing context switching during troubleshooting workflows. By consolidating access to all CloudWatch capabilities, we enable powerful cross-service correlations and insights that accelerate incident resolution and improve operational visibility.
Instructions
The CloudWatch MCP Server provides specialized tools to address common operational scenarios including alarm troubleshooting, understand metrics definitions, alarm recommendations and log analysis. Each tool encapsulates one or multiple CloudWatch APIs into task-oriented operations.
Features
Alarm Based Troubleshooting - Identifies active alarms, retrieves related metrics and logs, and analyzes historical alarm patterns to determine root causes of triggered alerts. Provides context-aware recommendations for remediation.
Log Analyzer - Analyzes a CloudWatch log group for anomalies, message patterns, and error patterns within a specified time window.
Metric Definition Analyzer - Provides comprehensive descriptions of what metrics represent, how they're calculated, recommended statistics to use for metric data retrieval
Alarm Recommendations - Suggests recommended alarm configurations for CloudWatch metrics, including thresholds, evaluation periods, and other alarm settings.
Prerequisites
- An AWS account with CloudWatch Telemetry
- This MCP server can only be run locally on the same host as your LLM client.
- Set up AWS credentials with access to AWS services
- You need an AWS account with appropriate permissions (See required permissions below)
- Configure AWS credentials with
aws configureor environment variables
Available Tools
Tools for CloudWatch Metrics
get_metric_data- Retrieves detailed CloudWatch metric data for any CloudWatch metric. Use this for general CloudWatch metrics that aren't specific to Application Signals. Provides ability to query any metric namespace, dimension, and statisticget_metric_metadata- Retrieves comprehensive metadata about a specific CloudWatch metricget_recommended_metric_alarms- Gets recommended alarms for a CloudWatch metric based on best practice, and trend, seasonality and statistical analysis.analyze_metric- Analyzes CloudWatch metric data to determine trend, seasonality, and statistical properties
Tools for CloudWatch Alarms
get_active_alarms- Identifies currently active CloudWatch alarms across the accountget_alarm_history- Retrieves historical state changes and patterns for a given CloudWatch alarm
Tools for CloudWatch Logs
describe_log_groups- Finds metadata about CloudWatch log groupsanalyze_log_group- Analyzes CloudWatch logs for anomalies, message patterns, and error patternsexecute_log_insights_query- Executes CloudWatch Logs insights query on CloudWatch log group(s) with specified time range and query syntax, returns a unique ID used to retrieve resultsget_logs_insight_query_results- Retrieves the results of an executed CloudWatch insights query using the query ID. It is used afterexecute_log_insights_queryhas been calledcancel_logs_insight_query- Cancels in progress CloudWatch logs insights query
Required IAM Permissions
-
cloudwatch:DescribeAlarms -
cloudwatch:DescribeAlarmHistory -
cloudwatch:GetMetricData -
cloudwatch:ListMetrics -
logs:DescribeLogGroups -
logs:DescribeQueryDefinitions -
logs:ListLogAnomalyDetectors -
logs:ListAnomalies -
logs:StartQuery -
logs:GetQueryResults -
logs:StopQuery
Installation
Option 1: Python (UVX)
Prerequisites
- Install
uvfrom Astral or the GitHub README - Install Python using
uv python install 3.10
One Click Install
| Cursor | VS Code |
|---|---|
MCP Config (Q CLI, Cline)
- For Q CLI, update MCP Config Amazon Q Developer CLI (~/.aws/amazonq/mcp.json)
- For Cline click on "Configure MCP Servers" option from MCP tab
{
"mcpServers": {
"awslabs.cloudwatch-mcp-server": {
"autoApprove": [],
"disabled": false,
"command": "uvx",
"args": [
"awslabs.cloudwatch-mcp-server@latest"
],
"env": {
"AWS_PROFILE": "[The AWS Profile Name to use for AWS access]",
"FASTMCP_LOG_LEVEL": "ERROR"
},
"transportType": "stdio"
}
}
}
Windows Installation
For Windows users, the MCP server configuration format is slightly different:
{
"mcpServers": {
"awslabs.cloudwatch-mcp-server": {
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "uv",
"args": [
"tool",
"run",
"--from",
"awslabs.cloudwatch-mcp-server@latest",
"awslabs.cloudwatch-mcp-server.exe"
],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR",
"AWS_PROFILE": "your-aws-profile",
"AWS_REGION": "us-east-1"
}
}
}
}
Please reference AWS documentation to create and manage your credentials profile
Option 2: Docker Image
Prerequisites
Build and install docker image locally on the same host of your LLM client
- Install Docker
git clone https://github.com/awslabs/mcp.git- Go to sub-directory
cd src/cloudwatch-mcp-server/ - Run
docker build -t awslabs/cloudwatch-mcp-server:latest .
One Click Cursor Install
MCP Config using Docker image(Q CLI, Cline)
{
"mcpServers": {
"awslabs.cloudwatch-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"--interactive",
"-v ~/.aws:/root/.aws",
"-e AWS_PROFILE=[The AWS Profile Name to use for AWS access]",
"awslabs/cloudwatch-mcp-server:latest"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
Please reference AWS documentation to create and manage your credentials profile
Contributing
Contributions are welcome! Please see the CONTRIBUTING.md in the monorepo root for guidelines.
Feedback and Issues
We value your feedback! Submit your feedback, feature requests and any bugs at GitHub issues with prefix cloudwatch-mcp-server in title.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file awslabs_cloudwatch_mcp_server-0.0.15.tar.gz.
File metadata
- Download URL: awslabs_cloudwatch_mcp_server-0.0.15.tar.gz
- Upload date:
- Size: 289.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfbe476d8df075b2a84774c9c8162837051e9c084aadb45351c56ad1ef6afc7f
|
|
| MD5 |
cee5abae46a5494789efb9111c1fb948
|
|
| BLAKE2b-256 |
75154c059b8adaa775aff5acc2689cb29e3b88d9070fb2e01a6039ecf367179f
|
Provenance
The following attestation bundles were made for awslabs_cloudwatch_mcp_server-0.0.15.tar.gz:
Publisher:
release.yml on awslabs/mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
awslabs_cloudwatch_mcp_server-0.0.15.tar.gz -
Subject digest:
dfbe476d8df075b2a84774c9c8162837051e9c084aadb45351c56ad1ef6afc7f - Sigstore transparency entry: 782602428
- Sigstore integration time:
-
Permalink:
awslabs/mcp@4c395a2996bc0e90108f286e767d187e8fcaf20f -
Branch / Tag:
refs/tags/2025.12.20251230231100 - Owner: https://github.com/awslabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4c395a2996bc0e90108f286e767d187e8fcaf20f -
Trigger Event:
push
-
Statement type:
File details
Details for the file awslabs_cloudwatch_mcp_server-0.0.15-py3-none-any.whl.
File metadata
- Download URL: awslabs_cloudwatch_mcp_server-0.0.15-py3-none-any.whl
- Upload date:
- Size: 153.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c083cdd6a5ef76a4234eed84815a413aaa67051555488cbe3273b4c8a27c3118
|
|
| MD5 |
a4ccf596b7420be309ef1c733823d8cb
|
|
| BLAKE2b-256 |
c0f7a3e5bd7e678cf7599c82fe7095403eafc5fa5177052cf9c1a2f98b6e906e
|
Provenance
The following attestation bundles were made for awslabs_cloudwatch_mcp_server-0.0.15-py3-none-any.whl:
Publisher:
release.yml on awslabs/mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
awslabs_cloudwatch_mcp_server-0.0.15-py3-none-any.whl -
Subject digest:
c083cdd6a5ef76a4234eed84815a413aaa67051555488cbe3273b4c8a27c3118 - Sigstore transparency entry: 782602435
- Sigstore integration time:
-
Permalink:
awslabs/mcp@4c395a2996bc0e90108f286e767d187e8fcaf20f -
Branch / Tag:
refs/tags/2025.12.20251230231100 - Owner: https://github.com/awslabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4c395a2996bc0e90108f286e767d187e8fcaf20f -
Trigger Event:
push
-
Statement type: