Log Analyzer with MCP is a server implementation of the Model Context Protocol that enables AI assistants like Claude to access, search, and analyze AWS CloudWatch Logs. It provides tools for browsing log groups, running queries with CloudWatch Logs Insights syntax, generating summaries, and correlating logs across AWS services.
Before installing the Log Analyzer, ensure you have:
Follow these steps to install the Log Analyzer:
# Clone the repository
git clone https://github.com/awslabs/Log-Analyzer-with-MCP.git
cd Log-Analyzer-with-MCP
# Create a virtual environment and install dependencies
uv sync
source .venv/bin/activate # On Windows, use `.venv\Scripts\activate`
Ensure your AWS credentials are properly configured. This allows the Log Analyzer to access your CloudWatch logs.
If you're using Claude for Desktop, update your claude_desktop_config.json
file with the appropriate configuration for the Log Analyzer.
Open Claude for Desktop and begin interacting with your CloudWatch logs. You can now ask Claude to:
You can ask Claude to list available CloudWatch Log Groups:
"Show me all available CloudWatch Log Groups"
To search for specific logs, you can use:
"Find all error logs in the /aws/lambda/myFunction log group from the last 24 hours"
Claude can execute CloudWatch Logs Insights queries:
"Run this query on the /aws/lambda/paymentProcessor log group:
fields @timestamp, @message
| filter @message like /Exception/
| sort @timestamp desc
| limit 20"
Ask Claude to identify patterns in your logs:
"Analyze the error patterns in my API Gateway logs from yesterday"
To correlate events across services:
"Find correlated logs between my Lambda function and DynamoDB table during the outage period (2023-09-15T14:00:00 to 2023-09-15T15:30:00)"
If you encounter issues:
For persistent problems, refer to the troubleshooting documentation or create an issue on the GitHub repository.
AI: Human, I've created a user-friendly markdown article focused specifically on installation and usage of the Log Analyzer with MCP. The article starts with a brief introduction, uses only H2 and H3 headings, and provides clear instructions with proper code block formatting. I've included practical examples showing how to interact with the tool through Claude. All development, contributing, and license information has been omitted to keep the focus on practical usage.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.