Skip to main content
Glama

s3-mcp

Minimal Model Context Protocol server for S3-compatible storage — AWS S3, RustFS, MinIO, Cloudflare R2, and similar.

  • Path-style addressing by default (required for many self-hosted endpoints whose TLS cert does not cover bucket.endpoint subdomains)

  • Opt-in self-signed / custom-CA TLS trust, scoped to the S3 client only

  • Read-only by default; writes require an explicit flag

  • Optional bucket allow-list

  • Env vars + CLI flag overrides; secrets stay env-only

Tools

Tool

Access

Description

s3_list_buckets

read

List buckets

s3_list_objects

read

List objects (prefix, delimiter, pagination). Listing does not return user metadata — use s3_head_object.

s3_head_object

read

Size, ETag, content-type, user metadata

s3_read_object

read

Read body via a capped Range request (encoding: auto | utf8 | base64)

s3_put_object

write

Upload text or base64 content

s3_delete_object

write

Delete object (idempotent: missing key → success)

Write tools refuse with a clear error unless S3_ALLOW_WRITE=true (or --allow-write).

Related MCP server: S3 MCP Server

Install / run

{
  "mcpServers": {
    "s3": {
      "command": "npx",
      "args": ["-y", "s3-mcp"],
      "env": {
        "S3_ENDPOINT": "https://rustfs.example.com",
        "S3_ACCESS_KEY_ID": "<key>",
        "S3_SECRET_ACCESS_KEY": "<secret>",
        "S3_REGION": "us-east-1",
        "S3_ALLOW_SELF_SIGNED": "true"
      }
    }
  }
}

A bare --stdio arg is accepted and ignored (drop-in compatible with configs written for s3-mcp-server).

npx straight from GitHub

{
  "mcpServers": {
    "s3": {
      "command": "npx",
      "args": ["-y", "github:tompetk/s3-mcp"],
      "env": {
        "S3_ENDPOINT": "https://rustfs.example.com",
        "S3_ACCESS_KEY_ID": "<key>",
        "S3_SECRET_ACCESS_KEY": "<secret>",
        "S3_REGION": "us-east-1",
        "S3_ALLOW_SELF_SIGNED": "true"
      }
    }
  }
}

Keep -y: without it npx asks for install confirmation on stdin, which is the MCP transport, so the server never starts. The first run takes roughly 40 seconds because npm installs TypeScript and runs the prepare build; later runs use the npx cache. The published npm package ships prebuilt dist/, so ["-y", "s3-mcp"] starts instantly.

From source

git clone https://github.com/tompetk/s3-mcp.git
cd s3-mcp
npm install
npm run build
node dist/index.js --help

Point your MCP client at node + the absolute path to dist/index.js.

Configuration examples

RustFS / MinIO (self-hosted, often self-signed)

{
  "mcpServers": {
    "s3": {
      "command": "npx",
      "args": ["-y", "s3-mcp", "--insecure"],
      "env": {
        "S3_ENDPOINT": "https://rustfs.example.com",
        "S3_ACCESS_KEY_ID": "<key>",
        "S3_SECRET_ACCESS_KEY": "<secret>",
        "S3_REGION": "us-east-1",
        "S3_FORCE_PATH_STYLE": "true",
        "S3_ALLOW_WRITE": "false"
      }
    }
  }
}

Prefer a custom CA when you have one:

S3_CA_BUNDLE=/path/to/ca.pem

--insecure / S3_ALLOW_SELF_SIGNED=true disables certificate verification for this client only (never sets NODE_TLS_REJECT_UNAUTHORIZED). Prefer S3_CA_BUNDLE when possible.

Cloudflare R2

{
  "mcpServers": {
    "s3": {
      "command": "npx",
      "args": ["-y", "s3-mcp", "--no-path-style"],
      "env": {
        "S3_ENDPOINT": "https://<ACCOUNT_ID>.r2.cloudflarestorage.com",
        "S3_ACCESS_KEY_ID": "<key>",
        "S3_SECRET_ACCESS_KEY": "<secret>",
        "S3_REGION": "auto"
      }
    }
  }
}

Environment variables & flags

Env

Flag

Default

Notes

S3_ENDPOINT

--endpoint

(required)

S3 API URL

S3_ACCESS_KEY_ID

—

(required)

Env only (argv is visible in ps)

S3_SECRET_ACCESS_KEY

—

(required)

Env only

S3_REGION

--region

us-east-1

Use auto for R2

S3_FORCE_PATH_STYLE

--path-style / --no-path-style

true

Path-style is the safe default for self-hosted

S3_ALLOW_SELF_SIGNED

--insecure

