AWS Athena logo

AWS Athena

Community
lishenxydlgzs

MCP server to run AWS Athena queries

Publisherlishenxydlgzs
Repositoryaws-athena-mcp
LanguageJavaScript
Forks
15
Stars
40
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    AWS Athena exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    40 stars and 15 forks from the linked repository.

@lishenxydlgzs/aws-athena-mcp

smithery badge

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.

Usage

  1. Configure AWS credentials using one of the following methods:

    • AWS CLI configuration
    • Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
    • IAM role (if running on AWS)
  2. Add the server to your MCP configuration:

json
{
  "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
      }
    }
  }
}
  1. The server provides the following tools:
  • run_query: Execute a SQL query using AWS Athena

    • Parameters:
      • database: The Athena database to query
      • query: SQL query to execute
      • maxRows: Maximum number of rows to return (default: 1000, max: 10000)
    • Returns:
      • If query completes within timeout: Full query results
      • If timeout reached: Only the queryExecutionId for later retrieval
  • get_status: Check the status of a query execution

    • Parameters:
      • queryExecutionId: The ID returned from run_query
    • Returns:
      • state: Query state (QUEUED, RUNNING, SUCCEEDED, FAILED, or CANCELLED)
      • stateChangeReason: Reason for state change (if any)
      • submissionDateTime: When the query was submitted
      • completionDateTime: When the query completed (if finished)
      • statistics: Query execution statistics (if available)
  • get_result: Retrieve results for a completed query

    • Parameters:
      • queryExecutionId: The ID returned from run_query
      • maxRows: Maximum number of rows to return (default: 1000, max: 10000)
    • Returns:
      • Full query results if the query has completed successfully
      • Error if query failed or is still running
  • list_saved_queries: List all saved (named) queries in Athena.

  • Returns:

    • An array of saved queries with id, name, and optional description
    • Queries are returned from the configured ATHENA_WORKGROUP and AWS_REGION
  • run_saved_query: Run a previously saved query by its ID.

  • Parameters:

    • namedQueryId: ID of the saved query
    • databaseOverride: Optional override of the saved query's default database
    • maxRows: Maximum number of rows to return (default: 1000)
    • timeoutMs: Timeout in milliseconds (default: 60000)
  • Returns:

    • Same behavior as run_query: full results or execution ID

Usage Examples

Show All Databases

Message to AI Assistant: List all databases in Athena

MCP parameter:

json
{
  "database": "default",
  "query": "SHOW DATABASES"
}

List Tables in a Database

Message to AI Assistant: Show me all tables in the default database

MCP parameter:

json
{
  "database": "default",
  "query": "SHOW TABLES"
}

Get Table Schema

Message to AI Assistant: What's the schema of the asin_sitebestimg table?

MCP parameter:

json
{
  "database": "default",
  "query": "DESCRIBE default.asin_sitebestimg"
}

Table Rows Preview

Message to AI Assistant: Show some rows from my_database.mytable

MCP parameter:

json
{
  "database": "my_database",
  "query": "SELECT * FROM my_table LIMIT 10",
  "maxRows": 10
}

Advanced Query with Filtering and Aggregation

Message to AI Assistant: Find the average price by category for in-stock products

MCP parameter:

json
{
  "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
}

Checking Query Status

json
{
  "queryExecutionId": "12345-67890-abcdef"
}

Getting Results for a Completed Query

json
{
  "queryExecutionId": "12345-67890-abcdef",
  "maxRows": 10
}

Listing Saved Queries

json
{
  "name": "list_saved_queries",
  "arguments": {}
}

Running a Saved Query

json
{
  "name": "run_saved_query",
  "arguments": {
    "namedQueryId": "abcd-1234-efgh-5678",
    "maxRows": 100
  }
}

Requirements

  • Node.js >= 16
  • AWS credentials with appropriate Athena and S3 permissions
  • S3 bucket for query results
  • Named queries (optional) must exist in the specified ATHENA_WORKGROUP and AWS_REGION

License

MIT

Repository

GitHub Repository

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "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": "",
        "AWS_SECRET_ACCESS_KEY": "",
        "AWS_SESSION_TOKEN": "",
        "ATHENA_WORKGROUP": "default_workgroup",
        "QUERY_TIMEOUT_MS": "300000",
        "MAX_RETRIES": "100",
        "RETRY_DELAY_MS": "500"
      }
    }
  }
}

Use AWS Athena MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once AWS Athena is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add AWS Athena as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the AWS Athena MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "aws-athena": {
      "command": "npx",
      "args": [
        "-y",
        "@lishenxydlgzs/aws-athena-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the AWS Athena MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the AWS Athena MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use AWS Athena to help me with this task?
AWS Athena
Sure. I read it.
Here is what I found using AWS Athena.

Frequently asked questions

What is the AWS Athena MCP server used for?

AWS Athena is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use AWS Athena MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use AWS Athena with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use AWS Athena MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With AWS Athena connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect AWS Athena MCP to TypingMind?

AWS Athena runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does AWS Athena MCP provide in TypingMind?

AWS Athena exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use AWS Athena MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If AWS Athena requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