Log-Analyzer-with-MCP: Instructions file for Codex

AGENTS.md

Log-Analyzer-with-MCP AGENTS.md is an instructions file for Codex, OpenCode from awslabs/Log-Analyzer-with-MCP. It costs 2,130 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for an MCP server that lets AI assistants search and analyze AWS CloudWatch Logs, which are records produced by applications and cloud services. They cover setup, commands, testing, and code-quality checks.

In plain words
What is it for?
Running the server locally or through uvx, searching log groups, checking code with Ruff, and testing or formatting changes.
Why use it?
They give contributors a reliable way to install, run, validate, and maintain the log-analysis server.

Instructions file for CodexOpenCode ✓ vendor

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is awslabs/Log-Analyzer-with-MCP's own configuration. It tells Codex and OpenCode how to work on Log-Analyzer-with-MCP itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Log-Analyzer-with-MCP configures →

About the project

Log Analyzer with MCP is a Model Context Protocol server that lets AI assistants access and analyze AWS CloudWatch Logs. It supports browsing log groups, searching with CloudWatch Logs Insights, summarizing logs, finding error patterns, and correlating events across AWS services. The catalogue add-ons provide instructions for using this server with coding agents.

awslabs/Log-Analyzer-with-MCP · 167 stars · on GitHub

Reuse

Borrowing it

Nothing to install: this file belongs to awslabs/Log-Analyzer-with-MCP. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/awslabs/Log-Analyzer-with-MCP/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/awslabs/Log-Analyzer-with-MCP

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Log-Analyzer-with-MCP AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/awslabs/log-analyzer-with-mcp/agents-md.svg)](https://agentmods.dev/instructions/awslabs/log-analyzer-with-mcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/awslabs/log-analyzer-with-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/awslabs/log-analyzer-with-mcp/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,130 This file is loaded in full into every session.
When invoked 2,130 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02130 $0.02130
Opus 5 $0.01065 $0.01065
Sonnet 5 $0.00426 $0.00426
Haiku 4.5 $0.00213 $0.00213

Measured 7d ago against content hash 636d5f1a4934, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

Log-Analyzer-with-MCP AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 290 lines

How it starts

The opening of the file, as written. The whole thing — 290 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

This file provides guidance for AI coding agents working with this codebase.

Project Overview

Log-Analyzer-with-MCP is an MCP (Model Context Protocol) server providing AI assistants access to AWS CloudWatch Logs for searching, analysis, and cross-service correlation.

Tech Stack: Python 3.12+, uv (package manager), FastMCP, boto3, ruff

Build & Development Commands

# Installation
uv sync                      # Install all dependencies
source .venv/bin/activate    # Activate virtual environment

# Running the Server (local development)
python -m cw_mcp_server.server [--profile PROFILE] [--region REGION] [--stateless]
uv run python -m cw_mcp_server.server  # Alternative

# Via uvx (recommended for users)
uvx --from git+https://github.com/awslabs/Log-Analyzer-with-MCP cw-mcp-server [--profile PROFILE] [--region REGION] [--stateless]

# Linting & Formatting (run before committing)
pre-commit run --all-files   # Preferred - runs ruff lint and format
ruff check --fix .           # Lint with auto-fix
ruff format .                # Format code

# Manual Testing (no pytest configured yet)
python src/client.py list-groups [--prefix PREFIX]
python src/client.py search LOG_GROUP "query" [--hours N]
python src/client.py find-errors LOG_GROUP

Code Style Guidelines

File Headers

All Python files must start with the Apache-2.0 license header:

#!/usr/bin/env python3

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

Import Order (ruff-enforced)

  1. Standard library imports
  2. Third-party imports (boto3, mcp, etc.)
  3. Local imports (relative imports with .)
import asyncio
import json
from typing import List, Optional, Callable

import boto3
from mcp.server.fastmcp import FastMCP

from .tools.search_tools import CloudWatchLogsSearchTools

Type Hints

Use type hints consistently. For Python 3.12+, prefer modern syntax but the codebase currently uses typing module imports for compatibility:

async def search_logs(
    self,
    log_group_name: str,
    query: str,
    hours: int = 24,
    start_time: str = None,
    end_time: str = None,
) -> str:

Read the full file on GitHub · 290 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 290 lines · 2,130 tokens per session scan A 636d5f1a4934

Subscribe to this mod's changes

Log-Analyzer-with-MCP AGENTS.md is an instructions file published in the GitHub repository awslabs/Log-Analyzer-with-MCP (167 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 2,130 tokens to every session, about $0.0106 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories