# AWS CloudTrail

AWS CloudTrail lets an agent search CloudTrail events and run SQL against CloudTrail Lake to trace API calls and user activity.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 9939 repo stars
- Author: awslabs
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/awslabs/mcp/tree/HEAD/src/cloudtrail-mcp-server
- Updated: 2026-10-23
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/aws-cloudtrail

## What it does

One server from the `awslabs/mcp` collection, five tools. `lookup_events` takes a username, event name or resource and returns management events from the past 90 days, paged. `lake_query` runs Trino-style SQL over CloudTrail Lake, with `get_query_status` and `get_query_results` for long jobs. `list_event_data_stores` shows which event data stores the account holds.

You need an AWS account where CloudTrail is on, plus credentials the server can pick up. `aws configure` writes them, environment variables work too. Event history records by default; Lake is a separate switch you turn on yourself. The IAM policy has to allow `cloudtrail:LookupEvents`, `cloudtrail:ListEventDataStores`, `cloudtrail:GetEventDataStore`, `cloudtrail:StartQuery`, `cloudtrail:DescribeQuery` and `cloudtrail:GetQueryResults`. Drop one and the matching tool fails with an access error.

Two install paths. The uvx route needs `uv` and Python 3.10 through `uv python install 3.10`; the MCP entry then calls `uvx` with `awslabs.cloudtrail-mcp-server@latest` and an `AWS_PROFILE` value. The other route builds a Docker image from `src/cloudtrail-mcp-server/`. Either way the process stays on your own machine, next to the client.

## Requirements
- Needs: Docker
- Works with: AWS

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- find who deleted an IAM role in the last 90 days of events
- count `AssumeRole` calls per user with a Lake query
- check what an access key did before a security group change
- list event data stores to see which audit data is queryable
- trace one user's activity across AWS services

## Example prompts
- Look up every `DeleteRole` event from the last 90 days and tell me which user made each call.
- Run a `lake_query` that groups `AssumeRole` calls by user.
- Check the status of my CloudTrail Lake query and pull the results.

## Similar
- [aws-cloudtrail](https://affpapa.org/en/nevibecode/skills/aws-cloudtrail.md) — skill · 376 installs
- [setting-up-cloudtrail-multi-region](https://affpapa.org/en/nevibecode/skills/setting-up-cloudtrail-multi-region.md) — skill · 6900 installs
- [syslog-and-cloudtrail-stream-parsers](https://affpapa.org/en/nevibecode/skills/syslog-and-cloudtrail-stream-parsers.md) — skill · ★ 73 repo stars
- [aws-cloudwatch-investigation](https://affpapa.org/en/nevibecode/skills/aws-cloudwatch-investigation.md) — skill · 43 installs
- [querying-aws-cloudwatch](https://affpapa.org/en/nevibecode/skills/querying-aws-cloudwatch.md) — skill · 6400 installs
- [aws-security-review](https://affpapa.org/en/nevibecode/skills/aws-security-review.md) — skill · 251 installs

From the same set: [awslabs/mcp](https://affpapa.org/en/nevibecode/by/awslabs/mcp.md) — 36 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
