CloudWatch Logs MCP Server

by serkanh

27 stars
286 downloads
Not rated
GitHub

Description

# CloudWatch Logs MCP Server An MCP (Model Context Protocol) server that provides tools for accessing AWS CloudWatch logs. This server allows AI assistants to list log groups and read log entries from AWS CloudWatch. ## Available Tools ### list_groups Lists available CloudWatch…

About

# CloudWatch Logs MCP Server An MCP (Model Context Protocol) server that provides tools for accessing AWS CloudWatch logs. This server allows AI assistants to list log groups and read log entries from AWS CloudWatch. ## Available Tools ### list_groups Lists available CloudWatch log groups. **Parameters:** - `prefix`…

Details

Author
serkanh
GitHub stars
27
Downloads
286
Categories
Cloud Service, Other, Infrastructure, Developer Tools

- List available CloudWatch log groups with optional prefix.
- Read log entries from a specific log group.
- Filter logs by time (ISO or relative "5m", "1h", "1d"), log stream, and filter pattern.
- Support overriding AWS region and credentials per tool call.
- Returns JSON output with log group details or log events.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name CloudWatch Logs MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Configure AWS credentials via environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) or the AWS CLI. Then add the server to your Claude Desktop configuration (claude_desktop_config.json) using either a Python command or a Docker container. The server exposes two tools: list_groups and get_logs.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "cloudwatch logs mcp server": {
            "cloudwatch-logs": {
                "command": "python3",
                "args": [
                    "/path/to/cloudwatch-logs-mcp/main.py"
                ],
                "env": {
                    "AWS_ACCESS_KEY_ID": "<YOUR_ACCESS_KEY_ID>",
                    "AWS_SECRET_ACCESS_KEY": "<YOUR_SECRET_ACCESS_KEY>"
                },
                "disabled": false,
                "autoApprove": []
            }
        }
    }
}

McpServers

{
    "cloudwatch-logs": {
        "command": "python3",
        "args": [
            "/path/to/cloudwatch-logs-mcp/main.py"
        ],
        "env": {
            "AWS_ACCESS_KEY_ID": "<YOUR_ACCESS_KEY_ID>",
            "AWS_SECRET_ACCESS_KEY": "<YOUR_SECRET_ACCESS_KEY>"
        },
        "disabled": false,
        "autoApprove": []
    }
}

Access AWS CloudWatch logs to list log groups and read log entries.

An MCP (Model Context Protocol) server that provides tools for accessing AWS CloudWatch logs. This server allows AI assistants to list log groups and read log entries from AWS CloudWatch.

- prefix(optional): Log group name prefix
- region(optional): AWS region
- accessKeyId(optional): AWS access key ID
- secretAccessKey(optional): AWS secret access key
- sessionToken(optional): AWS session token

Returns:JSON string with the list of log groups, includinglogGroupName,creationTime, andstoredBytes.

Gets CloudWatch logs from a specific log group.

- logGroupName(required): The name of the log group
- logStreamName(optional): The name of the log stream
- startTime(optional): Start time in ISO format or relative time (e.g., "5m", "1h", "1d")
- endTime(optional): End time in ISO format
- filterPattern(optional): Filter pattern for the logs
- region(optional): AWS region
- accessKeyId(optional): AWS access key ID
- secretAccessKey(optional): AWS secret access key
- sessionToken(optional): AWS session token

Returns:JSON string with the log events, includingtimestamp,message, andlogStreamName.

Ensure you have AWS credentials configured. You can set them up using the AWS CLI or by setting environment variables:

Add the following to yourclaude_desktop_config.json:

{ "mcpServers": { "cloudwatch-logs": { "command": "python3", "args": ["/path/to/cloudwatch-logs-mcp/main.py"], "env": { "AWS_ACCESS_KEY_ID": "<YOUR_ACCESS_KEY_ID>", "AWS_SECRET_ACCESS_KEY": "<YOUR_SECRET_ACCESS_KEY>", }, "disabled": false, "autoApprove": [] } } }

If you prefer to run the server in a Docker container, you can set up a Dockerfile and use the following configuration:

{ "mcpServers": { "cloudwatch-logs": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "AWS_ACCESS_KEY_ID", "-e", "AWS_SECRET_ACCESS_KEY", "mcp/cloudwatch-logs" ], "env": { "AWS_ACCESS_KEY_ID": "<YOUR_ACCESS_KEY_ID>", "AWS_SECRET_ACCESS_KEY": "<YOUR_SECRET_ACCESS_KEY>", } } } }

This server is built using the FastMCP class from the MCP SDK, which provides a simple way to create MCP servers. The server exposes two main tools:
- list_groups: Lists available CloudWatch log groups
- get_logs: Reads log entries from specific log groups

Each tool is implemented as an async function decorated with@mcp.tool(). The server uses the boto3 library to interact with the AWS CloudWatch Logs API.

This AWS Labs Model Context Protocol (MCP) server for CloudTrail enables your AI agents to query AWS account activity for security investigations, compliance auditing, and operational troubleshooting.

Integrates with Alibaba Cloud APIs to manage resources like ECS, Cloud Monitor, and OOS.

Integrate with Alibaba Cloud APIs to manage resources like ECS, Cloud Monitor, and OOS.

Interact with AWS Application Signals for application monitoring and troubleshooting. Requires AWS credentials.

Provides a unified interface to AWS services for security investigations and incident response.

Interact with your AWS environment using natural language to query and manage resources. Requires local AWS credentials.

Interact with your AWS environment using natural language. Requires local AWS credentials.

Execute AWS CLI commands through the Model Context Protocol (MCP). Requires AWS credentials configured on the host.

Fetch logs, metrics, traces, and events from the Chronosphere observability platform.

An MCP server for accessing Google Cloud Logging data and services.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.