The S3 MCP server provides a Model Context Protocol interface that allows Large Language Models like Claude to interact with AWS S3 storage. It enables listing buckets, browsing objects, and retrieving content through standardized MCP tools.
# Install globally via npm
npm install -g aws-s3-mcp
# Or as a dependency in your project
npm install aws-s3-mcp
# Clone the repository
git clone https://github.com/samuraikun/aws-s3-mcp.git
cd aws-s3-mcp
# Install dependencies and build
npm install
npm run build
Configure the server using environment variables in your system or a .env
file:
AWS_REGION=us-east-1
S3_BUCKETS=bucket1,bucket2,bucket3
S3_MAX_BUCKETS=5
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
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) |
# Using npx (HTTP transport by default)
npx aws-s3-mcp
# If installed globally
aws-s3-mcp
# Explicit HTTP transport
node dist/index.js --http
# STDIO transport (for Claude Desktop integration)
node dist/index.js --stdio
When using HTTP transport (default), the server runs on port 3000 with these endpoints:
http://localhost:3000/health
http://localhost:3000/mcp
http://localhost:3000/sse
# Build the Docker image
docker build -t aws-s3-mcp .
# Run with environment variables
docker run -d \
-e AWS_REGION=us-east-1 \
-e S3_BUCKETS=bucket1,bucket2 \
-e AWS_ACCESS_KEY_ID=your-access-key \
-e AWS_SECRET_ACCESS_KEY=your-secret-key \
--name aws-s3-mcp-server \
aws-s3-mcp
# Or use environment variables from .env file
docker run -d \
--env-file .env \
--name aws-s3-mcp-server \
aws-s3-mcp
Note: For HTTP transport, add -p 3000:3000
to expose the port.
# Start the container
docker compose up -d s3-mcp
# View logs
docker compose logs -f s3-mcp
# Start MinIO and the MCP server
docker compose up -d
# Access MinIO console at http://localhost:9001
# Default credentials: minioadmin/minioadmin
To use this server with Claude Desktop, use STDIO transport mode:
Edit your Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Add this configuration:
{
"mcpServers": {
"s3": {
"command": "npx",
"args": ["aws-s3-mcp", "--stdio"],
"env": {
"AWS_REGION": "us-east-1",
"S3_BUCKETS": "bucket1,bucket2,bucket3",
"S3_MAX_BUCKETS": "5",
"AWS_ACCESS_KEY_ID": "your-access-key",
"AWS_SECRET_ACCESS_KEY": "your-secret-key"
}
}
}
}
{
"mcpServers": {
"s3": {
"command": "docker",
"args": ["exec", "-i", "aws-s3-mcp-server", "node", "dist/index.js"],
"env": {}
}
}
}
Before using this configuration, you must start the Docker container:
# Using Docker Compose
docker compose up -d s3-mcp
# Or using Docker CLI
docker run -d --name aws-s3-mcp-server --env-file .env aws-s3-mcp
If you encounter errors, try using absolute paths:
# Get the absolute paths
which node
which aws-s3-mcp
Then update your configuration:
{
"mcpServers": {
"s3": {
"command": "your-absolute-path-to-node",
"args": ["your-absolute-path-to-aws-s3-mcp/dist/index.js", "--stdio"],
"env": {
"AWS_REGION": "your-aws-region",
"S3_BUCKETS": "your-s3-buckets",
"AWS_ACCESS_KEY_ID": "your-access-key",
"AWS_SECRET_ACCESS_KEY": "your-secret-key"
}
}
}
}
Lists available S3 buckets that the server has permission to access.
Parameters: None
Example output:
[
{
"Name": "my-images-bucket",
"CreationDate": "2022-03-15T10:30:00.000Z"
},
{
"Name": "my-documents-bucket",
"CreationDate": "2023-05-20T14:45:00.000Z"
}
]
Lists objects in a specified S3 bucket.
Parameters:
bucket
(required): Name of the S3 bucketprefix
(optional): Prefix to filter objectsmaxKeys
(optional): Maximum number of objects to returnExample output:
[
{
"Key": "sample.pdf",
"LastModified": "2023-10-10T08:12:15.000Z",
"Size": 2048576,
"StorageClass": "STANDARD"
},
{
"Key": "sample.md",
"LastModified": "2023-10-12T15:30:45.000Z",
"Size": 1536000,
"StorageClass": "STANDARD"
}
]
Retrieves an object from a specified S3 bucket.
Parameters:
bucket
(required): Name of the S3 bucketkey
(required): Key (path) of the object to retrieveExample text output:
This is the content of a text file stored in S3.
It could be JSON, TXT, CSV or other text-based formats.
Example binary output:
Binary content (image/jpeg): base64 data is /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRof...
When using Claude Desktop with the MCP server configured, you can ask it to:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "s3" '{"command":"npx","args":["aws-s3-mcp","--stdio"],"env":{"AWS_REGION":"us-east-1","S3_BUCKETS":"bucket1,bucket2,bucket3","S3_MAX_BUCKETS":"5","AWS_ACCESS_KEY_ID":"your-access-key","AWS_SECRET_ACCESS_KEY":"your-secret-key"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"s3": {
"command": "npx",
"args": [
"aws-s3-mcp",
"--stdio"
],
"env": {
"AWS_REGION": "us-east-1",
"S3_BUCKETS": "bucket1,bucket2,bucket3",
"S3_MAX_BUCKETS": "5",
"AWS_ACCESS_KEY_ID": "your-access-key",
"AWS_SECRET_ACCESS_KEY": "your-secret-key"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"s3": {
"command": "npx",
"args": [
"aws-s3-mcp",
"--stdio"
],
"env": {
"AWS_REGION": "us-east-1",
"S3_BUCKETS": "bucket1,bucket2,bucket3",
"S3_MAX_BUCKETS": "5",
"AWS_ACCESS_KEY_ID": "your-access-key",
"AWS_SECRET_ACCESS_KEY": "your-secret-key"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect