aws-athena-mcp
@lishenxydlgzs/aws-athena-mcp
AWS Athena 쿼리를 실행하기 위한 모델 컨텍스트 프로토콜(MCP) 서버입니다. 이 서버를 통해 AI 어시스턴트는 AWS Athena 데이터베이스에 SQL 쿼리를 실행하고 결과를 검색할 수 있습니다.
용법
다음 방법 중 하나를 사용하여 AWS 자격 증명을 구성합니다.
AWS CLI 구성
환경 변수(
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY)IAM 역할(AWS에서 실행하는 경우)
MCP 구성에 서버를 추가합니다.
지엑스피1
서버는 다음과 같은 도구를 제공합니다.
run_query: AWS Athena를 사용하여 SQL 쿼리를 실행합니다.매개변수:
데이터베이스: 쿼리할 Athena 데이터베이스
쿼리: 실행할 SQL 쿼리
maxRows: 반환할 최대 행 수(기본값: 1000, 최대값: 10000)
보고:
쿼리가 시간 초과 내에 완료되면: 전체 쿼리 결과
시간 초과에 도달한 경우: 나중에 검색할 수 있는 queryExecutionId만
get_status: 쿼리 실행 상태 확인매개변수:
queryExecutionId: run_query에서 반환된 ID
보고:
상태: 쿼리 상태(대기 중, 실행 중, 성공, 실패 또는 취소됨)
stateChangeReason: 상태 변경 이유(있는 경우)
submissionDateTime: 쿼리가 제출된 시간
completionDateTime: 쿼리가 완료된 시간(완료된 경우)
통계: 쿼리 실행 통계(사용 가능한 경우)
get_result: 완료된 쿼리에 대한 결과를 검색합니다.매개변수:
queryExecutionId: run_query에서 반환된 ID
maxRows: 반환할 최대 행 수(기본값: 1000, 최대값: 10000)
보고:
쿼리가 성공적으로 완료된 경우 전체 쿼리 결과
쿼리가 실패하거나 계속 실행 중인 경우 오류 발생
list_saved_queries: Athena에 저장된(명명된) 모든 쿼리를 나열합니다.보고:
id,name및 선택적description포함된 저장된 쿼리 배열구성된
ATHENA_WORKGROUP및AWS_REGION에서 쿼리가 반환됩니다.
run_saved_query: 이전에 저장된 쿼리를 ID로 실행합니다.
매개변수:
namedQueryId: 저장된 쿼리의 IDdatabaseOverride: 저장된 쿼리의 기본 데이터베이스를 선택적으로 재정의합니다.maxRows: 반환할 최대 행 수(기본값: 1000)timeoutMs: 밀리초 단위의 시간 초과(기본값: 60000)
보고:
run_query와 동일한 동작: 전체 결과 또는 실행 ID
Related MCP server: AWS Athena MCP Server
사용 예
모든 데이터베이스 표시
AI Assistant에게 보내는 메시지: List all databases in Athena
MCP 매개변수:
{
"database": "default",
"query": "SHOW DATABASES"
}데이터베이스의 테이블 나열
AI Assistant에게 보내는 메시지: Show me all tables in the default database
MCP 매개변수:
{
"database": "default",
"query": "SHOW TABLES"
}테이블 스키마 가져오기
AI Assistant에게 보내는 메시지: What's the schema of the asin_sitebestimg table?
MCP 매개변수:
{
"database": "default",
"query": "DESCRIBE default.asin_sitebestimg"
}테이블 행 미리보기
AI Assistant에 대한 메시지: Show some rows from my_database.mytable
MCP 매개변수:
{
"database": "my_database",
"query": "SELECT * FROM my_table LIMIT 10",
"maxRows": 10
}필터링 및 집계를 통한 고급 쿼리
AI 비서에게 보내는 메시지: Find the average price by category for in-stock products
MCP 매개변수:
{
"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
}
}요구 사항
노드.js >= 16
적절한 Athena 및 S3 권한이 있는 AWS 자격 증명
쿼리 결과를 위한 S3 버킷
명명된 쿼리(선택 사항)는 지정된
ATHENA_WORKGROUP및AWS_REGION에 있어야 합니다.
특허
MIT
저장소
Available Tools
5 toolsget_resultA
Get results for a completed query. Returns error if query is still running.
Inputs: queryExecutionId (required), maxRows.
get_statusC
Get the current status of a query execution
Inputs: queryExecutionId (required).
list_saved_queriesA
List all saved (named) Athena queries available in your AWS account.
Inputs: no named parameters.
run_queryA
Execute a SQL query using AWS Athena. Returns full results if query completes before timeout, otherwise returns queryExecutionId.
Inputs: database (required), query (required), maxRows, timeoutMs.
run_saved_queryC
Execute a saved (named) Athena query by its query ID.
Inputs: namedQueryId (required), databaseOverride, maxRows, timeoutMs.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose with no overlap: get_result retrieves results, get_status checks status, list_saved_queries lists queries, run_query executes new queries, and run_saved_query executes saved ones. The descriptions make it unambiguous which tool to use for each operation.
All tools follow a consistent verb_noun pattern with snake_case: get_result, get_status, list_saved_queries, run_query, and run_saved_query. This predictable naming makes it easy for agents to understand and select tools.
With 5 tools, this server is well-scoped for AWS Athena operations. Each tool earns its place by covering essential query lifecycle functions: listing, executing (both new and saved), checking status, and retrieving results. This is an appropriate number for the domain.
The tool set provides complete coverage for core Athena workflows: create/run queries (run_query, run_saved_query), monitor (get_status), and retrieve results (get_result), with list_saved_queries for discovery. A minor gap is the lack of tools for managing saved queries (e.g., create, update, delete), but agents can work around this.
Maintenance
Related MCP Connectors
SQL validation, formatting, parsing, metadata extraction, linting, and security analysis.
Query BigQuery, Snowflake, Redshift & Azure Synapse with natural language
Generate and run high performance queries on open and private spatial data at-scale in the cloud
Query Postgres, MySQL, BigQuery, Iceberg and files with DuckDB, with per-query cost checks.
Related MCP Servers
- 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.5MIT
- 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.153 PyPI23MIT
- AlicenseNot gradedqualityDmaintenanceEnables querying AWS Cost and Usage Report data via Amazon Athena for cost-effective and detailed cost analysis.2MIT
- FlicenseAqualityDmaintenanceEnables users to execute SQL queries, manage workgroups, databases, tables, and named queries in AWS Athena through natural language.15-