Cover image
Try Now
2025-03-11

3 years

Works with Finder

1

Github Watches

1

Github Forks

0

Github Stars

AWS 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

  1. 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"
    
  2. Clone this repository:

    git clone https://github.com/dheerajoruganty/aws-bedrock-logs-mcp-server.git
    cd aws-bedrock-logs-mcp-server
    
  3. Set up the Python virtual environment and install dependencies:

    uv venv && source .venv/bin/activate && uv pip sync pyproject.toml
    

    For Windows:

    uv venv && .venv\Scripts\activate && uv pip sync pyproject.toml
    
  4. 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:

  1. get_bedrock_logs_df: Retrieve raw Bedrock invocation logs as a pandas DataFrame
  2. get_model_usage_stats: Get usage statistics grouped by model
  3. get_user_usage_stats: Get usage statistics grouped by user
  4. get_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 tools
  • pyproject.toml: Project dependencies and metadata
  • Dockerfile: Container definition for deployments

Dependencies

Key dependencies include:

  • boto3: AWS SDK for Python
  • mcp[cli]: Anthropic's Model Control Protocol
  • pandas: Data manipulation and analysis
  • pydantic: Data validation using Python type annotations

License

MIT License

Acknowledgments

  • This tool uses Anthropic's MCP framework
  • Powered by AWS CloudWatch Logs API
  • Built with FastMCP for server implementation

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • OffchainLabs
  • Go implementation of Ethereum proof of stake

  • huahuayu
  • A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.

  • deemkeen
  • control your mbot2 with a power combo: mqtt+mcp+llm

    Reviews

    5 (1)
    Avatar
    user_yCW6A48T
    2025-04-16

    I've been using aws-bedrock-logs-mcp-server by dheerajoruganty, and it has significantly streamlined our log management process. Its seamless integration and robust performance have made it an indispensable tool in our AWS infrastructure. Highly recommend it for anyone looking to enhance their server logging capabilities! Check it out on GitHub.