aws-athena-mcp logo

aws-athena-mcp

by lishenxydlgzs

A Model Context Protocol (MCP) server for running AWS Athena queries. This server enables AI assistants to execute SQL queries against your AWS Athena databases and retrieve results.

View on GitHub

Last updated: N/A

What is aws-athena-mcp?

The aws-athena-mcp server is a Model Context Protocol (MCP) server designed to allow AI assistants to execute SQL queries against AWS Athena databases and retrieve the results. It provides a set of tools for running queries, checking query status, retrieving results, listing saved queries, and running saved queries.

How to use aws-athena-mcp?

  1. Configure AWS credentials (AWS CLI, environment variables, or IAM role). 2. Add the server to your MCP configuration with the necessary environment variables (OUTPUT_S3_PATH, AWS_REGION, etc.). 3. Use the provided tools (run_query, get_status, get_result, list_saved_queries, run_saved_query) with appropriate parameters to interact with your Athena databases.

Key features of aws-athena-mcp

  • Execute SQL queries against AWS Athena

  • Retrieve query results

  • Check query status

  • List saved queries

  • Run saved queries

  • Configurable query timeout and retry mechanism

  • Supports different AWS credential configurations

Use cases of aws-athena-mcp

  • Allow AI assistants to answer questions based on data in Athena

  • Enable automated data analysis and reporting

  • Integrate Athena queries into AI-powered workflows

  • Provide a natural language interface to Athena data

FAQ from aws-athena-mcp

What AWS permissions are required?

The server requires AWS credentials with appropriate Athena and S3 permissions.

Where are the query results stored?

Query results are stored in an S3 bucket specified by the OUTPUT_S3_PATH environment variable.

What happens if a query times out?

If a query times out, the run_query tool returns the queryExecutionId, allowing you to check the status and retrieve results later.

How do I specify the Athena WorkGroup?

You can specify the Athena WorkGroup using the ATHENA_WORKGROUP environment variable.

What is the default timeout for queries?

The default timeout for queries is 5 minutes (300000ms), configurable via the QUERY_TIMEOUT_MS environment variable.