Skip to main content
MCP server CX Codex

AWS CloudTrail — Claude Code MCP server: what it does, how to install

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

Apache-2.0 ★ 9,939 updated 2026-10-23

Open on GitHub

What AWS CloudTrail 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.

What it helps with

  • 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 for the agent

  • 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.

How to install AWS CloudTrail

Install

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

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about AWS CloudTrail

How do I install the AWS CloudTrail MCP server in Claude Code?

Install uv, then run uv python install 3.10. Add an MCP entry with command uvx, argument awslabs.cloudtrail-mcp-server@latest, your profile in AWS_PROFILE, and stdio as the transport.

What does this server do?

It hands the agent CloudTrail tooling: event search across 90 days, SQL on CloudTrail Lake with status polling and paged results, plus a listing of event data stores.

Do I need CloudTrail Lake enabled for the SQL tools?

Yes. Turn on CloudTrail Lake and grant cloudtrail:StartQuery, cloudtrail:DescribeQuery and cloudtrail:GetQueryResults. Event lookup still works against the default history.

Similar MCP servers

All MCP servers for Cloud: AWS, Azure, GCP →

From the same set36

The whole set →
Amazon DynamoDB Amazon DynamoDB is an MCP server for designing and validating DynamoDB models, generating resources, analyzing source databases, and estimating operation costs. CX Codex +1 ★ 9,939repo stars AWS Cost Explorer AWS Cost Explorer — an MCP server from the awslabs suite: detailed analysis of AWS spend and reports built on it, so cost questions get answered in chat. CX Codex +1 ★ 9,939repo stars Amazon CloudWatch Amazon CloudWatch connects AI agents to CloudWatch metrics, alarms, and log groups. It speeds up root cause diagnostics across AWS infrastructure. CX Codex +1 ★ 9,939repo stars Amazon CloudWatch Application Signals Amazon CloudWatch Application Signals — an MCP server for application performance monitoring via CloudWatch Application Signals. Gives the agent access to metrics, traces and insights for AWS services. CX Codex +1 ★ 9,939repo stars AWS CloudFormation Controls AWS CloudFormation resources through the Cloud Control API directly inside AI assistants. Helpful when building and managing cloud infrastructure. CX Codex +1 ★ 9,939repo stars AWS Cloud Control API AWS Cloud Control API is an MCP server for Claude Code that manages AWS resources through natural-language requests. It is deprecated and no longer maintained; its authors point to AWS IAC MCP Server for future work. CX Codex +1 ★ 9,939repo stars AWS Billing and Cost Management AWS Billing and Cost Management — an MCP server that lets your coding agent read AWS billing data: costs, budgets, anomalies, commitment discounts and invoices. CX Codex +1 ★ 9,939repo stars AWS Terraform AWS Terraform is an MCP server for Claude Code that provides AWS Infrastructure as Code patterns, applies Terraform best practices, and checks security compliance with Checkov. CX Codex +1 ★ 9,939repo stars

Project sponsors

Companies that keep this analytics open