AWS Bedrock Logs MCP

AWS Bedrock Logs MCP

dheerajoruganty

Research & Data
Visit Server

README

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

Recommended Servers

Crypto Price & Market Analysis MCP Server

Crypto Price & Market Analysis MCP Server

A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.

Featured
TypeScript
MCP PubMed Search

MCP PubMed Search

Server to search PubMed (PubMed is a free, online database that allows users to search for biomedical and life sciences literature). I have created on a day MCP came out but was on vacation, I saw someone post similar server in your DB, but figured to post mine.

Featured
Python
dbt Semantic Layer MCP Server

dbt Semantic Layer MCP Server

A server that enables querying the dbt Semantic Layer through natural language conversations with Claude Desktop and other AI assistants, allowing users to discover metrics, create queries, analyze data, and visualize results.

Featured
TypeScript
mixpanel

mixpanel

Connect to your Mixpanel data. Query events, retention, and funnel data from Mixpanel analytics.

Featured
TypeScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python
Nefino MCP Server

Nefino MCP Server

Provides large language models with access to news and information about renewable energy projects in Germany, allowing filtering by location, topic (solar, wind, hydrogen), and date range.

Official
Python
Vectorize

Vectorize

Vectorize MCP server for advanced retrieval, Private Deep Research, Anything-to-Markdown file extraction and text chunking.

Official
JavaScript
Mathematica Documentation MCP server

Mathematica Documentation MCP server

A server that provides access to Mathematica documentation through FastMCP, enabling users to retrieve function documentation and list package symbols from Wolfram Mathematica.

Local
Python
kb-mcp-server

kb-mcp-server

An MCP server aimed to be portable, local, easy and convenient to support semantic/graph based retrieval of txtai "all in one" embeddings database. Any txtai embeddings db in tar.gz form can be loaded

Local
Python
Research MCP Server

Research MCP Server

The server functions as an MCP server to interact with Notion for retrieving and creating survey data, integrating with the Claude Desktop Client for conducting and reviewing surveys.

Local
Python