Back to MCP directory
publicPublicdnsLocal runtime

AWS S3

AWS S3操作MCP服务,通过预签名URL提供安全的S3桶访问

article

README

🚀 AWS S3 MCP 服务端

AWS S3 MCP 服务端是一个用于 AWS S3 操作的安全访问服务器,它通过预签名 URL 提供对 S3 存储桶的安全访问,保障数据操作的安全性与便捷性。

🚀 快速开始

环境变量配置

服务器需要以下环境变量:

  • BUCKET_NAME:你的 S3 存储桶名称(必需)
  • REGION:AWS 区域(默认:"ap-southeast-1")

AWS 凭证应通过标准 AWS 凭证配置方法进行配置(环境变量、IAM 角色或 AWS 凭证文件)。

使用与 Claude Desktop

在你的 claude_desktop_config.json 中添加以下内容:

{
  "mcpServers": {
    "aws-ow-s3-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "BUCKET_NAME",
        "-e",
        "REGION",
        "-e",
        "AWS_ACCESS_KEY_ID",
        "-e",
        "AWS_SECRET_ACCESS_KEY",
        "mcp/aws-ow-s3-mcp"
      ],
      "env": {
        "BUCKET_NAME": "<YOUR_BUCKET_NAME>",
        "REGION": "<AWS_REGION>",
        "AWS_ACCESS_KEY_ID": "<YOUR_ACCESS_KEY>",
        "AWS_SECRET_ACCESS_KEY": "<YOUR_SECRET_KEY>"
      }
    }
  }
}

NPX 命令

{
  "mcpServers": {
    "aws-ow-s3-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-aws-ow-s3-mcp"
      ],
      "env": {
        "BUCKET_NAME": "<YOUR_BUCKET_NAME>",
        "REGION": "<AWS_REGION>",
        "AWS_ACCESS_KEY_ID": "<YOUR_ACCESS_KEY>",
        "AWS_SECRET_ACCESS_KEY": "<YOUR_SECRET_KEY>"
      }
    }
  }
}

构建

使用 Docker 构建:

docker build -t mcp/aws-ow-s3-mcp-server .

✨ 主要特性

工具列表

  1. list_objects

    • 功能:列出存储桶中的对象
    • 输入:
      • prefix (字符串,可选):对象键的前缀过滤器
    • 返回:包含键、大小和最后修改日期的对象数组
  2. get_object

    • 功能:为获取对象生成预签名 URL
    • 输入:
      • key (字符串,必需):要检索的对象键
      • expiry (数字,可选):URL 的过期时间(单位:秒,默认:3600)
    • 返回:包含预签名 URL 的 object_url
  3. put_object

    • 功能:为上传对象生成预签名 URL
    • 输入:
      • key (字符串,必需):要上传的对象键
      • expiry (数字,可选):URL 的过期时间(单位:秒,默认:3600)
    • 返回:包含上传 URL 的 upload_url
  4. delete_object

    • 功能:从存储桶中删除对象
    • 输入:
      • key (字符串,必需):要删除的对象键
    • 返回:success 布尔值,指示删除状态

🔧 技术细节

服务器使用以下技术构建:

  • Node.js
  • TypeScript
  • @modelcontextprotocol/sdk
  • @aws-sdk/client-s3
  • @aws-sdk/s3-request-presigner

📄 许可证

该 MCP 服务端根据 MIT License 分发。这意味着你可以自由地使用、修改和分发软件,但需遵守 MIT License 的条款和条件。更多详细信息,请参阅项目仓库中的 LICENSE 文件。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client