Skip to main content
Glama
khuynh22

AWS S3 MCP Server

by khuynh22

AWS S3 MCP Server

A Model Context Protocol (MCP) server that exposes AWS S3 operations through a secure, well-defined interface. This server provides tools for listing buckets and objects, and generating presigned URLs for safe data access.

Perfect for integrating S3 with Claude Desktop and other MCP clients!

Features

  • List Buckets: Enumerate all S3 buckets in your AWS account

  • List Objects: Browse objects within a bucket with optional prefix filtering

  • Presigned GET URLs: Generate secure, temporary URLs for downloading objects

  • Presigned PUT URLs: Generate secure, temporary URLs for uploading objects (optional, requires ALLOW_WRITE flag)

  • Input Validation: All inputs are validated using Zod schemas

  • Logging: Structured logging with Pino

  • Safe by Default: Write operations are disabled unless explicitly enabled

  • Cross-Platform: Works on Windows, Mac, and Linux

Related MCP server: S3 MCP Server

šŸš€ Quick Start

Fastest Setup

# 1. Install and build
npm install
npm run build

# 2. Configure AWS credentials
cp .env.example .env
# Edit .env with your AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION

# 3. Test connection
node examples/quick-test.js

4. Add to Your MCP Client

For Claude Desktop - Edit claude_desktop_config.json:

{
  "mcpServers": {
    "aws-s3": {
      "command": "node",
      "args": ["/absolute/path/to/aws-s3-mcp-server/dist/index.js"]
    }
  }
}

For VS Code - Edit ~/.vscode/mcp.json:

{
  "servers": {
    "aws-s3": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/aws-s3-mcp-server/dist/index.js"]
    }
  }
}

Replace the path with your actual installation directory.

5. Test It

  • Claude Desktop: Restart → Ask "List my S3 buckets"

  • VS Code: Reload window → @aws-s3 list my buckets

šŸ“– Complete guide: QUICKSTART.md

Documentation

  • Setup Guide - Complete installation and configuration instructions

  • Usage Guide - How to use with Claude Desktop and examples

  • Examples - Sample scripts for download/upload operations

Installation

npm install
npm run build

Configuration

Create a .env file in the root directory (see .env.example):

# Required
AWS_ACCESS_KEY_ID=your_access_key_here
AWS_SECRET_ACCESS_KEY=your_secret_key_here
AWS_REGION=us-east-1

# Optional: Enable write operations (presign_put)
ALLOW_WRITE=false

# Optional: Set log level (default: info)
LOG_LEVEL=info

šŸ“– For detailed setup instructions, see SETUP_GUIDE.md

Usage

The server uses stdio transport and communicates via standard input/output, making it suitable for integration with MCP clients like Claude Desktop.

Running Standalone

npm start

Common Operations

List all buckets:

"Show me all my S3 buckets"

List objects in a bucket:

"List all files in my-data-bucket"

Get download link:

"Give me a download link for report.pdf in my-docs-bucket"

Get upload link (if ALLOW_WRITE=true):

"Generate an upload URL for new-file.json in my-bucket"

šŸ“– For complete usage examples, see USAGE_GUIDE.md

Available Tools

1. s3_list_buckets

List all S3 buckets in the AWS account.

Input: None

Example Response:

[
  {
    "name": "my-bucket",
    "creationDate": "2024-01-01T00:00:00.000Z"
  }
]

2. s3_list_objects

List objects in an S3 bucket with optional filtering.

Input:

  • bucket (required): The name of the S3 bucket

  • prefix (optional): Filter objects by prefix

  • maxKeys (optional): Maximum number of objects to return (1-1000)

Example Response:

{
  "objects": [
    {
      "key": "path/to/file.txt",
      "size": 1024,
      "lastModified": "2024-01-01T00:00:00.000Z",
      "etag": "\"abc123\""
    }
  ],
  "isTruncated": false,
  "keyCount": 1
}

3. s3_presign_get

Generate a presigned URL for downloading an object.

Input:

  • bucket (required): The name of the S3 bucket

  • key (required): The object key

  • expiresIn (optional): URL expiration time in seconds (default: 3600, max: 604800)

Example Response:

{
  "url": "https://bucket.s3.amazonaws.com/key?X-Amz-Algorithm=...",
  "expiresIn": 3600,
  "bucket": "my-bucket",
  "key": "path/to/file.txt"
}

4. s3_presign_put

Generate a presigned URL for uploading an object (requires ALLOW_WRITE=true).

