awslabs.cloudtrail-mcp-server
v0.1.2An AWS Labs Model Context Protocol (MCP) server for cloudtrail
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
lookup_events
Look up CloudTrail events based on various criteria. This tool searches CloudTrail events using the LookupEvents API, which provides access to the last 90 days of management events. You can filter by time range and search for specific attribute values. Usage: Use this tool to find CloudTrail events by various attributes like username, event name, resource name, etc. This is useful for security investigations, troubleshooting, and audit trails. IMPORTANT PAGINATION REQUIREMENTS: - AWS CloudTrail requires pagination tokens to be used wit…
| Parameter | Type | Description |
|---|---|---|
attribute_key | Attribute to search by | |
attribute_value | Value to search for in the specified attribute | |
end_time | End time for event lookup (ISO format or relative like "1 hour ago"). IMPORTANT: When using pagination (next_token), you must provide the exact same end_time as the original request. | |
max_results | Maximum number of events to return (1-50, default: 10) | |
next_token | Token for pagination to fetch the next page of events. IMPORTANT: When using this token, all other parameters (start_time, end_time, attribute_key, attribute_value) must match exactly the original req… | |
region | string | AWS region to query. Defaults to us-east-1. |
start_time | Start time for event lookup (ISO format or relative like "1 day ago"). IMPORTANT: When using pagination (next_token), you must provide the exact same start_time as the original request. |
lake_query
Execute a SQL query against CloudTrail Lake for complex analytics and filtering. CloudTrail Lake allows you to run SQL queries against your CloudTrail events for advanced analysis. This is more powerful than the basic lookup functions and allows for complex filtering, aggregation, and analysis. PAGINATION WORKFLOW: For large result sets, you have two options: 1. Use wait_for_completion=False to get the query_id immediately, then use get_query_results with pagination 2. Use wait_for_completion=True (default) to get first page of results,…
| Parameter | Type | Description |
|---|---|---|
sql * | string | SQL query to execute against CloudTrail Lake. IMPORTANT: You must include a valid Event Data Store (EDS) ID in the FROM clause of your SQL query. Use list_event_data_stores tool to get available EDS I… |
region | string | AWS region to query. Defaults to us-east-1. |
wait_for_completion | boolean | Whether to wait for query completion and return results. If False, returns immediately with query_id for manual result fetching using get_query_results. Default: True |
get_query_status
Get the status of a CloudTrail Lake query. This tool checks the status of a previously started CloudTrail Lake query. Use this when you need to check if a long-running query has completed or if you want to get details about query execution. Usage: Use this tool to monitor the progress of CloudTrail Lake queries, especially long-running ones that may take time to complete. Returns: -------- QueryStatus containing: - query_id: The query identifier - query_status: Current status (QUEUED, RUNNING, FINISHED,…
| Parameter | Type | Description |
|---|---|---|
query_id * | string | The ID of the query to check status for |
region | string | AWS region to query. Defaults to us-east-1. |
get_query_results
Get the results of a completed CloudTrail Lake query with pagination support. This tool retrieves the results of a previously executed CloudTrail Lake query. It supports pagination for large result sets, allowing you to fetch results in chunks. Usage: Use this tool to get the results of a query that has completed (status = 'FINISHED'). For large result sets, use the next_token to fetch subsequent pages of results. Pagination workflow: 1. Call get_query_results with just the query_id to get the first page 2. If next_token is returned, c…
| Parameter | Type | Description |
|---|---|---|
query_id * | string | The ID of the query to get results for |
max_results | Maximum number of results to return per page (1-50, default: 50) | |
next_token | Token for pagination to fetch the next page of results. Use the next_token returned from a previous call to get successive pages. | |
region | string | AWS region to query. Defaults to us-east-1. |
list_event_data_stores
List available CloudTrail Lake Event Data Stores with their capabilities and event selectors. Event Data Stores are the storage and query engines for CloudTrail Lake. This tool helps you understand which Event Data Stores are available and their configurations. Usage: Use this tool to understand which Event Data Stores are available and their configurations. This information is needed when executing CloudTrail Lake queries. Returns: -------- List of available Event Data Stores with their configurations
| Parameter | Type | Description |
|---|---|---|
include_details | boolean | Whether to include detailed event selector information (default: true) |
region | string | AWS region to query. Defaults to us-east-1. |