Integrations
Provides tools for listing available S3 buckets, listing objects within a bucket, and retrieving object contents from AWS S3 storage.
S3 MCP Server
An Amazon S3 Model Context Protocol (MCP) server that provides tools for interacting with S3 buckets and objects.
https://github.com/user-attachments/assets/d05ff0f1-e2bf-43b9-8d0c-82605abfb666
Overview
This MCP server allows Large Language Models (LLMs) like Claude to interact with AWS S3 storage. It provides tools for:
- Listing available S3 buckets
- Listing objects within a bucket
- Retrieving object contents
The server is built using TypeScript and the MCP SDK, providing a secure and standardized way for LLMs to interface with S3.
Installation
Prerequisites
- Node.js 18 or higher
- npm or yarn
- AWS credentials configured (either through environment variables or AWS credentials file)
- Docker (optional, for containerized setup)
Setup
- Install via npm:
- If building from source:
- Configure AWS credentials and S3 access:
Create a .env
file with your AWS configuration:
Or set these as environment variables.
Configuration
The server can be configured using the following environment variables:
Variable | Description | Default |
---|---|---|
AWS_REGION | AWS region where your S3 buckets are located | us-east-1 |
S3_BUCKETS | Comma-separated list of allowed S3 bucket names | (empty) |
S3_MAX_BUCKETS | Maximum number of buckets to return in listing | 5 |
AWS_ACCESS_KEY_ID | AWS access key (if not using default credentials) | (from AWS config) |
AWS_SECRET_ACCESS_KEY | AWS secret key (if not using default credentials) | (from AWS config) |
Running the Server
Direct Node.js Execution
You can run the server directly with Node.js:
Docker Setup 🐳
You can run the S3 MCP server as a Docker container using either Docker CLI or Docker Compose.
Using Docker CLI
- Build the Docker image:
- Run the container with environment variables:
- Check container logs:
- Stop and remove the container:
Note that the container doesn't expose any ports because it's designed to be used with Claude Desktop through Docker exec rather than direct HTTP connections.
Using Docker Compose
- Build and start the Docker container:
- To stop the container:
Using Docker with MinIO for Testing
The Docker Compose setup includes a MinIO service for local testing:
The MinIO service automatically creates two test buckets (test-bucket-1
and test-bucket-2
) and uploads sample files for testing.
Debugging on MCP Inspector
To debug the server using MCP Inspector:
When using the --docker-compose
option, the script will:
- Start MinIO and the S3 MCP server containers if they aren't running
- Launch the MCP Inspector connected to the S3 MCP server
- You can then test the S3 tools against the local MinIO instance
Connecting to Claude Desktop
To use this server with Claude Desktop:
- Edit your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
- Add the S3 MCP server to the configuration:
Docker Option for Claude Desktop 🐳
You can also configure Claude Desktop to use a running Docker container for the MCP server:
⚠️ Important Prerequisites: For this Docker configuration to work, you MUST first build and run the Docker container BEFORE launching Claude Desktop:
CopyWithout a running container, Claude Desktop will show errors when trying to use S3 tools.
The Docker configuration above uses
exec
to send MCP requests directly to the running container. No port mapping is required since Claude communicates directly with the container instead of through a network port.
Note: Ensure the container name in the configuration (
aws-s3-mcp-server
) matches the name of your running container.
Important: Please note the following when using the configuration above
- Replace
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
with your actual credentialsS3_BUCKETS
should contain a comma-separated list of buckets you want to allow access toAWS_REGION
should be set to the region where your buckets are located
💣 If error occurs on Claude Desktop
If you encounter errors with the above configuration in Claude Desktop, try using absolute paths as follows:
Available Tools
list-buckets
Lists available S3 buckets that the server has permission to access. This tool respects the S3_BUCKETS
configuration that limits which buckets are shown.
Parameters: None
Example output:
list-objects
Lists objects in a specified S3 bucket.
Parameters:
bucket
(required): Name of the S3 bucket to list objects fromprefix
(optional): Prefix to filter objects (like a folder path)maxKeys
(optional): Maximum number of objects to return
Example output:
get-object
Retrieves an object from a specified S3 bucket. Text files are returned as plain text, while binary files are returned with limited details.
Parameters:
bucket
(required): Name of the S3 bucketkey
(required): Key (path) of the object to retrieve
Example text output:
Example binary output:
Security Considerations
- The server will only access buckets specified in the
S3_BUCKETS
environment variable - AWS credentials must have appropriate permissions to the buckets
- Use the principle of least privilege when configuring AWS permissions
- For production use, consider using IAM roles with specific S3 permissions
Usage with Claude
When interacting with Claude in the desktop app, you can ask it to perform S3 operations like:
- "List all my S3 buckets"
- "Summarize PDF files in my-documents-bucket"
- "Get the README.txt file from my-documents-bucket"
Claude will use the appropriate MCP tool to carry out the request and show you the results.
License
MIT
You must be authenticated.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
An Amazon S3 Model Context Protocol server that allows Large Language Models like Claude to interact with AWS S3 storage, providing tools for listing buckets, listing objects, and retrieving object contents.
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that enables Claude to execute Python code using boto3 to query and manage AWS resources directly from conversations.Last updated -6PythonMIT License
- AsecurityFlicenseAqualityAn MCP server that provides tools for interacting with AWS S3 buckets, enabling direct access to S3 operations through the Model Context Protocol.Last updated -1Python
- AsecurityAlicenseAqualityA Model Context Protocol server implementation that enables Claude to perform AWS operations on S3 and DynamoDB services through natural language commands.Last updated -2392PythonMIT License
- -securityFlicense-qualityA Model Context Protocol server allowing Claude AI to interact with AWS resources through natural language, enabling users to query and manage AWS services without using the traditional AWS Console or CLI.Last updated -TypeScript