About AWS Bedrock Logs MCP
AWS Bedrock Logs MCP is an MCP server for analyzing Bedrock invocation logs and usage through CloudWatch Logs. It is intended for teams monitoring model, user, token, and daily usage with natural-language queries.
Key features
- 01Retrieve raw invocation logs
- 02Group usage statistics by model
- 03Analyze usage by user
- 04Review daily usage and trends
- 05Track input and output tokens
Use cases
- 01Review recent Bedrock model usage
- 02Compare token consumption across models
- 03Identify users with high token usage
- 04Track daily invocation trends
MCP support
The MCP server exposes CloudWatch Logs-backed tools for retrieving Bedrock invocation logs and usage statistics to MCP clients. Claude can query this data using natural language.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEAWS Bedrock Logs MCP
A command-line interface and API for analyzing AWS Bedrock usage and logs through Anthropic's MCP (Model Control Protocol).
Overview
This tool provides a convenient way to analyze AWS Bedrock model invocation logs using Anthropic's Claude model as an interactive interface. It functions as an MCP server that exposes AWS CloudWatch Logs API functionality to Claude, allowing you to query and analyze your Bedrock usage data in natural language.
Features
- Model Usage Analysis: View detailed statistics about Bedrock model usage and token consumption
- User-based Analytics: Analyze usage patterns and costs by user
- Daily Usage Reports: Track daily usage trends and model invocations
- Token Consumption Metrics: Monitor input, completion, and total token usage
- Interactive Interface: Use Claude to query your Bedrock usage data through natural language
Requirements
- Python 3.13+
- AWS credentials with CloudWatch Logs access
- Anthropic API access (for Claude integration)
Installation
-
Install
uv:# On macOS and Linux curl -LsSf https://astral.sh/uv/install.sh | sh# On Windows powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" -
Clone this repository:
git clone https://github.com/dheerajoruganty/aws-bedrock-logs-mcp-server.git cd aws-bedrock-logs-mcp-server -
Set up the Python virtual environment and install dependencies:
uv venv && source .venv/bin/activate && uv pip sync pyproject.tomlFor Windows:
uv venv && .venv\Scripts\activate && uv pip sync pyproject.toml -
Configure your AWS credentials:
mkdir -p ~/.aws # Set up your credentials in ~/.aws/credentials and ~/.aws/config
Usage
Starting the Server
Run the server using:
python cloudwatch_mcp_server.py
By default, the server uses stdio transport for communication with MCP clients.
Claude Desktop Configuration
Configure this tool with Claude Desktop:
{
"mcpServers": {
"aws_bedrock_logs": {
"command": "uv",
"args": [
"--directory",
"/path/to/aws-bedrock-logs-mcp",
"run",
"cloudwatch_mcp_server.py"
]
}
}
}
Make sure to replace the directory path with the actual path to your repository on your system.
Available Tools
The server exposes the following tools that Claude can use:
get_bedrock_logs_df: Retrieve raw Bedrock invocation logs as a pandas DataFrameget_model_usage_stats: Get usage statistics grouped by modelget_user_usage_stats: Get usage statistics grouped by userget_daily_usage_stats: Get daily usage statistics and trends
Example Queries
Once connected to Claude through an MCP-enabled interface, you can ask questions like:
- "Show me the Bedrock usage stats for the last 7 days"
- "What's the average token consumption by model?"
- "Who are the top users of Bedrock in terms of total tokens?"
- "Give me a daily breakdown of model invocations"
Development
Project Structure
cloudwatch_mcp_server.py: Main server implementation with MCP toolspyproject.toml: Project dependencies and metadataDockerfile: Container definition for deployments
Dependencies
Key dependencies include:
boto3: AWS SDK for Pythonmcp[cli]: Anthropic's Model Control Protocolpandas: Data manipulation and analysispydantic: Data validation using Python type annotations
License
Acknowledgments
- This tool uses Anthropic's MCP framework
- Powered by AWS CloudWatch Logs API
- Built with FastMCP for server implementation
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.