Input:

  • bucket (required): The name of the S3 bucket

  • key (required): The object key

  • expiresIn (optional): URL expiration time in seconds (default: 3600, max: 604800)

  • contentType (optional): Content type of the object

Example Response:

{
  "url": "https://bucket.s3.amazonaws.com/key?X-Amz-Algorithm=...",
  "expiresIn": 3600,
  "bucket": "my-bucket",
  "key": "path/to/file.txt",
  "contentType": "application/json"
}

Development

Build

npm run build

Watch Mode

npm run dev

Run Tests

npm test

Lint

npm run lint

Quick Connection Test

node examples/quick-test.js

Troubleshooting

Server Not Responding in Claude

  1. Check Claude Desktop logs: Help → Show Logs

  2. Verify the server path in config is correct (use absolute path)

  3. Test manually: node dist/index.js

  4. Restart Claude Desktop

AWS Connection Issues

Error: Missing credentials

  • Verify .env file exists in project root

  • Check no extra spaces in environment variables

  • Ensure file is named exactly .env (not .env.txt)

Error: Access Denied

  • Verify IAM user has S3 permissions

  • Check the bucket exists in the specified region

  • Test credentials: node examples/quick-test.js

Error: Invalid Access Key

  • Verify AWS_ACCESS_KEY_ID is correct

  • Check AWS_SECRET_ACCESS_KEY matches

  • Ensure credentials haven't been rotated/deleted

Write Operations Not Working

  • Set ALLOW_WRITE=true in .env file

  • Restart the MCP server

  • Verify IAM user has PutObject permission

Performance Issues

For buckets with millions of objects:

  • Use prefix filtering: "List files in my-bucket with prefix 'logs/2024/'"

  • Limit results: "Show first 100 files in my-bucket"

  • Organize files with prefixes (like folders)

šŸ“– For more troubleshooting, see SETUP_GUIDE.md

Security Best Practices

āœ… DO:

  • Store credentials in .env file (never commit to git)

  • Use IAM users with minimal required permissions

  • Disable ALLOW_WRITE unless needed

  • Use short expiration times for presigned URLs

  • Rotate access keys regularly

āŒ DON'T:

  • Share presigned URLs publicly

  • Use root AWS account credentials

  • Commit .env file to version control

  • Grant broader permissions than necessary

Project Structure

aws-s3-mcp-server/
ā”œā”€ā”€ dist/                 # Compiled JavaScript (generated)
ā”œā”€ā”€ src/                  # TypeScript source code
│   ā”œā”€ā”€ index.ts         # Main MCP server
│   └── index.test.ts    # Unit tests
ā”œā”€ā”€ examples/            # Example scripts and usage
│   ā”œā”€ā”€ quick-test.js    # AWS connection test
│   ā”œā”€ā”€ test-upload.ps1  # Upload example
│   └── test-download.ps1 # Download example
ā”œā”€ā”€ .env.example         # Environment template
ā”œā”€ā”€ package.json         # Dependencies
ā”œā”€ā”€ tsconfig.json        # TypeScript config
ā”œā”€ā”€ README.md           # This file
ā”œā”€ā”€ SETUP_GUIDE.md      # Installation guide
└── USAGE_GUIDE.md      # Usage examples

Security

  • AWS credentials are loaded from environment variables only

  • Write operations (presigned PUT URLs) are disabled by default

  • All inputs are validated using Zod schemas

  • Presigned URLs have configurable expiration (max 7 days)

  • Logs are written to stderr to avoid interfering with stdio transport

Support

  • Issues: Report bugs or request features on GitHub

  • Setup Help: See SETUP_GUIDE.md

  • Usage Help: See USAGE_GUIDE.md

  • Examples: Check the examples/ directory

Contributing

Contributions are welcome! Please:

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Add tests if applicable

  5. Submit a pull request

License

MIT


Quick Reference

Task

Command

Install

npm install

Build

npm run build

Test AWS

node examples/quick-test.js

Start Server

npm start

Run Tests

npm test

Development Mode

npm run dev

Need Help? Start with SETUP_GUIDE.md for installation or USAGE_GUIDE.md for examples!

Available Tools

3 tools
s3_list_bucketsA

