npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@teolin/mcp-cloudwatch-logs

v3.3.6

Published

MCP server for querying AWS CloudWatch Logs with Log Insights

Readme

CloudWatch Logs MCP Server

Features

MCP server for querying AWS CloudWatch Logs with Log Insights.

  • Execute CloudWatch Logs Insights queries
  • List available log groups
  • Get recent log entries from specific log groups
  • Support for relative time ranges (e.g., "1h", "1d")
  • Flexible query parameters and filtering

Prerequisites

  • Node.js >=18.0.0
  • AWS credentials configured (via AWS CLI, environment variables, or IAM role)
  • Access to CloudWatch Logs
# Configure AWS credentials (pick one method):

# Option 1: AWS CLI
aws configure

# Option 2: Environment variables
export AWS_ACCESS_KEY_ID=your_key
export AWS_SECRET_ACCESS_KEY=your_secret
export AWS_REGION=us-east-1

# Verify credentials
aws sts get-caller-identity

Setup

| Method | Pros | Cons | When | | -------------- | ----------------------------- | -------------------------------- | -------------- | | npx | No install, latest version | Slower, needs internet | Quick demos | | Global npm | Instant, offline | Takes disk space, manual updates | Default choice | | Local npm | Version controlled, team sync | Extra disk per project | Shared teams |

# Option 1: npx (fastest)
claude mcp add cloudwatch --scope user -- npx --yes @teolin/mcp-cloudwatch-logs
gemini mcp add cloudwatch npx --yes @teolin/mcp-cloudwatch-logs

# Option 2: Global install (recommended)
npm install --global @teolin/mcp-cloudwatch-logs
claude mcp add cloudwatch --scope user -- cloudwatch-mcp
gemini mcp add cloudwatch cloudwatch-mcp

# Option 3: Local project
npm install @teolin/mcp-cloudwatch-logs
claude mcp add cloudwatch --scope project -- node ./node_modules/@teolin/mcp-cloudwatch-logs/src/index.js

# Verify
claude mcp list
gemini mcp list

# Remove
claude mcp remove cloudwatch --scope user
gemini mcp remove cloudwatch

Available Tools

1. query_logs

Execute CloudWatch Logs Insights queries.

Parameters:

  • query (string, required): Logs Insights query string
  • logGroups (array, required): Log group names to query
  • startTime (string): Start time (ISO 8601 or relative like "1h", "1d")
  • endTime (string): End time (ISO 8601 or "now")
  • limit (number): Maximum number of results (default: 100)

2. list_log_groups

List available CloudWatch log groups.

Parameters:

  • namePrefix (string, optional): Filter by name prefix
  • limit (number): Maximum number to return (default: 50)

3. get_recent_logs

Get recent log entries from a specific log group.

Parameters:

  • logGroup (string, required): Log group name
  • hours (number): Hours to look back (default: 1)
  • limit (number): Maximum entries (default: 100)
  • filterPattern (string, optional): Filter pattern for log entries

Usage Examples

Example 1: Query recent errors

// In Claude Code:
"Show me errors from the last hour in /aws/lambda/my-function"
// Uses: query_logs with filter pattern for ERROR

Example 2: Search specific log group

// In Claude Code:
"Query CloudWatch: fields @timestamp, @message | filter @message like /timeout/ | sort @timestamp desc"
// Custom Logs Insights query

Example 3: List all log groups

// In Claude Code:
"List all CloudWatch log groups starting with /aws/lambda"
// Uses: list_log_groups with namePrefix filter

Example 4: Get recent logs from specific group

// In Claude Code:
"Get the last 50 log entries from /aws/ecs/my-service from the past 2 hours"
// Uses: get_recent_logs with hours and limit parameters