A high-performance MCP (Model Context Protocol) server for uploading images to AWS S3, specifically designed for Figma → MCP → HTML workflows.
- FastMCP Framework: Built with the high-performance Pythonic MCP library
- Image Processing: Automatic optimization, WebP conversion, and compression
- Batch Upload: Parallel processing for multiple images
- AWS S3 Integration: Secure upload with proper IAM permissions
- Type Safety: Full Pydantic model validation
- Async Support: Non-blocking operations with asyncio
- Python 3.10+
- AWS Account with S3 access
uvpackage manager (recommended)
# Clone the repository
git clone https://github.com/aucus/s3-upload-mcp-server.git
cd s3-upload-mcp-server
# Install with uv (recommended)
uv sync
# Or install with pip
pip install -e .Create a .env file in the project root:
# Copy env.example to .env and update with your values
cp env.example .env
# Edit .env with your AWS credentials
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_REGION=ap-northeast-2
S3_BUCKET_NAME=your-bucket-name# STDIO transport (for Claude Desktop)
uv run fastmcp run src/server.py
# HTTP transport (for web clients)
uv run python -m src.server -- --transport http --port 8000Upload a single image file to S3 and return a public URL.
Parameters:
file_path(str): Path to the image filebucket_name(str): S3 bucket namekey(str, optional): S3 object key (auto-generated if not provided)optimize(bool): Enable image optimization (default: True)quality(int): Compression quality 1-100 (default: 80)
Returns:
success(bool): Upload success statusurl(str): Public URL of uploaded imageerror(str): Error message if failedmetadata(dict): Upload metadata
Upload multiple images in parallel to S3.
Parameters:
file_paths(List[str]): List of image file pathsbucket_name(str): S3 bucket namefolder_prefix(str, optional): S3 folder prefixoptimize(bool): Enable image optimization (default: True)
Returns:
success(bool): Overall success statusurls(List[str]): List of public URLserrors(List[str]): List of error messagestotal_files(int): Total number of filessuccessful_uploads(int): Number of successful uploads
List all accessible S3 buckets.
Returns:
success(bool): Operation success statusbuckets(List[str]): List of bucket nameserror(str): Error message if failed
Add to your Claude Desktop configuration:
{
"mcpServers": {
"s3-upload": {
"command": "uv",
"args": ["run", "s3-upload-mcp-server"],
"env": {
"AWS_REGION": "ap-northeast-2",
"S3_BUCKET_NAME": "figma-assets-bucket"
}
}
}
}# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=src --cov-report=html
# Run specific test file
uv run pytest tests/test_tools.py- Upload Speed: < 3 seconds for 1MB images
- Parallel Processing: Up to 5 files simultaneously
- Memory Usage: < 100MB
- CPU Usage: < 50% single core
- Environment variable authentication
- IAM role support for EC2/Lambda
- HTTPS/TLS 1.2+ encryption
- S3 server-side encryption
- Least privilege access
MIT License - see LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
For issues and questions, please open an issue on GitHub.