Click on "Install 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., "@AWS Athena MCP Servershow me the top 10 products by sales this month"
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.
AWS Athena MCP Server
A simple, clean MCP (Model Context Protocol) server for AWS Athena integration. Execute SQL queries, discover schemas, and manage query executions through a standardized interface.
โจ Features
Simple Setup - Get running in under 5 minutes
Clean Architecture - Modular, well-tested, easy to understand
Essential Tools - Query execution and schema discovery
Type Safe - Full type hints and Pydantic models
Async Support - Built for performance with async/await
Good Defaults - Works out of the box with minimal configuration
๐ Quick Start
1. Install
2. Configure
Set the required environment variables:
3. Run
That's it! The server is now running and ready to accept MCP connections.
๐ค Claude Desktop Integration
To use this MCP server with Claude Desktop:
1. Install Claude Desktop
Download and install Claude Desktop if you haven't already.
2. Configure Claude Desktop
Add the following configuration to your claude_desktop_config.json:
Location of config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Configuration (Option 1 - Using uvx - Recommended):
Configuration (Option 2 - Using installed tool):
Configuration (Option 3 - Using uv tool run):
Recommended approach: Use Option 1 (uvx) for the most common MCP setup pattern. Option 2 (installed tool) offers better performance as it avoids package resolution on each startup.
3. Set AWS Credentials
Configure your AWS credentials using one of these methods:
4. Restart Claude Desktop
Restart Claude Desktop to load the new MCP server configuration.
5. Verify Connection
In Claude Desktop, you should now be able to:
Execute SQL queries against your Athena databases
List tables and describe schemas
Get query results and status
Example conversation:
๐ ๏ธ Automated Setup (Alternative)
For easier setup, you can use the included setup script:
The script will:
Check if uv is installed
Guide you through configuration
Update your Claude Desktop config file
Verify AWS credentials
Provide next steps
You can also copy the example configuration:
๐ง Configuration
The server uses environment variables for configuration:
Variable | Required | Default | Description |
| โ | - | S3 path for query results |
| โ |
| AWS region |
| โ |
| Athena workgroup |
| โ |
| Query timeout |
AWS Credentials
Configure AWS credentials using any of these methods:
๐ Security
Environment Variables
โ ๏ธ NEVER commit credentials to version control!
Use the provided example file to set up your environment:
AWS Credentials Best Practices
Use IAM Roles (recommended for production):
# No credentials needed - uses instance/container role export ATHENA_S3_OUTPUT_LOCATION=s3://your-bucket/results/Use AWS CLI profiles (recommended for development):
aws configure --profile athena-mcp export AWS_PROFILE=athena-mcpUse temporary credentials when possible:
aws sts assume-role --role-arn arn:aws:iam::123456789012:role/AthenaRole \ --role-session-name athena-mcp-sessionAvoid long-term access keys in environment variables
Required AWS Permissions
Your AWS credentials need these minimum permissions:
SQL Injection Protection
The server includes built-in SQL injection protection:
Query validation - Dangerous patterns are blocked
Input sanitization - Database/table names are validated
Query size limits - Prevents resource exhaustion
Parameterized queries - When possible
Network Security
For production deployments:
Use VPC endpoints for AWS services
Restrict network access to the MCP server
Use TLS for all communications
Monitor and log all queries
Monitoring and Auditing
Enable CloudTrail logging for Athena:
๐ ๏ธ Available Tools
The server provides these MCP tools:
Query Execution
run_query- Execute SQL queries against Athenaget_status- Check query execution statusget_result- Get results for completed queries
Schema Discovery
list_tables- List all tables in a databasedescribe_table- Get detailed table schema
๐ Usage Examples
Basic Query Execution
Schema Discovery
Handling Timeouts
๐งช Testing
Test your configuration:
๐๏ธ Development
Setup Development Environment
Project Structure
Adding New Tools
Create tool functions in
src/tools/Register them in the appropriate module
Add tests in
tests/Update documentation
Example:
๐ Troubleshooting
Common Issues
Configuration Error
Solution: Set the required environment variable:
AWS Credentials Error
Solution: Configure AWS credentials (see Configuration section)
Permission Denied
Solution: Ensure your AWS credentials have these permissions:
athena:StartQueryExecutionathena:GetQueryExecutionathena:GetQueryResultsathena:ListWorkGroupss3:GetObject,s3:PutObjecton your S3 bucket
Debug Mode
Enable debug logging:
๐ License
MIT License - see LICENSE file for details.
๐ค Contributing
Contributions welcome! Please read our contributing guidelines and:
Fork the repository
Create a feature branch
Make your changes
Add tests
Submit a pull request
๐ Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Documentation: docs/
Made with โค๏ธ for the MCP community