Labsco
gangadharrr logo

AWS S3 MCP Server

โ˜… 2

from gangadharrr

An MCP server for managing files and buckets on AWS S3. Requires AWS credentials for authentication.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredNeeds API keys

AWS S3 MCP Server

A Model Context Protocol (MCP) server that gives AI assistants (Claude, Cursor, etc.) direct access to AWS S3 โ€” enabling them to list, upload, download, and manage S3 buckets and objects through natural language.

Why This Exists

When building AI agent pipelines, you often need agents to read from or write to S3 โ€” whether that's fetching documents for RAG, persisting outputs, or managing files dynamically. This MCP server bridges that gap by exposing S3 operations as MCP tools, so any MCP-compatible AI client can interact with S3 without custom integration work.

Available Tools

Tool Description list_buckets List all S3 buckets in the account create_bucket Create a new S3 bucket delete_bucket Delete an empty S3 bucket list_objects List objects in a bucket (with optional prefix filter) upload_object Upload a file or string content to a bucket download_object Download an object from a bucket delete_object Delete an object from a bucket get_bucket_policy Get the policy attached to a bucket set_bucket_policy Set or update a bucket policy

Tool Reference

list_buckets

Lists all S3 buckets in the AWS account.

Parameters: None

Response:

Copy & paste โ€” that's it
{
 "success": true,
 "buckets": [
 { "name": "my-bucket", "creationDate": "2023-01-15T00:00:00.000Z" }
 ],
 "count": 1
}

create_bucket

Creates a new S3 bucket.

Parameters:

Name Type Required Description bucketName string โœ… Name of the bucket to create region string โŒ AWS region (defaults to configured region)

Response:

Copy & paste โ€” that's it
{
 "success": true,
 "bucketName": "my-new-bucket",
 "location": "http://my-new-bucket.s3.amazonaws.com/"
}

list_objects

Lists objects in a bucket with optional prefix filtering.

Parameters:

Name Type Required Description bucketName string โœ… Bucket to list objects from prefix string โŒ Filter by prefix (folder path) maxKeys number โŒ Max results (default: 1000) continuationToken string โŒ Pagination token

upload_object

Uploads a file or string content to S3.

Parameters:

Name Type Required Description bucketName string โœ… Target bucket key string โœ… Object key (path) in the bucket filePath string โŒ Local file path to upload content string โŒ String content to upload directly contentType string โŒ MIME type of the content

download_object

Downloads an object from S3.

Parameters:

Name Type Required Description bucketName string โœ… Source bucket key string โœ… Object key (path) to download outputPath string โŒ Local path to save the file returnContent boolean โŒ Return content inline in response

delete_object

Deletes an object from a bucket.

Parameters:

Name Type Required Description bucketName string โœ… Bucket containing the object key string โœ… Object key to delete

get_bucket_policy / set_bucket_policy

Get or set the IAM policy for a bucket.

Parameters for set_bucket_policy:

Name Type Required Description bucketName string โœ… Target bucket policy string/object โœ… Policy document (JSON string or object)

AWS Authentication

The server uses the AWS SDK credential resolution chain in this order:

  • Environment variables โ€” AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY

  • Shared credentials file โ€” ~/.aws/credentials (configured via aws configure)

  • EC2 Instance Metadata โ€” if running on an EC2 instance with an IAM role

For production, IAM roles are recommended over static credentials.

Contributing

Contributions are welcome! If you'd like to add a new S3 operation or improve existing ones:

  • Fork the repository

  • Create a feature branch: git checkout -b feature/my-new-tool

  • Commit your changes: git commit -m 'Add: new S3 tool'

  • Push and open a Pull Request

License

MIT โ€” see LICENSE for details.

Built with the MCP TypeScript SDK and AWS SDK v3.