Get the FREE Ultimate OpenClaw Setup Guide →

cloudwatch-logs

MCP server from serkanh/cloudwatch-logs-mcp

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio serkanh-cloudwatch-logs-mcp python -m cloudwatch_logs_mcp.main \
  --env AWS_ACCESS_KEY_ID="<YOUR_ACCESS_KEY_ID>" \
  --env AWS_SECRET_ACCESS_KEY="<YOUR_SECRET_ACCESS_KEY>"

How to use

This MCP server provides two tools for interacting with AWS CloudWatch Logs: list_groups and get_logs. The list_groups tool lists available CloudWatch log groups, with optional filtering by prefix, region, and AWS credentials. The get_logs tool retrieves log events from a specific log group, with optional parameters to narrow results by log stream, time range, and filter patterns. You can invoke these tools from your MCP client or Claude Desktop integration to seamlessly fetch log group metadata and log events for analysis or troubleshooting. Remember to provide AWS credentials either through environment variables or the tool's parameter options when needed.

To use, start the server with your Python runtime, then call list_groups with the desired parameters to discover log groups, followed by get_logs providing the logGroupName and any optional constraints to fetch the actual log events.

How to install

Prerequisites:

  • Python 3.8+ installed on your system
  • AWS credentials with access to CloudWatch Logs (or use environment variables per the tool)
  1. Clone the repository or download the MCP server files.

  2. Create a virtual environment (optional but recommended):

    python3 -m venv venv source venv/bin/activate # macOS/Linux venv\Scripts\activate # Windows

  3. Install required dependencies. If a requirements.txt is provided, run:

    pip install -r requirements.txt (If not available, ensure boto3 is installed since the server uses it to interact with CloudWatch Logs:)

    pip install boto3

  4. Run the server (as per the README example):

    python3 -m cloudwatch_logs_mcp.main or adapt to your package/module name as configured in mcp_config.

  5. Optional: configure Claude Desktop or Docker usage as shown in the README to connect to the running MCP server.

Notes:

  • If you use Docker, ensure AWS credentials are passed securely via environment variables or AWS IAM roles.
  • Verify your Python path and module name in the mcp_config to match your installation layout.

Additional notes

Tips and common issues:

  • Ensure AWS credentials have CloudWatch Logs permissions (logs:DescribeLogGroups, logs:GetLogEvents, etc.).
  • When filtering logs with get_logs, usage of startTime/endTime accepts ISO timestamps or relative times (e.g., 5m, 1h).
  • If you encounter authentication errors, verify that AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are correctly set in the environment where the MCP server runs.
  • For long-running log queries, consider paging results or applying narrower time windows to reduce data transfer and latency.
  • If running behind a proxy, ensure network access to AWS endpoints is allowed and that boto3 is configured to use the proxy if needed.

Related MCP Servers

Sponsor this space

Reach thousands of developers