List all S3 buckets in the AWS account

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description alone must disclose behavioral traits. It only states the operation without mentioning required permissions (e.g., s3:ListAllMyBuckets), potential pagination, return value structure, or whether it is read-only. This leaves significant behavioral ambiguity for an AI agent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that communicates the exact operation without any redundant words. It is appropriately sized for a tool with no parameters, and every word earns its place. This is a model of conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, no output schema, no annotations), the description states the core action but omits non-obvious context such as required IAM permissions, the exact return format (list of bucket names?), and when to prefer this over s3_list_objects. It is minimally complete but leaves gaps that could affect an agent's ability to use it confidently.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the schema confirms this with an empty properties object. Since there are no parameters to document, the description bears no responsibility for parameter semantics. The baseline of 4 applies because the absence of parameters makes the tool trivially simple in this dimension.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and resource ('all S3 buckets in the AWS account'), making it unmistakable and differentiating it from sibling tools like s3_list_objects (which targets objects within a bucket) and s3_presign_get (which presigns a URL). The scope is precise and the verb is action-oriented.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus the sibling tools. It doesn't mention scenarios like enumerating all buckets before selecting one, nor does it exclude alternatives. The purpose is inferable from the name, but explicit usage context is entirely missing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

s3_list_objectsA

List objects in an S3 bucket with optional prefix filtering

ParametersJSON Schema
NameRequiredDescriptionDefault
bucketYesThe name of the S3 bucket
prefixNoOptional prefix to filter objects
maxKeysNoMaximum number of keys to return (1-1000)

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It states the core operation but omits details like pagination, truncation, sorting, access requirements, or error behavior. The description is too minimal to fully inform an agent of what to expect.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, informative sentence that delivers the core information without any unnecessary words or repetition. It is front-loaded and efficiently structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is relatively simple and the schema covers parameters, but there is no output schema and no annotations. The description does not mention return format, pagination, or other behavioral context, leaving notable gaps for an agent. Adequate for a basic list operation but incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the parameters are already well-documented. The description adds little beyond the schema, only mentioning 'optional prefix filtering' which repeats the prefix parameter. Baseline 3 applies when schema covers everything.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('List') and resource ('objects in an S3 bucket') and mentions optional prefix filtering, clearly distinguishing it from siblings like s3_list_buckets and s3_presign_get.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool (listing objects with optional filtering) but does not explicitly contrast it with alternatives or state when not to use it. No sibling tool comparison or usage exclusions are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

s3_presign_getA

Generate a presigned URL for downloading an object from S3

ParametersJSON Schema
NameRequiredDescriptionDefault
keyYesThe object key
bucketYesThe name of the S3 bucket
expiresInNoURL expiration time in seconds (default: 3600, max: 604800)

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action, but does not mention permissions required, side effects (e.g., no object modification), whether object existence is validated, or what the returned URL contains. Minimal behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence that precisely communicates the tool's function without any filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple with detailed schema, but no output schema is present and the description does not explicitly state that the return value is the presigned URL string. However, given the low complexity and clear purpose, it is minimally complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All three parameters (bucket, key, expiresIn) are fully described in the schema with defaults and max for expiresIn. The description adds no additional parameter meaning beyond what the schema provides, matching the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the specific action: 'Generate a presigned URL for downloading an object from S3.' It identifies the resource (S3 object), the operation (presign for download), and is distinct from sibling list tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use guidance or mention of alternatives, but the sibling tools (s3_list_buckets, s3_list_objects) are semantically different, making the intended use case for generating downloadable links implied. The description does not provide exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv1.0.0
    • First observeds3_list_buckets
    • First observeds3_list_objects
    • First observeds3_presign_get

TDQS

A3.6/5.0
Disambiguation5/5

Each tool targets a distinct S3 resource and action: listing buckets, listing objects, and generating a presigned GET URL. No overlap or ambiguity between them.

Naming Consistency5/5

All tools follow a consistent s3_verb_noun pattern, using clear, lowercase snake_case. The naming uniformly indicates the service and the operation.

Tool Count4/5

Three tools is a compact set, slightly on the low side, but reasonable for a focused S3 access server. Each tool serves a distinct, useful function without redundancy.

Completeness2/5

The server only supports listing and presigned downloads, lacking any write or delete operations. For a general S3 server, this is notably incomplete; it appears read-only, which may be acceptable for a narrow use case but leaves significant functional gaps.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables interaction with S3-compatible storage services like AWS S3 and Cloudflare R2, supporting bucket management, object listing, reading, uploading, and deletion operations.
    5
    351
    ISC
  • A
    license
    Not graded
    quality
    F
    maintenance
    Enables interaction with AWS S3 through MCP, supporting bucket and object management, lifecycle configurations, tagging, policies, CORS settings, presigned URLs, and file uploads/downloads.
    3
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Provides tools for interacting with MinIO and S3-compatible object storage through MCP clients like Claude. It enables comprehensive bucket and object management, including listing, creating, uploading, and generating presigned URLs.
    13
    2
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/khuynh22/aws-s3-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server