CloudWatch Logs
Access AWS CloudWatch logs to list log groups and read log entries.
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(optional): Log group name prefixregion(optional): AWS regionaccessKeyId(optional): AWS access key IDsecretAccessKey(optional): AWS secret access keysessionToken(optional): AWS session token
Returns: JSON string with the list of log groups, including logGroupName, creationTime, and storedBytes.
get_logs
Gets CloudWatch logs from a specific log group.
Parameters:
logGroupName(required): The name of the log grouplogStreamName(optional): The name of the log streamstartTime(optional): Start time in ISO format or relative time (e.g., "5m", "1h", "1d")endTime(optional): End time in ISO formatfilterPattern(optional): Filter pattern for the logsregion(optional): AWS regionaccessKeyId(optional): AWS access key IDsecretAccessKey(optional): AWS secret access keysessionToken(optional): AWS session token
Returns: JSON string with the log events, including timestamp, message, and logStreamName.
Setup
AWS Credentials
Ensure you have AWS credentials configured. You can set them up using the AWS CLI or by setting environment variables:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY
Usage with Claude Desktop
Add the following to your claude_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": []
}
}
}
Docker
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>",
}
}
}
}
Implementation Details
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 groupsget_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.
License
MIT
Related Servers
HuggingFace Spaces
Server for using HuggingFace Spaces, supporting Images, Audio, Text and more. Claude Desktop mode for ease-of-use.
Google Cloud Run
Official MCP Server to deploy to Google Cloud Run.
Realize MCP - Taboola
Interact with the Taboola advertising platform using natural language via the Taboola Realize API.
Aiven
Navigate your Aiven projects and interact with the PostgreSQL®, Apache Kafka®, ClickHouse® and OpenSearch® services
ElevenLabs
Text-to-speech integration using the ElevenLabs API.
GCP MCP Server
Manage and interact with Google Cloud Platform (GCP) resources through an AI assistant.
Remote MCP Server on Cloudflare
A self-hostable MCP server for Cloudflare Workers with OAuth login support, using Cloudflare KV for storage.
OpenRouter
Integrate with OpenRouter.ai's diverse ecosystem of AI models. Requires an OpenRouter API key.
Bybit MCP Server
Access Bybit's v5 API for real-time market data, trading operations, and account information.
OpenAI
A bridge to OpenAI's Chat Completion and Assistants APIs.