home / mcp / aws athena mcp server
Provides an MCP interface to AWS Athena for executing queries, discovering schemas, and managing query results.
Configuration
View docs{
"mcpServers": {
"colemurray-aws-athena-mcp": {
"command": "uv",
"args": [
"tool",
"run",
"aws-athena-mcp"
],
"env": {
"AWS_REGION": "us-east-1",
"ATHENA_WORKGROUP": "primary",
"ATHENA_TIMEOUT_SECONDS": "60",
"ATHENA_S3_OUTPUT_LOCATION": "s3://your-bucket/athena-results/"
}
}
}
}You have a lightweight MCP server that lets you run SQL queries against AWS Athena, discover schemas, and manage query executions through a consistent programmatic interface. Itβs fast to set up, type-safe, and async-friendly, making it easy to integrate Athena-backed data into your tools and workflows.
You connect to the MCP server from an MCP client and issue tools to run queries, fetch results, and inspect schemas. The server exposes tools for executing SQL, checking status, retrieving results, listing tables in a database, and describing table schemas. Start the server using one of the supported runtime commands, then point your MCP client at the running process. Typical usage patterns include launching a long-running query, polling for status, and streaming results as they become available.
Prerequisites: you need Python installed and, optionally, the uv, uvx, or npx tool ecosystems available depending on how you want to run the server.
# From PyPI with uv (recommended for Claude Desktop)
uv tool install aws-athena-mcp
# From PyPI with pip
pip install aws-athena-mcp
# Or from source
git clone https://github.com/ColeMurray/aws-athena-mcp
cd aws-athena-mcp
pip install -e .Configure environment variables to enable Athena access and set basic behavior. The required setting is the location for Athena query results, with optional defaults for region, workgroup, and timeout.
export ATHENA_S3_OUTPUT_LOCATION=s3://your-bucket/athena-results/
export AWS_REGION=us-east-1
export ATHENA_WORKGROUP=primary
export ATHENA_TIMEOUT_SECONDS=60Choose one of the following runtime methods to start the MCP server after youβve installed and configured it.
# Start the MCP server (if installed with uv tool install)
aws-athena-mcp
# Or run directly with uv (without installing)
uv tool run aws-athena-mcp
# Or run directly with uvx (without installing)
uvx aws-athena-mcp
# Or run directly with Python
python -m athena_mcp.serverIf you use Claude Desktop, configure an MCP server entry so Claude can talk to the AWS Athena MCP server.
{
"mcpServers": {
"aws-athena-mcp": {
"command": "uvx",
"args": [
"tool",
"run",
"aws-athena-mcp"
],
"env": {
"ATHENA_S3_OUTPUT_LOCATION": "s3://your-bucket/athena-results/",
"AWS_REGION": "us-east-1",
"ATHENA_WORKGROUP": "primary",
"ATHENA_TIMEOUT_SECONDS": "60"
}
}
}
}Configure AWS credentials so the MCP server can access Athena and S3. Use environment variables, AWS CLI configuration, or an AWS profile.
# Option 1: Environment variables
export AWS_ACCESS_KEY_ID=your-access-key
export AWS_SECRET_ACCESS_KEY=your-secret-key
# Option 2: AWS CLI
aws configure
# Option 3: AWS Profile
export AWS_PROFILE=your-profileProtect the MCP server from unauthorized access, use TLS for communications, and consider VPC endpoints for AWS services in production. Apply least-privilege IAM policies to ensure only needed actions are allowed.
If you encounter configuration or credentials issues, verify the required environment variable is set and that your AWS credentials have the needed permissions for Athena and S3.
# Common checks
echo $ATHENA_S3_OUTPUT_LOCATION
aws sts get-caller-identityThe server provides tools to execute queries and discover schemas.
Execute SQL queries against Athena and return results.
Check the status of an in-flight or completed query.
Retrieve results for a finished query execution.
List all tables in a given database.
Describe the schema of a specific table.