Athena Investigation MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Athena Investigation MCP ServerSearch access logs for user jdoe and summarize activity by correlation ID."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Athena Investigation MCP Server
A narrow, read-only Model Context Protocol (MCP) server for governed investigations against a fixed Amazon Athena table.
The server intentionally exposes two investigation-oriented tools instead of arbitrary SQL:
search_lake_access_eventssearches exact user, IP, or correlation indicators.summarize_lake_access_correlationaggregates actions and datasets for one exact correlation ID.
This is a reference implementation, not an official AWS or Microsoft product.
Why this design
Giving an AI agent a generic execute_sql tool creates an unnecessarily broad capability. This server keeps the model-facing contract small while AWS remains responsible for authorization and cost controls.
flowchart LR
Client[MCP client] -->|Streamable HTTP + bearer| Server[Athena Investigation MCP]
Server -->|Parameterized queries| Athena[Amazon Athena]
Athena --> Glue[AWS Glue Data Catalog]
Athena --> S3[(Amazon S3)]
Server --> Provenance[Rows + query ID + bytes scanned]MCP is the tool contract. It does not replace AWS IAM, an Athena workgroup, data governance, or a SIEM.
Related MCP server: MCP Athena Analytics Server
Security properties
Exactly two read-only tools are published.
The tools never accept SQL text.
At least one exact indicator is required for event search.
Indicator syntax and IP addresses are validated before Athena is called.
Values are passed through Athena execution parameters.
Requested results are clamped to a server-side maximum.
Query timeout is enforced by the server.
Responses include source, classification, workgroup, query execution ID, bytes scanned, and result count.
HTTP startup fails closed when
MCP_API_KEYis missing or shorter than 32 characters.The container runs as a non-root user.
These controls are only one layer. Deploy with a dedicated AWS principal, a cost-limited Athena workgroup, private S3 buckets, and a reviewed MCP tool allowlist.
Expected Athena schema
The configured table must expose these columns:
Column | Athena type | Purpose |
|
| ISO 8601 event timestamp |
|
| User or workload identity |
|
| IPv4 or IPv6 source indicator |
|
| Observed data-lake action |
|
| Target dataset |
|
| Number of records returned |
|
| Outcome such as |
|
| Investigation correlation identifier |
A synthetic example is available under examples/athena.
Quick start
1. Prepare AWS
Create the table, private data bucket, private query-results bucket, and a dedicated Athena workgroup. Configure a bytes-scanned cutoff on the workgroup.
See AWS setup and the example least-privilege IAM policy.
2. Install
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[test]'3. Configure
export AWS_REGION=us-east-1
export ATHENA_DATABASE=security_lake
export ATHENA_TABLE=access_events
export ATHENA_WORKGROUP=mcp-investigation
export MAX_RESULTS=20
export QUERY_TIMEOUT_SECONDS=15
export SOURCE_NAME=aws-athena
export DATA_CLASSIFICATION=synthetic
export MCP_API_KEY="$(openssl rand -hex 32)"AWS credentials are resolved through the standard boto3 credential chain. Prefer temporary credentials obtained through workload identity or role federation.
4. Run
uvicorn athena_investigation_mcp.app:app \
--host 127.0.0.1 \
--port 8000Endpoints:
MCP:
http://127.0.0.1:8000/mcpHealth:
http://127.0.0.1:8000/health
5. Test
python -m pytest -q
export MCP_URL=http://127.0.0.1:8000/mcp
export MCP_TOKEN="$MCP_API_KEY"
python smoke_test.pySet SMOKE_CORRELATION_ID to execute both tools against configured data.
Container
docker build -t athena-investigation-mcp-server .
docker run --rm -p 8000:8000 \
-e AWS_REGION \
-e ATHENA_DATABASE \
-e ATHENA_TABLE \
-e ATHENA_WORKGROUP \
-e DATA_CLASSIFICATION \
-e MCP_API_KEY \
athena-investigation-mcp-serverUse your platform's workload identity support instead of copying long-lived AWS keys into the image.
MCP client integration
Any Streamable HTTP MCP client can connect to /mcp with:
Authorization: Bearer <MCP_API_KEY>For Microsoft Copilot Studio instructions, see Copilot Studio setup.
Configuration
Variable | Default | Description |
|
| AWS region used by the Athena client |
|
| Glue database identifier |
|
| Fixed table exposed through the tools |
|
| Athena workgroup with enforced controls |
|
| Server-side query timeout |
|
| Athena status polling interval |
|
| Maximum returned rows; range 1–100 |
|
| Provenance value returned to clients |
|
| Classification returned to clients |
| none | Required static bearer token, minimum 32 characters |
|
| Subject metadata for the static verifier |
|
| Client metadata for the static verifier |
Production considerations
The included static bearer verifier is suitable for a controlled reference deployment. For production:
replace static bearer authentication with your organization's supported OAuth/OIDC pattern;
use workload identity and AWS STS temporary credentials;
restrict IAM resources to the exact workgroup, catalog objects, and S3 prefixes;
enforce a bytes-scanned cutoff and query-result encryption in the workgroup;
add network ingress restrictions, WAF/API gateway controls, and centralized audit logs;
review the MCP tool allowlist independently of backend IAM;
treat returned source data as untrusted content;
keep mutating actions in a separate server, identity, and approval flow.
See the complete security model.
Scope and limitations
The table schema is fixed by design.
Multiple supplied search indicators are combined with
OR.Result retrieval is intentionally bounded to one page and the configured maximum.
This server is not a general Athena query interface.
This server does not ingest, detect, correlate continuously, or replace a SIEM.
License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceProvides structured access to OCSF-normalized security data stored in Amazon Security Lake, enabling AI assistants to search for IP addresses, GuardDuty findings, and explore available data sources.2
- FlicenseNot gradedqualityDmaintenanceEnables secure querying of analytics data stored in AWS Athena/S3 through natural language, with multiple security layers including query validation, resource limits, and automatic PII redaction to prevent data breaches and destructive operations.
- FlicenseAqualityDmaintenanceEnables searching and analyzing AWS CloudWatch logs with support for configurable log groups, time-based searches, and service-specific log stream filtering.5
- AlicenseNot gradedqualityBmaintenanceEnables security analysts to investigate Microsoft Entra ID security logs through natural language, exposing read-only tools for user context, sign-ins, risky users, risk detections, directory audits, and conditional access policies.MIT
Related MCP Connectors
Read-only access to Auralogs production logs: search logs, inspect errors, review AI analyses.
A paid remote MCP for AI SDK data query MCP, built to return verdicts, receipts, usage logs, and aud
Query Churn Solution cancellation-flow metrics, revenue, and feedback analytics (read-only).
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/brunofreitas-br/athena-investigation-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server