Skip to main content
Glama

s3-mcp

一个通用的 S3 协议 MCP 服务器(stdio),可运行于任何 S3 兼容端点之上 — RustFS、MinIO、Cloudflare R2、Backblaze B2、AWS S3 —— 不仅限于 AWS。

单一 Python 包,启动时创建一个 boto3 客户端,配置仅通过环境变量完成。基于官方 mcp SDK(高级服务器 API)和 boto3 构建。

配置(环境变量)

变量

必需

默认值

描述

S3_ENDPOINT_URL

否

无

S3 兼容端点;省略以指向真实 AWS

AWS_REGION

否

us-east-1

用于签名和创建存储桶的区域

AWS_ACCESS_KEY_ID

是

—

访问密钥

AWS_SECRET_ACCESS_KEY

是

—

秘密访问密钥

S3_PATH_STYLE

否

true

路径样式寻址(https://host/bucket/key)—— 大多数非 AWS 存储需要

S3_TLS_INSECURE

否

false

true 时禁用 TLS 证书验证(自签名端点)

布尔值接受 true/false/1/0/yes/no(不区分大小写)。缺少凭据或布尔值无效时,启动会中止并给出清晰错误。

Related MCP server: MinIO MCP Server

工具

工具

只读提示

list_buckets()

是

list_objects(bucket, prefix="", max_keys=1000)

是

get_object(bucket, key) → 若为 UTF-8 则返回文本,否则返回 {base64, content_type}

是

stat_object(bucket, key)

是

presign_get(bucket, key, expires_s=3600)

是

put_object(bucket, key, body, base64=false)

否

delete_object(bucket, key)

否

copy_object(src_bucket, src_key, dst_bucket, dst_key)

否

create_bucket(bucket)

否

delete_bucket(bucket)

否

presign_put(bucket, key, expires_s=3600)

否

工具错误以简短的 RuntimeError 消息抛出,并由 MCP 作为错误结果返回。根据 SigV4 规范,预签名 URL 的上限为 7 天(604800 秒)。

示例配置

使用自签名证书的 RustFS

{
  "mcpServers": {
    "s3-mcp": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "S3_ENDPOINT_URL=https://rustfs.local:9000",
        "-e", "S3_TLS_INSECURE=true",
        "-e", "AWS_REGION=us-east-1",
        "-e", "AWS_ACCESS_KEY_ID",
        "-e", "AWS_SECRET_ACCESS_KEY",
        "ghcr.io/jakeperalta7/s3-mcp:latest"
      ]
    }
  }
}

不带值的 -e VAR 会从 shell 中透传变量,因此凭据绝不会出现在配置文件中。

MinIO

{
  "mcpServers": {
    "s3-mcp": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "S3_ENDPOINT_URL=http://localhost:9000",
        "-e", "AWS_REGION=us-east-1",
        "-e", "AWS_ACCESS_KEY_ID",
        "-e", "AWS_SECRET_ACCESS_KEY",
        "ghcr.io/jakeperalta7/s3-mcp:latest"
      ]
    }
  }
}

AWS S3

省略 S3_ENDPOINT_URL;采用标准的 AWS 凭据/区域解析方式:

{
  "mcpServers": {
    "s3-mcp": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "AWS_REGION",
        "-e", "AWS_ACCESS_KEY_ID",
        "-e", "AWS_SECRET_ACCESS_KEY",
        "ghcr.io/jakeperalta7/s3-mcp:latest"
      ]
    }
  }
}

不使用 Docker(uv)

uvx --from git+https://github.com/JakePeralta7/s3-mcp s3-mcp
{
  "mcpServers": {
    "s3-mcp": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/JakePeralta7/s3-mcp", "s3-mcp"],
      "env": {
        "S3_ENDPOINT_URL": "http://localhost:9000",
        "AWS_ACCESS_KEY_ID": "...",
        "AWS_SECRET_ACCESS_KEY": "..."
      }
    }
  }
}

开发

uv sync --group dev   # install deps into .venv
uv run pytest -q      # unit tests (boto3 mocked, no network)
docker build -t s3-mcp:dev .

入口点:python -m s3_mcp(仅 stdio 传输)。

发布

每次推送到 main 分支都会运行测试,然后发布 ghcr.io/<owner>/<repo>:<version> 和 :latest,其中 <version> 从 pyproject.toml 中的 version 读取。要发布,请提升版本号并合并到 main。不使用 Git 标签。

许可证

MIT

Available Tools

11 tools
copy_objectC

Copy an object within or across buckets on the same endpoint.

Inputs: dst_key (required), src_key (required), dst_bucket (required), src_bucket (required). Returns: object

create_bucketC

Create a bucket in the configured region.

Inputs: bucket (required). Returns: object

delete_bucketA

Delete a bucket (must be empty).

Inputs: bucket (required). Returns: object

delete_objectC

Delete an object from a bucket.

Inputs: key (required), bucket (required). Returns: object

get_objectA
Read-only

Read an object. UTF-8 content returns as text; anything else as base64.

Inputs: key (required), bucket (required). Returns: object

list_bucketsA
Read-only

List all buckets accessible with the configured credentials.

Inputs: no named parameters. Returns: result

list_objectsA
Read-only

List objects in a bucket (single page, up to max_keys).

Returns objects with key/size/last_modified plus a truncated flag when more results exist.

Inputs: bucket (required), prefix, max_keys. Returns: object

presign_getB
Read-only

Generate a pre-signed GET URL valid for expires_s seconds (max 604800).

Inputs: key (required), bucket (required), expires_s. Returns: result

presign_putC

Generate a pre-signed PUT URL valid for expires_s seconds (max 604800).

Inputs: key (required), bucket (required), expires_s. Returns: result

put_objectC

Write an object. Set base64=true when body is base64-encoded binary.

Inputs: key (required), body (required), bucket (required), base64. Returns: object

stat_objectA
Read-only

Get object metadata (size, etag, content type, last modified).

Inputs: key (required), bucket (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 11 tools

    Disambiguation5/5

    Every tool maps to a distinct S3 operation: bucket listing/creation/deletion, object listing/read/metadata/write/delete/copy, and presigned URL generation for GET vs PUT. There is no functional overlap that would cause an agent to select the wrong tool.

    Naming Consistency5/5

    All tool names follow the same snake_case verb_noun pattern (list_buckets, get_object, presign_put, create_bucket, etc.). The naming is predictable and consistent across the entire surface.

    Tool Count5/5

    With 11 tools, the set is well-scoped for an S3-focused server. Each tool covers a core operation without extraneous additions or redundant convenience wrappers.

    Completeness4/5

    The server covers bucket lifecycle and object CRUD, including copying and presigned URLs, so common workflows are fully supported. Minor gaps exist around pagination for large object listings and advanced operations like multipart uploads, but these are not severe for typical usage.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • 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
      -
    • A
      license
      A
      quality
      D
      maintenance
      Enables MCP clients to connect to AWS S3 buckets, list, upload, and read objects in various formats, supporting public and private buckets with multiple transport modes.
      4
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides MCP tools for AWS S3 and S3-compatible storage, enabling file upload, download, listing, deletion, and temporary remote file staging via natural language.
      BSD 3-Clause