false

Skip TLS verify (logs a stderr warning)

S3_CA_BUNDLE

--ca-bundle

—

PEM file to trust

S3_ALLOW_WRITE

--allow-write

false

Enable put/delete

S3_ALLOWED_BUCKETS

--bucket (repeatable)

—

Comma-separated allow-list

S3_MAX_READ_BYTES

--max-read-bytes

262144

Cap for s3_read_object

—

--stdio

—

Accepted, ignored

—

--help / --version

—

CLI flags override env vars.

Security

  • Read-only by default. Pointing this at production buckets without S3_ALLOW_WRITE cannot mutate data via the MCP tools.

  • Bucket allow-list. Set S3_ALLOWED_BUCKETS=prod-logs,prod-artifacts (or repeat --bucket) so the agent cannot touch other buckets the credentials can see.

  • TLS. Prefer S3_CA_BUNDLE over --insecure. Self-signed mode is convenient for lab endpoints; it is not a substitute for trusting the right CA.

  • Secrets. Keep keys in the MCP client's env block or a secret store — never commit them. .env is gitignored; use .env.example as a template for local smoke tests.

Development

npm install
npm run build
npm run typecheck

# Live round-trip (creates a throwaway bucket unless S3_BUCKET is set)
export S3_ENDPOINT=https://rustfs.example.com
export S3_ACCESS_KEY_ID=...
export S3_SECRET_ACCESS_KEY=...
npm run smoke

# Read-only credentials (list + head + ranged get)
S3_SMOKE_READ_ONLY=true S3_BUCKET=test npm run smoke

Publishing

Tags matching v* trigger GitHub Actions to build and npm publish --provenance --access public. Add an NPM_TOKEN repository secret once.

git tag v1.0.0
git push origin v1.0.0

License

MIT

Available Tools

6 tools
s3_delete_objectDelete S3 objectA
Destructive

Delete an object. Requires S3_ALLOW_WRITE=true. Idempotent: missing keys (NoSuchKey/404) are treated as success.

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

s3_head_objectHead S3 objectA
Read-only

Fetch object metadata without downloading the body (size, ETag, content-type, user metadata).

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

s3_list_bucketsList S3 bucketsA
Read-only

List all available S3 buckets visible to the configured credentials.

Inputs: no named parameters.

s3_list_objectsList S3 objectsA
Read-only

List objects in a bucket. Optional prefix/delimiter for folder-style browsing. Note: S3 ListObjectsV2 does not return user metadata — use s3_head_object for that.

Inputs: bucket (required), prefix, maxKeys, delimiter, +1 more.

s3_put_objectPut S3 objectA
Destructive

Upload object content. Requires S3_ALLOW_WRITE=true. Pass encoding=base64 to upload binary data from a base64 string.

Inputs: key (required), bucket (required), content (required), encoding, +2 more.

s3_read_objectRead S3 objectA
Read-only

Read object content. Uses a Range request capped by maxBytes so large objects never stream in full. encoding=auto returns UTF-8 text when decodable, otherwise base64.

Inputs: key (required), bucket (required), encoding, maxBytes.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct S3 operation: listing buckets, listing objects, fetching metadata, reading content, uploading, and deleting. The descriptions explicitly clarify the tricky boundary between s3_head_object (metadata only) and s3_read_object (content), and between s3_list_objects and s3_head_object regarding user metadata.

    Naming Consistency5/5

    Every tool follows the same predictable `s3_verb_noun` snake_case pattern (s3_list_buckets, s3_read_object, s3_put_object, etc.). No mixed conventions or vague verbs.

    Tool Count5/5

    Six tools is well-scoped for a focused S3 object-access server, covering the core read/write lifecycle without bloat. Each tool earns its place with a non-overlapping job.

    Completeness4/5

    Core object lifecycle is covered: list buckets, list objects, head, read, put, delete. Minor gaps exist — no bucket create/delete, no copy_object, and no multi-object delete — but agents can work around these for typical object read/write tasks.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to manage MinIO object storage through comprehensive bucket operations, file uploads/downloads, batch processing, permissions management, and URL generation. Supports both automatic and manual connection modes with flexible authentication options.
      19
      36 npm
      2
      MIT
    • 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
      27 npm
      ISC
    • A
      license
      Not graded
      quality
      D
      maintenance
      It Integration for MinIO / S3-compatible object storage, providing AI assistants with direct access to bucket management, object CRUD, presigned URLs, policies, lifecycle rules, and storage analytics.
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables LLM agents to interact with MinIO/S3 object storage, supporting bucket and object operations like listing, reading, writing, and generating presigned URLs.
      1
      -