CloudWatch Logs MCP Server
CloudWatch Logs MCP 服务器
一个 MCP(模型上下文协议)服务器,提供用于访问 AWS CloudWatch 日志的工具。该服务器允许 AI 助手列出日志组并从 AWS CloudWatch 读取日志条目。
可用工具
列表组
列出可用的 CloudWatch 日志组。
参数:
prefix(可选):日志组名称前缀region(可选):AWS 区域accessKeyId(可选):AWS 访问密钥 IDsecretAccessKey(可选):AWS 秘密访问密钥sessionToken(可选):AWS 会话令牌
**返回:**带有日志组列表的 JSON 字符串,包括logGroupName 、 creationTime和storedBytes 。
获取日志
从特定日志组获取 CloudWatch 日志。
参数:
logGroupName(必需):日志组的名称logStreamName(可选):日志流的名称startTime(可选):ISO 格式或相对时间的开始时间(例如“5m”、“1h”、“1d”)endTime(可选):ISO 格式的结束时间filterPattern(可选):日志的过滤模式region(可选):AWS 区域accessKeyId(可选):AWS 访问密钥 IDsecretAccessKey(可选):AWS 秘密访问密钥sessionToken(可选):AWS 会话令牌
**返回:**带有日志事件的 JSON 字符串,包括timestamp 、 message和logStreamName 。
Related MCP server: CloudWatch MCP Server
设置
AWS 凭证
确保已配置 AWS 凭证。您可以使用 AWS CLI 或通过设置环境变量来设置它们:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY
与 Claude Desktop 一起使用
将以下内容添加到您的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
如果您希望在 Docker 容器中运行服务器,则可以设置 Dockerfile 并使用以下配置:
{
"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>",
}
}
}
}实现细节
此服务器使用 MCP SDK 中的 FastMCP 类构建,该类提供了一种创建 MCP 服务器的简便方法。该服务器公开了两个主要工具:
list_groups:列出可用的 CloudWatch 日志组get_logs:从特定日志组读取日志条目
每个工具都实现为一个用@mcp.tool()修饰的异步函数。服务器使用 boto3 库与 AWS CloudWatch Logs API 进行交互。
执照
麻省理工学院
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides AI assistants access to AWS CloudWatch Logs, enabling browsing, searching, summarizing, and correlating logs across multiple AWS services.167Apache 2.0- FlicenseNot gradedqualityDmaintenanceA simplified MCP server that provides a streamlined way to interact with AWS CloudWatch resources (log groups, log queries, and alarms) through the MCP protocol.5
- FlicenseNot gradedqualityFmaintenanceAn MCP server that enables AI assistants to query and analyze logs from Grafana Loki using LogQL, supporting label discovery and keyword search.4
- FlicenseNot gradedqualityDmaintenanceAn MCP server on AWS Lambda that gives AI assistants read-only access to SQS dead-letter queues and CloudWatch logs for fast incident triage.
Related MCP Connectors
An MCP server that integrates with Discord to provide AI-powered features.
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/serkanh/cloudwatch-logs-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server