AWS Athena MCP Server

io.github.colemurray/aws-athena-mcp

Overview

A simple, clean stdio MCP server for AWS Athena integration, including SQL query execution, query status/results retrieval, and schema discovery.

Documentation

Overview

AWS Athena MCP Server is a stdio Model Context Protocol server for AWS Athena. It lets MCP clients execute Athena SQL queries, check query status, fetch completed results, list tables, and describe table schemas.

Install and launch

Recommended Claude Desktop launch uses uvx:

{
  "command": "uvx",
  "args": ["aws-athena-mcp"],
  "env": {
    "ATHENA_S3_OUTPUT_LOCATION": "",
    "AWS_REGION": "us-east-1",
    "ATHENA_WORKGROUP": "primary",
    "ATHENA_TIMEOUT_SECONDS": "60"
  }
}

The README also documents uv tool install aws-athena-mcp, pip install aws-athena-mcp, aws-athena-mcp, uv tool run aws-athena-mcp, and python -m athena_mcp.server.

Configuration

ATHENA_S3_OUTPUT_LOCATION is required and must be an s3:// path. Optional server configuration includes AWS_REGION (default us-east-1), ATHENA_WORKGROUP (unset by source default; examples use primary), and ATHENA_TIMEOUT_SECONDS (default 60, positive integer). AWS credentials are resolved by boto3 via environment variables, AWS CLI configuration/profiles, IAM roles, or temporary credentials.

Capabilities

Tools reviewed from README, API docs, and source:

  • run_query(database, query, max_rows=1000) executes SQL against Athena and returns results or a query execution ID on timeout.
  • get_status(query_execution_id) checks query execution state.
  • get_result(query_execution_id, max_rows=1000) retrieves completed query results.
  • list_tables(database) lists Athena tables in a database.
  • describe_table(database, table_name) returns table schema details.

Prerequisites and permissions

Requires Python 3.10+, uv/uvx or pip, an AWS account with Athena, an S3 output location, and AWS credentials. Minimum permissions documented include Athena StartQueryExecution/GetQueryExecution/GetQueryResults/ListWorkGroups/GetWorkGroup, S3 GetObject/PutObject/DeleteObject/ListBucket for the output location, and Glue GetDatabase/GetDatabases/GetTable/GetTables.

Limitations and security notes

The server runs with stdio transport only. Athena service limits apply, including default query concurrency limits. Query waits are bounded by ATHENA_TIMEOUT_SECONDS; timed-out queries return an execution ID for later polling. max_rows is limited to 1-10000 in source. Query text larger than 100KB is rejected, and the source blocks several dangerous SQL patterns and sanitizes database/table identifiers. Users should use least-privilege IAM and avoid committing credentials.