AWS S3 MCP server

Provides direct access to Amazon S3 storage for listing buckets, browsing objects, and retrieving file contents with automatic text extraction from PDFs and other file types.
Back to servers
Setup instructions
Provider
Yuichi Kojima
Release date
Mar 15, 2025
Language
TypeScript
Package
Stats
5.0K downloads
14 stars

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.

Installation Options

Prerequisites

  • Node.js 18 or higher
  • npm or yarn
  • AWS credentials configured
  • Docker (optional, for containerized setup)

NPM Installation

# Install globally via npm
npm install -g aws-s3-mcp

# Or as a dependency in your project
npm install aws-s3-mcp

Build from Source

# 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

Configuration

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

Configuration Options

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

Node.js Execution

# 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:

  • Health check: http://localhost:3000/health
  • MCP endpoint: http://localhost:3000/mcp
  • SSE endpoint: http://localhost:3000/sse

Docker Setup

Using Docker CLI

# 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.

Using Docker Compose

# Start the container
docker compose up -d s3-mcp

# View logs
docker compose logs -f s3-mcp

Using Docker with MinIO for Testing

# Start MinIO and the MCP server
docker compose up -d

# Access MinIO console at http://localhost:9001
# Default credentials: minioadmin/minioadmin

Connecting to Claude Desktop

To use this server with Claude Desktop, use STDIO transport mode:

  1. Edit your Claude Desktop configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. 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"
      }
    }
  }
}

Docker Option for Claude Desktop

{
  "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

Troubleshooting Claude Desktop Integration

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"
      }
    }
  }
}

Available Tools

list-buckets

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"
  }
]

list-objects

Lists objects in a specified S3 bucket.

Parameters:

  • bucket (required): Name of the S3 bucket
  • prefix (optional): Prefix to filter objects
  • maxKeys (optional): Maximum number of objects to return

Example 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"
  }
]

get-object

Retrieves an object from a specified S3 bucket.

Parameters:

  • bucket (required): Name of the S3 bucket
  • key (required): Key (path) of the object to retrieve

Example 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...

Usage with Claude

When using Claude Desktop with the MCP server configured, you can ask it to:

  • "List all my S3 buckets"
  • "Summarize PDF files in my-documents-bucket"
  • "Get the README.txt file from my-documents-bucket"

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            }
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later