AWS Athena MCP

io.github.lishenxydlgzs/aws-athena-mcp

Overview

Model Context Protocol server for running AWS Athena SQL queries, checking query status, retrieving results, and working with saved Athena queries.

Documentation

Overview

AWS Athena MCP 1.0.1 is an npm-distributed stdio MCP server for executing SQL queries against AWS Athena databases and returning results to MCP-compatible AI assistants. It can run ad hoc queries, return query execution IDs on timeout, check query status, retrieve completed query results, list saved Athena named queries, and run saved queries by ID.

Installation and transport

The documented MCP client configuration runs the server over stdio with npx:

{
  "mcpServers": {
    "athena": {
      "command": "npx",
      "args": ["-y", "@lishenxydlgzs/[email protected]"],
      "env": {
        "OUTPUT_S3_PATH": "",
        "AWS_REGION": "us-east-1",
        "AWS_PROFILE": "default",
        "AWS_ACCESS_KEY_ID": "",
        "AWS_SECRET_ACCESS_KEY": "",
        "AWS_SESSION_TOKEN": "",
        "ATHENA_WORKGROUP": "",
        "QUERY_TIMEOUT_MS": "300000",
        "MAX_RETRIES": "100",
        "RETRY_DELAY_MS": "500"
      }
    }
  }
}

OUTPUT_S3_PATH is required and should point to an S3 location for Athena results. AWS credentials can come from AWS CLI configuration, AWS environment variables, or an IAM role when running on AWS.

Tools

  • run_query: execute an Athena SQL query for a database. Parameters include database, query, optional maxRows, and source-supported timeoutMs. Returns full results if the query completes before timeout, otherwise returns a queryExecutionId.
  • get_status: check query execution status for a queryExecutionId.
  • get_result: retrieve results for a completed query by queryExecutionId, with optional maxRows.
  • list_saved_queries: list saved Athena named queries.
  • run_saved_query: execute a saved Athena named query by namedQueryId, with optional databaseOverride, maxRows, and timeoutMs.

Requirements and limitations

Requires Node.js >= 16, AWS credentials with Athena and S3 permissions, and an S3 bucket for query results. Saved-query tools require named queries to exist in the configured ATHENA_WORKGROUP and AWS_REGION. Query execution and returned data are governed by the configured AWS identity permissions and Athena/S3 access. The package uses stdio transport; no remote HTTP/SSE endpoint is documented. This submission targets npm package 1.0.1 because saved-query tools are present in 1.0.1 and absent from 1.0.0. QUERY_TIMEOUT_MS, MAX_RETRIES, and RETRY_DELAY_MS are documented in README/smithery config, but inspected 1.0.1 build/athena.js does not read those environment variables; the source uses per-call timeoutMs/default 60000, hardcoded maxAttempts 100, and 1000ms polling delay.