loading…
Search for a command to run...
loading…
Enables browsing S3 buckets and objects, and generating secure presigned URLs for downloads and uploads, through natural language commands in MCP clients like C
Enables browsing S3 buckets and objects, and generating secure presigned URLs for downloads and uploads, through natural language commands in MCP clients like Claude Desktop.
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!
# 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
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.
@aws-s3 list my buckets📖 Complete guide: QUICKSTART.md
npm install
npm run build
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
The server uses stdio transport and communicates via standard input/output, making it suitable for integration with MCP clients like Claude Desktop.
npm start
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
s3_list_bucketsList all S3 buckets in the AWS account.
Input: None
Example Response:
[
{
"name": "my-bucket",
"creationDate": "2024-01-01T00:00:00.000Z"
}
]
s3_list_objectsList objects in an S3 bucket with optional filtering.
Input:
bucket (required): The name of the S3 bucketprefix (optional): Filter objects by prefixmaxKeys (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
}
s3_presign_getGenerate a presigned URL for downloading an object.
Input:
bucket (required): The name of the S3 bucketkey (required): The object keyexpiresIn (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"
}
s3_presign_putGenerate a presigned URL for uploading an object (requires ALLOW_WRITE=true).
Input:
bucket (required): The name of the S3 bucketkey (required): The object keyexpiresIn (optional): URL expiration time in seconds (default: 3600, max: 604800)contentType (optional): Content type of the objectExample Response:
{
"url": "https://bucket.s3.amazonaws.com/key?X-Amz-Algorithm=...",
"expiresIn": 3600,
"bucket": "my-bucket",
"key": "path/to/file.txt",
"contentType": "application/json"
}
npm run build
npm run dev
npm test
npm run lint
node examples/quick-test.js
node dist/index.jsError: Missing credentials
.env file exists in project root.env (not .env.txt)Error: Access Denied
node examples/quick-test.jsError: Invalid Access Key
ALLOW_WRITE=true in .env fileFor buckets with millions of objects:
"List files in my-bucket with prefix 'logs/2024/'""Show first 100 files in my-bucket"📖 For more troubleshooting, see SETUP_GUIDE.md
✅ DO:
.env file (never commit to git)❌ DON'T:
.env file to version controlaws-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
examples/ directoryContributions are welcome! Please:
MIT
| 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!
Выполни в терминале:
claude mcp add aws-s3-mcp-server -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.