Easily run and manage AWS Athena SQL queries with a Model Context Protocol server for AI integrations
aws-athena-mcp
MCP Server?The aws-athena-mcp
MCP server acts as a bridge, allowing AI applications to execute sophisticated SQL queries against AWS Athena databases. This server offers a standardized interface for integrating AI tools and assistants with data sources like S3-stored data, enabling seamless data retrieval and analysis without the need for direct AWS credentials or complex configurations.
The aws-athena-mcp
MCP server provides several key features designed to enhance AI application workflows:
Users can run SQL queries against their AWS Athena databases using a simple, standardized API. This functionality is crucial for data exploration and analysis within AI applications.
{
"database": "default",
"query": "SELECT * FROM sales_data LIMIT 500"
}
The server allows querying the status of query executions, which helps in tracking long-running queries or troubleshooting issues:
{
"queryExecutionId": "12345-67890-abcdef"
}
AI applications can manage saved queries (named queries) to simplify repeated data retrieval tasks. This feature is particularly useful for common data access patterns.
The architecture of the aws-athena-mcp
server is designed with compatibility and flexibility in mind, utilizing the Model Context Protocol (MCP). The protocol ensures seamless integration with various AI applications, including popular ones like Claude Desktop, Continue, Cursor, and more.
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[AWS Athena Database]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
Below is the compatibility matrix for the aws-athena-mcp
server with various MCP clients:
MCP Client | APIs | Data | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
This matrix indicates that aws-athena-mcp
fully supports data retrieval and prompts but does not offer text-based interactions, thus providing strong support for AI applications focused on data analysis.
Set Up AWS Credentials: Ensure you have configured your AWS credentials using one of the following methods:
AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
)Install the MCP Server:
npm install --save @lishenxydlgzs/aws-athena-mcp
Configure the Server: Add the server to your MCP configuration with appropriate settings:
{
"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",
"AWS_PROFILE": "default",
"AWS_ACCESS_KEY_ID": "",
"AWS_SECRET_ACCESS_KEY": "",
"AWS_SESSION_TOKEN": "",
// Optional server configuration
"ATHENA_WORKGROUP": "default_workgroup",
"QUERY_TIMEOUT_MS": "300000",
"MAX_RETRIES": "100",
"RETRY_DELAY_MS": "500"
}
}
}
}
AI applications can use the aws-athena-mcp
server to retrieve sales data, process it, and generate reports:
{
"database": "sales",
"query": "SELECT * FROM daily_sales WHERE date >= '2023-10-01' AND date <= '2023-10-31'"
}
Integration with the server allows for real-time inventory checks and management through SQL queries:
{
"database": "inventory",
"query": "SELECT * FROM product_stock WHERE stock < 5"
}
The aws-athena-mcp
server is designed to enhance AI applications by providing a simple, standardized interface for querying AWS Athena. Here are some integration points:
The aws-athena-mcp
server is compatible with a variety of AI applications. Here’s the detailed matrix for compatibility:
Tool | API Support | Data Retrieval | Prompt Generation |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
This matrix highlights that aws-athena-mcp
fully supports data retrieval and prompt generation but does not offer direct text-based interaction capabilities.
Ensure you configure the environment variables correctly for secure and efficient query execution:
{
"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": ""
// Optional server configuration
"ATHENA_WORKGROUP": "default_workgroup",
"QUERY_TIMEOUT_MS": "300000", // Default: 5 minutes (300000ms)
"MAX_RETRIES": "100", // Default: 100 attempts
"RETRY_DELAY_MS": "500" // Default: 500ms between retries
}
Q: Can I run any SQL query with this server?
A: Yes, the aws-athena-mcp
server supports executing a wide range of SQL queries against AWS Athena databases.
Q: How can I manage saved queries in my application?
A: You can use the list_saved_queries
and run_saved_query
methods to list and run named queries, respectively.
Q: Is there a limit to the number of rows returned by default?
A: The default limit is 1000 rows, but this can be adjusted using the LIMIT
clause in your SQL query or by setting the MAX_ROW_LIMIT
option in the server configuration.
Q: How do I handle long-running queries? A: You can track the status of long-running queries using the method to check their execution status, which is provided by the server.
Q: Can this server be used for real-time data analysis? A: Yes, while the focus is on query execution and result retrieval, it provides a foundation that can be extended with additional processing tools for real-time analytics.
aws-athena-mcp
as specified in the README.aws-athena-mcp
enhances AI application workflows through standardized data retrieval.This comprehensive documentation positions the aws-athena-mcp
server as a valuable tool for developers building integrations with AWS Athena in their AI applications.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration