S3 MCP Server

S3 MCP Server

⚙️ A Model Context Protocol (MCP) server for accessing Amazon S3 buckets. This server provides seamless integration with S3 storage through MCP, allowing efficient handling of large files including PDFs through streaming capabilities.

Geun-Oh

云存储
访问服务器

README

S3 MCP Server

A Model Context Protocol (MCP) server for accessing Amazon S3 buckets. This server provides seamless integration with S3 storage through MCP, allowing efficient handling of large files including PDFs through streaming capabilities.

Features

  • S3 bucket object listing with prefix filtering
  • Efficient large file handling through streaming
  • Secure AWS credentials management
  • TypeScript support
  • CLI interface with customizable options

Installation

npx -y @geunoh/s3-mcp-server

Usage

Command Line Options

npx -y @geunoh/s3-mcp-server [options]

Options:

  • --port, -p: Server port (default: 3000)
  • --region, -r: AWS region (default: ap-northeast-2)
  • --bucket, -b: S3 bucket name (default: my-dancing-bucket)

Environment Variables

Required:

export AWS_ACCESS_KEY_ID="your_access_key"
export AWS_SECRET_ACCESS_KEY="your_secret_key"

Optional:

export AWS_REGION="ap-northeast-2"
export S3_BUCKET_NAME="my-bucket-name"

MCP Integration

Add to your mcp.json:

{
  "mcpServers": {
    "s3-mcp-server": {
      "command": "npx",
      "args": ["-y", "@geunoh/s3-mcp-server"],
      "env": {
        "AWS_ACCESS_KEY_ID": "YOUR_AWS_ACCESS_KEY_ID",
        "AWS_SECRET_ACCESS_KEY": "YOUR_AWS_SECRET_ACCESS_KEY",

        // optional
        "AWS_REGION": "ap-northeast-2",
        "S3_BUCKET_NAME": "my-bucket-name",
      }
    }
  }
}

Available MCP Functions

listObjects

Lists objects in the S3 bucket.

Parameters:

  • prefix (optional): Filter objects by prefix

getObject

Retrieves an object from the S3 bucket. Optimized for large files through streaming.

Parameters:

  • key: The key of the object to retrieve

Returns:

  • stream: ReadableStream of the object content
  • contentType: MIME type of the object
  • contentLength: Size of the object in bytes
  • lastModified: Last modification timestamp
  • text: Text buffer of raw pdf ByteArray

AWS IAM Permissions

Minimum required permissions (see s3-policy.json):

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket",
                "s3:GetObject"
            ],
            "Resource": "arn:aws:s3:::my-bucket-name"
        }
    ]
}

Development

  1. Clone the repository:
git clone https://github.com/Geun-Oh/s3-mcp-server.git
cd s3-mcp-server
  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Run locally:
node dist/cli.js

Project Structure

.
├── src/              # TypeScript source files
├── dist/            # Compiled JavaScript files and runtime dependencies
├── tsconfig.json    # TypeScript configuration
└── package.json     # Project configuration and dependencies

Deployment

  1. Create a new version tag:
npm version patch
  1. Push to npm registry:
npm publish --access public

The GitHub Actions workflow will automatically publish the package when a new version tag is pushed.

License

MIT

Contributing

Issues and pull requests are welcome. Please ensure that your changes maintain the existing code style and include appropriate tests.

推荐服务器

Google Drive MCP Server

Google Drive MCP Server

启用与 Google Drive 的集成,用于列出、读取和搜索文件,支持各种文件类型,并为 Google Workspace 文件提供自动导出功能。

本地
JavaScript
AWS MCP Server

AWS MCP Server

一个模型上下文协议服务器实现,使 Claude 能够通过自然语言命令在 S3 和 DynamoDB 服务上执行 AWS 操作。

本地
Python
Google Drive MCP Server

Google Drive MCP Server

与 Google Drive 集成,以实现文件列表、搜索和读取,以及 Google 表格的读取和写入。

本地
TypeScript
Azure MCP Server

Azure MCP Server

这个服务器实现了模型上下文协议,可以与 Azure Blob 存储和 Cosmos DB 无缝交互,从而实现操作的自动日志记录和审计跟踪。

Python
Box MCP Server

Box MCP Server

Box MCP 服务器方便使用开发者令牌认证在 Box 中搜索和读取 PDF 和 Word 文件。

JavaScript
MCP JSON Document Collection Server

MCP JSON Document Collection Server

一个模型上下文协议服务器,允许创建和管理多个 Fireproof JSON 数据库,具备 CRUD 操作、查询功能以及云同步能力,以便与他人共享数据库。 (Breakdown of the translation:) * **一个模型上下文协议服务器 (Yī gè móxíng shàngxiàwén xiéyì fúwùqì):** A Model Context Protocol server * **允许 (yǔnxǔ):** allows * **创建和管理 (chuàngjiàn hé guǎnlǐ):** creation and management * **多个 (duō gè):** multiple * **Fireproof JSON 数据库 (Fireproof JSON shùjùkù):** Fireproof JSON databases * **具备 (jùbèi):** with, possesses * **CRUD 操作 (CRUD cāozuò):** CRUD operations (Create, Read, Update, Delete) * **查询功能 (cháxún gōngnéng):** querying capabilities * **以及 (yǐjí):** and * **云同步能力 (yún tóngbù nénglì):** cloud synchronization capability * **以便 (yǐbiàn):** in order to * **与他人共享 (yǔ tārén gòngxiǎng):** sharing with others * **数据库 (shùjùkù):** databases

JavaScript
Unstructured Document Processor MCP

Unstructured Document Processor MCP

一个模型上下文协议服务器,它使大型语言模型能够从各种文件格式的非结构化文档中提取和使用内容。

Python
Firebase MCP Server

Firebase MCP Server

一个提供统一接口以与 Firebase 服务(包括身份验证、Firestore 和存储)交互的服务器。

TypeScript
MCP Server for Apache OpenDAL™

MCP Server for Apache OpenDAL™

一个模型上下文协议服务器,通过 Apache OpenDAL™ 提供对包括 S3、Azure Blob 存储和 Google Cloud Storage 在内的多个存储服务的无缝访问。

Python
Cloudinary MCP Server

Cloudinary MCP Server

这个服务器提供了一些工具,可以使用 Claude/Cline 直接将图片和视频上传到 Cloudinary,从而方便资源管理,并提供可定制的选项,例如资源类型和公共 ID。

JavaScript