by lishenxydlgzs
Executes AWS Athena SQL queries via a Model Context Protocol server and returns results directly to AI assistants.
Aws Athena MCP provides a lightweight MCP server that enables AI assistants to run SQL queries against Amazon Athena databases and retrieve the results. It abstracts credential handling, S3 result storage, and query lifecycle management so that downstream tools can focus on natural‑language interactions.
AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
, etc.), or an IAM role.run_query
, get_status
, get_result
, list_saved_queries
, run_saved_query
) from your AI assistant or any MCP‑compatible client.{
"mcpServers": {
"athena": {
"command": "npx",
"args": ["-y", "@lishenxydlgzs/aws-athena-mcp"],
"env": {
"OUTPUT_S3_PATH": "s3://your-bucket/athena-results/",
"AWS_REGION": "us-east-1",
"AWS_PROFILE": "default",
"AWS_ACCESS_KEY_ID": "<YOUR_ACCESS_KEY>",
"AWS_SECRET_ACCESS_KEY": "<YOUR_SECRET_KEY>",
"AWS_SESSION_TOKEN": "<YOUR_SESSION_TOKEN>",
"ATHENA_WORKGROUP": "default_workgroup",
"QUERY_TIMEOUT_MS": "300000",
"MAX_RETRIES": "100",
"RETRY_DELAY_MS": "500"
}
}
}
}
queryExecutionId
on timeout.npx
.Q: Do I need to install anything locally?
A: No. The server runs with npx
which downloads the package at runtime.
Q: What S3 bucket is required?
A: Athena writes query results to the bucket defined in OUTPUT_S3_PATH
. The bucket must be in the same region and grant the executing IAM role write access.
Q: How are credentials supplied? A: Via standard AWS mechanisms – CLI config, environment variables, or the IAM role of the host instance.
Q: What is the maximum number of rows returned? A: By default 1,000 rows; the tool caps at 10,000 rows per request.
Q: Can I change the default workgroup?
A: Set ATHENA_WORKGROUP
in the environment to any workgroup you have permission to use.
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.
Configure AWS credentials using one of the following methods:
AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
)Add the server to your MCP configuration:
{
"mcpServers": {
"athena": {
"command": "npx",
"args": ["-y", "@lishenxydlgzs/aws-athena-mcp"],
"env": {
// Required
"OUTPUT_S3_PATH": "s3://your-bucket/athena-results/",
// Optional AWS configuration
"AWS_REGION": "us-east-1", // Default: AWS CLI default region
"AWS_PROFILE": "default", // Default: 'default' profile
"AWS_ACCESS_KEY_ID": "", // Optional: AWS access key
"AWS_SECRET_ACCESS_KEY": "", // Optional: AWS secret key
"AWS_SESSION_TOKEN": "", // Optional: AWS session token
// Optional server configuration
"ATHENA_WORKGROUP": "default_workgroup", // Optional: specify the Athena WorkGroup
"QUERY_TIMEOUT_MS": "300000", // Default: 5 minutes (300000ms)
"MAX_RETRIES": "100", // Default: 100 attempts
"RETRY_DELAY_MS": "500" // Default: 500ms between retries
}
}
}
}
run_query
: Execute a SQL query using AWS Athena
get_status
: Check the status of a query execution
get_result
: Retrieve results for a completed query
list_saved_queries
: List all saved (named) queries in Athena.
Returns:
id
, name
, and optional description
ATHENA_WORKGROUP
and AWS_REGION
run_saved_query: Run a previously saved query by its ID.
Parameters:
namedQueryId
: ID of the saved querydatabaseOverride
: Optional override of the saved query's default databasemaxRows
: Maximum number of rows to return (default: 1000)timeoutMs
: Timeout in milliseconds (default: 60000)Returns:
run_query
: full results or execution IDMessage to AI Assistant:
List all databases in Athena
MCP parameter:
{
"database": "default",
"query": "SHOW DATABASES"
}
Message to AI Assistant:
Show me all tables in the default database
MCP parameter:
{
"database": "default",
"query": "SHOW TABLES"
}
Message to AI Assistant:
What's the schema of the asin_sitebestimg table?
MCP parameter:
{
"database": "default",
"query": "DESCRIBE default.asin_sitebestimg"
}
Message to AI Assistant:
Show some rows from my_database.mytable
MCP parameter:
{
"database": "my_database",
"query": "SELECT * FROM my_table LIMIT 10",
"maxRows": 10
}
Message to AI Assistant:
Find the average price by category for in-stock products
MCP parameter:
{
"database": "my_database",
"query": "SELECT category, COUNT(*) as count, AVG(price) as avg_price FROM products WHERE in_stock = true GROUP BY category ORDER BY count DESC",
"maxRows": 100
}
{
"queryExecutionId": "12345-67890-abcdef"
}
{
"queryExecutionId": "12345-67890-abcdef",
"maxRows": 10
}
{
"name": "list_saved_queries",
"arguments": {}
}
{
"name": "run_saved_query",
"arguments": {
"namedQueryId": "abcd-1234-efgh-5678",
"maxRows": 100
}
}
ATHENA_WORKGROUP
and AWS_REGION
MIT
Please log in to share your review and rating for this MCP.
{ "mcpServers": { "athena": { "command": "npx", "args": [ "-y", "@lishenxydlgzs/aws-athena-mcp" ], "env": { "OUTPUT_S3_PATH": "s3://your-bucket/athena-results/", "AWS_REGION": "us-east-1", "AWS_PROFILE": "default", "AWS_ACCESS_KEY_ID": "<YOUR_ACCESS_KEY>", "AWS_SECRET_ACCESS_KEY": "<YOUR_SECRET_KEY>", "AWS_SESSION_TOKEN": "<YOUR_SESSION_TOKEN>", "ATHENA_WORKGROUP": "default_workgroup", "QUERY_TIMEOUT_MS": "300000", "MAX_RETRIES": "100", "RETRY_DELAY_MS": "500" } } } }
Explore related MCPs that share similar capabilities and solve comparable challenges
by antvis
Offers over 25 AntV chart types for automated chart generation and data analysis, callable via MCP tools, CLI, HTTP, SSE, or streamable transports.
by reading-plus-ai
A versatile tool that enables interactive data exploration through prompts, CSV loading, and script execution.
by Canner
Provides a semantic engine that lets MCP clients and AI agents query enterprise data with contextual understanding, precise calculations, and built‑in governance.
by surendranb
Provides natural‑language access to Google Analytics 4 data via MCP, exposing over 200 dimensions and metrics for Claude, Cursor and other compatible clients.
by ergut
Provides secure, read‑only access to BigQuery datasets, allowing large language models to query and analyze data through a standardized interface.
by isaacwasserman
Provides an interface for LLMs to visualize data using Vega‑Lite syntax, supporting saving of data tables and rendering visualizations as either a full Vega‑Lite specification (text) or a base64‑encoded PNG image.
by vantage-sh
Fetch and explore cloud cost and usage data from a Vantage account using natural language through AI assistants and MCP clients.
by acryldata
Provides a Model Context Protocol server that enables searching, metadata retrieval, lineage traversal, and SQL query listing for DataHub entities.
by rishijatia
Provides programmatic access to Fantasy Premier League statistics, team information, gameweeks, and analysis tools via a Model Context Protocol server.