athena-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@athena-mcp list databases in my catalog"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
athena-mcp
An AWS Athena MCP Server using FastMCP. It provides secure access to AWS Athena operations with manual AWS credential authentication.
Overview
This project provides a set of tools to interact with AWS Athena. These tools are built using the mcp library and boto3. The server uses manual AWS credential authentication, reading credentials from environment variables.
Related MCP server: AWS Athena MCP Server
Features
The following Athena operations are supported:
Workgroups:
list_work_groups: List all Athena work groups.get_work_group: Get details about a work group.
Databases:
list_databases: List databases in a data catalog.
Tables:
list_tables: List tables in a database.get_table_metadata: Get metadata for a specific table.
Queries:
start_query_execution: Execute a SQL query in Athena.get_query_execution: Get details about a query execution.get_query_results: Get results from a completed query.stop_query_execution: Stop a running query execution.list_query_executions: List recent query executions.
Named Queries:
create_named_query: Create a named query.list_named_queries: List named queries.get_named_query: Get details about a named query.delete_named_query: Delete a named query.
Data Catalogs:
list_data_catalogs: List data catalogs.
Getting Started
Prerequisites
Python >= 3.13
AWS account with Athena access
Installation
Clone the repository:
git clone https://github.com/your-username/athena-mcp.git cd athena-mcpInstall the dependencies:
pip install -r requirements.txt
Configuration
Create a
.envfile in the root of the project and add your AWS credentials:AWS_ACCESS_KEY_ID=your-access-key AWS_SECRET_ACCESS_KEY=your-secret-key AWS_SESSION_TOKEN=your-session-token (optional) AWS_REGION=your-aws-region
Usage
To start the server, run the following command:
athena-mcpThis will start the FastMCP server, and you can then use the provided tools to interact with AWS Athena.
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue.
Available Tools
15 toolscreate_named_queryC
Create a named query
Args: name: Name of the query database: Database for the query query_string: SQL query string description: Description of the query work_group: Work group for the query
Inputs: name (required), database (required), query_string (required), work_group, +1 more. Returns: result
delete_named_queryC
Delete a named query
Args: named_query_id: Named query ID
Inputs: named_query_id (required). Returns: result
get_named_queryC
Get details about a named query
Args: named_query_id: Named query ID
Inputs: named_query_id (required). Returns: result
get_query_executionC
Get details about a query execution
Args: query_execution_id: Query execution ID
Inputs: query_execution_id (required). Returns: result
get_query_resultsB
Get results from a completed query
Args: query_execution_id: Query execution ID max_results: Maximum number of results to return next_token: Token for pagination
Inputs: query_execution_id (required), next_token, max_results. Returns: result
get_table_metadataC
Get metadata for a specific table
Args: database_name: Name of the database table_name: Name of the table catalog_name: Name of the data catalog
Inputs: table_name (required), database_name (required), catalog_name. Returns: result
get_work_groupB
Get details about a work group
Args: work_group: Work group name
Inputs: work_group (required). Returns: result
list_databasesA
List databases in a data catalog
Args: catalog_name: Name of the data catalog max_results: Maximum number of results to return next_token: Token for pagination
Inputs: next_token, max_results, catalog_name. Returns: result
list_data_catalogsB
List data catalogs
Args: max_results: Maximum number of results to return next_token: Token for pagination
Inputs: next_token, max_results. Returns: result
list_named_queriesB
List named queries
Args: work_group: Work group to filter by max_results: Maximum number of results to return next_token: Token for pagination
Inputs: next_token, work_group, max_results. Returns: result
list_query_executionsC
List recent query executions
Args: work_group: Work group to filter by max_results: Maximum number of results to return next_token: Token for pagination
Inputs: next_token, work_group, max_results. Returns: result
list_tablesA
List tables in a database
Args: database_name: Name of the database catalog_name: Name of the data catalog expression: Regular expression to filter table names max_results: Maximum number of results to return next_token: Token for pagination
Inputs: database_name (required), expression, next_token, max_results, +1 more. Returns: result
list_work_groupsA
List all Athena work groups
Args: max_results: Maximum number of results to return next_token: Token for pagination
Inputs: next_token, max_results. Returns: result
start_query_executionC
Execute a SQL query in Athena
Args: query_string: SQL query to execute database: Database to run query in catalog: Catalog to run query in work_group: Work group to use output_location: S3 location for query results
Inputs: query_string (required), catalog, database, work_group, +1 more. Returns: result
stop_query_executionB
Stop a running query execution
Args: query_execution_id: Query execution ID
Inputs: query_execution_id (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool targets a distinct resource and action: work groups, catalogs, databases, tables, query executions, and named queries are clearly separated. Even similar tools like get_query_execution and get_query_results are unambiguous because one returns execution status and the other returns result rows.
All tool names follow a consistent verb_noun pattern using snake_case, such as list_*, get_*, create_*, delete_*, start_*, and stop_*. This makes the API predictable and easy for an agent to navigate.
Fifteen tools is well-scoped for an Athena MCP server covering catalog discovery, query execution, and named query management. Each tool earns its place and the count stays within the ideal range without redundancy.
The core Athena workflow is well covered: discover catalogs/databases/tables, run and manage query executions, and manage named queries. Minor gaps include the absence of update_named_query and limited work group/catalog management beyond listing and getting details.
Maintenance
Related MCP Connectors
Query, explore, and manage your databases through natural conversation.
Query BigQuery, Snowflake, Redshift & Azure Synapse with natural language
Your Databricks Lakehouse in natural language: run SQL on your SQL warehouses, track long-running qu
Ask your databases questions in plain English, run read-only SQL and set up data alerts.
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceEnables access to Amazon Managed Prometheus workspaces through natural language queries. Supports listing workspaces, executing PromQL queries, and retrieving workspace details and metrics with AWS authentication.4MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to execute SQL queries against AWS Athena databases, check query status, retrieve results, and manage saved queries with support for both local and remote deployment via Lambda.5375 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables execution of SQL queries against AWS Athena databases with schema discovery, query status management, and result retrieval through a standardized Model Context Protocol interface.67 PyPI23MIT
- AlicenseNot gradedqualityDmaintenanceEnables monitoring and analysis of Amazon RDS (MySQL, PostgreSQL) instances, metrics, and slow query logs via natural language.8MIT