The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the HybridS3 listing page.
Lightweight object storage that speaks S3 (boto3/AWS SDK compatible), plain HTTP, and MCP. SQLite for metadata, flat files on disk.
Most self-hosted S3-compatible storage is designed for large-scale deployments. Distributed erasure coding, IAM policies, WORM compliance, full web consoles — useful if you're running a cloud, overkill if you just want a place to put files that various services and AI agents can read and write.
AWS Sig V4 breaks behind reverse proxy path prefixes. Most implementations verify signatures using the full original upstream path. Put them behind nginx at /storage/, nginx strips the prefix, the server sees /bucket/key instead of /storage/bucket/key, the signature check fails. HybridS3 has a path_prefix config option — set it to /storage and all routes move under that prefix. No path stripping, no special proxy headers. boto3's signed path matches what the server sees.
Three interfaces, one service. boto3 works out of the box. Plain HTTP with curl works. AI agents connect via MCP and get structured tool definitions. No separate services for different clients.
Buckets are configuration, not state. There is no API to create or delete buckets. They live in the YAML config file. You always know exactly what exists, it's version-controlled, and there are no surprise buckets accumulating garbage.
TTL expiry is built in. Set ttl: 24h on a bucket and objects expire automatically after their last write. No lifecycle policies, no cron jobs, no separate process.
Readable and modifiable. Small enough to understand in an afternoon.
The container expects:
/config/config.yaml/data8080Runs as UID 1000.
docker run:
docker-compose:
Each bucket has two keys defined in config:
| Config field | Role | Keep secret? |
|---|---|---|
key | The private key. Used to authenticate Bearer requests and to sign S3 signatures. Never transmitted — only used locally to compute or verify HMACs. | Yes |
public_key | The public identifier. Used as aws_access_key_id in S3 auth and appears in presigned URL Credential= fields. Grants nothing on its own. | No — safe to share |
The split is what makes presigned URLs work safely. A presigned URL must embed an identifier in the Credential= field so the server knows which key to verify against — that identifier is the public_key. Since it is non-secret, having it in the URL is fine. The private key signs the URL on the server and never appears in it.
The master_key is a cross-bucket credential that works on every bucket for every operation, without needing individual bucket keys. Two situations call for it:
list_bucketsThe master_public_key is the non-secret identifier that pairs with master_key in S3 auth (used as aws_access_key_id).
Do not embed the master key in client-facing code. Use per-bucket keys for that — they limit access to exactly one bucket.
| Setting | GET / HEAD / LIST | PUT | DELETE / presign |
|---|---|---|---|
public: true | no authentication required | bucket key, master key, or valid presigned PUT | bucket key or master key |
public: false | bucket key, master key, or valid presigned GET | bucket key, master key, or valid presigned PUT | bucket key or master key |
HTTP requests authenticate using a Bearer token in the Authorization header. Pass the bucket's private key, or the master key for cross-bucket operations.
GET /) — master key lists all buckets; bucket key lists only its own bucket.POST /presign/...) — requires the bucket key or master key.| Method | Path | Auth | Description |
|---|---|---|---|
GET | /health | none | Returns {"status":"ok"} |
GET | / | master or bucket key | List buckets — master key lists all, bucket key lists only its own |
HEAD | /{bucket} | read | Check if bucket exists — 200 or 404 |
PUT | /{bucket} | write | S3 compatibility no-op: 200 if bucket exists in config, 404 if not |
GET | /{bucket} | read | List objects in bucket |
PUT | /{bucket}/{key} | write | Upload object |
GET | /{bucket}/{key} | read | Download object |
HEAD | /{bucket}/{key} | read | Object metadata — no body |
DELETE | /{bucket}/{key} | write | Delete object — returns 204 even if it does not exist |
POST | /presign/{bucket}/{key} | write | Generate a presigned URL (GET or PUT, see method query param) |
POST | /mcp/ | per-tool | MCP Streamable HTTP endpoint |
PUT /{bucket} exists purely for S3 client compatibility. boto3 sends a create_bucket call before any operation, which maps to this endpoint. HybridS3 treats it as a no-op — no buckets are created or modified.
Listing objects accepts prefix and max-keys query parameters:
Upload returns an ETag header (MD5 of the file content). GET and HEAD also return ETag, Last-Modified, and Content-Length.
Keys support nested paths using /. Parent directories are created automatically on write and pruned when empty on delete.
Requests that include an AWS Sig V4 Authorization header receive S3-compatible XML responses. All other requests receive JSON. Error responses include an "error" field and a "request_id" field.
Every response includes X-Request-Id for log correlation and X-Content-Type-Options: nosniff.
S3 clients authenticate using AWS Signature V4. The client signs each request using the bucket's public_key as aws_access_key_id and the bucket's private key as aws_secret_access_key. The resulting Authorization header contains the access key ID in plaintext in the Credential= field, and the computed HMAC in Signature=. The private key is never transmitted — it is only used locally to compute the signature.
HybridS3 reads the access key ID from Credential=, finds the bucket with that public_key, then re-derives the expected signature using that bucket's private key and compares it to the one in the header. The access key ID alone grants nothing — the signature must match.
An MCP server runs at /mcp/ using the Streamable HTTP transport. AI agents connect via any MCP-compatible client and receive structured tool definitions with typed inputs and outputs.
The /mcp/ endpoint accepts an optional token to authenticate the connection before any tool is invoked. Use the master key for full access, or a bucket key to limit the connection to that bucket's scope. The token is validated against the master key and all bucket keys.
Two methods are accepted:
Authorization header — for clients that support custom headers (e.g. Claude Code):
Query parameter — for clients that cannot set custom headers (e.g. ChatGPT):
If a token is provided and does not match any known key, the request is rejected with 401. If no token is provided at all, the request passes through and per-tool auth applies.
Each tool that operates on a bucket accepts an auth_key parameter — the bucket's private key or the master key. This is checked independently of endpoint-level auth and controls what each individual tool call is allowed to do.
| Tool | Auth required | Description |
|---|---|---|
upload_object | bucket key or master key | Upload text or base64-encoded binary. Content type auto-detected if not specified. |
download_object | bucket key or master key (private buckets only) | Download object content. Returns text or base64-encoded binary. Objects over 50 MB cannot be downloaded via MCP — use the HTTP API directly. |
delete_object | bucket key or master key | Delete an object. |
list_objects | bucket key or master key (private buckets only) | List objects with optional prefix filter. Default 100 results, max 1000. |
list_buckets | master key or bucket key | Master key lists all buckets. Bucket key lists only that bucket. |
object_info | bucket key or master key (private buckets only) | Get object metadata (size, content type, ETag, expiry time) without downloading the content. |
presign_url | bucket key or master key | Generate a shareable URL. Pass method="GET" (default) or method="PUT". GET on a public bucket returns a plain URL; everything else is a signed expiring URL. |
All tools return structured output (structuredContent) for clients that support it, with a plain text fallback.
The skill works in any agent that reads .agents/skills/, and installs natively in the clients below.
Claude Code prompts for the HybridS3 URL and, if the endpoint requires connection-level auth, the bucket/master key — the key is stored in your OS keychain.
Installed via the marketplace, the skill invokes as $hybrids3:hybrids3. Codex also picks the skill up automatically, no install required, in any repo containing .agents/skills/ — there it invokes as plain $hybrids3.
The skill is published to ClawHub on every release:
For MCP clients that speak local stdio, the @psyb0t/hybrids3 plugin bridges to the service's /mcp/ endpoint:
Then set HYBRIDS3_URL (and HYBRIDS3_KEY if your endpoint requires connection-level auth).
Presigned URLs allow anyone with the link to read or write a specific object for a limited time, without sending an Authorization header. The /presign/{bucket}/{key} endpoint supports two methods via the method query parameter:
method=GET (default) — recipient can download the object.method=PUT — recipient can upload (overwrite) the object.A presigned URL is bound to its HTTP verb. A GET URL cannot be used to PUT and vice versa — the signature includes the method in its canonical request.
Expiry range: 1 second to 604800 seconds (7 days). Default: 3600. Expired or tampered URLs return 403.
Private bucket — generates an AWS Sig V4 presigned URL. The server signs the URL using the bucket's private key, which never appears in the URL. The URL contains the public_key in the Credential= field and the HMAC in X-Amz-Signature.
Public bucket — returns a plain URL with no signature and no expiry, since GET on public buckets requires no auth anyway.
Use method=PUT to hand someone a URL that lets them upload a specific key without seeing your bucket key. Public buckets are not a shortcut here — anonymous reads are allowed, anonymous writes never are — so a presigned PUT URL is always signed, even for public buckets.
The bucket's max_file_size is enforced server-side during the upload; oversized bodies are rejected with 413 regardless of how the request was authenticated.
With boto3:
Generating a presigned URL requires the bucket's private key or the master key. The resulting URL grants exactly one action (GET or PUT) on exactly one key.
Both the /presign/ HTTP endpoint and the presign_url MCP tool follow this same logic — pass method="PUT" to the MCP tool to get an upload URL.
Content type is detected automatically on every upload. No Content-Type header is required. Detection uses libmagic to inspect the first 8 KB of the file content, with a filename extension fallback when libmagic returns a generic type. The detected type is stored in metadata and returned in Content-Type on GET and HEAD responses.
To override auto-detection, set Content-Type explicitly on the upload request.
Set ttl on a bucket and objects expire automatically after that duration from the last write. Overwriting an object resets its expiry clock. Setting ttl: 0 means objects never expire.
A background cleanup loop runs every cleanup_interval seconds and performs two tasks:
expires_at has passed and deletes them from disk and metadata.Empty parent directories are removed up to the bucket root on every deletion.
Every object key gets its own async read-write lock. Multiple readers hold the lock simultaneously. A writer gets exclusive access and blocks all concurrent readers and writers on that key. Locks are acquired before any operation begins and released after the response is fully sent.
This prevents torn reads, partial write visibility, and data corruption under concurrent access.
Three conditions cause 503 Service Unavailable:
| Condition | Trigger |
|---|---|
| Overloaded | More than lock_max_waiters requests queued for the same key |
| Acquire timeout | A request waited lock_acquire_timeout seconds without getting the lock |
| Hold timeout | A request held the lock longer than lock_hold_timeout seconds |
The hold timeout protects against a slow or stalled upload holding a write lock indefinitely. When it fires, the lock is released and the request receives 503.
The defaults (30s acquire, 300s hold, 100 max waiters) suit large file uploads. For high-throughput small-object workloads, tighten these to shed load faster.
Structured JSON logs to stdout, one entry per line:
| Field | Description |
|---|---|
ts | Timestamp (HH:MM:SS) |
level | INFO, WARNING, or ERROR |
src | module:function:line |
rid | Request ID — matches the X-Request-Id response header |
msg | Event name |
| others | Context-specific: bucket, key, size, content_type, etc. |
The request ID appears in every log line produced during a request, making it easy to trace a single request end-to-end. Exceptions are logged with full tracebacks.
Set path_prefix in config to match the proxy location. HybridS3 serves all routes under that prefix natively — nginx forwards the path as-is, no stripping required. SigV4 signatures work because the client's signed path matches what the server sees.
The key: proxy_pass http://backend:8080; (no trailing /) forwards the full path. proxy_pass http://backend:8080/; (trailing /) tells nginx to replace the location prefix — that strips /storage/ and breaks SigV4.
With this config:
When path_prefix is set, all endpoints move under it — including health (/storage/health).
hmac.compare_digest to prevent timing attackskey is never returned in any response, never embedded in presigned URLs, and never loggedPath.relative_to before any disk access; upload attempts with traversal keys return 400GET / requires a valid key; master key lists all buckets, bucket key lists only its own; unauthorized or non-existent bucket access always returns 404 — callers cannot distinguish "does not exist" from "you don't have access"prefix values are escaped before use in LIKE queriesX-Content-Type-Options: nosniff — on every responseAll test output is teed to test.log automatically.
The integration tests cover: HTTP API, S3/boto3 compatibility, MCP tools, Bearer auth, AWS Sig V4 auth, presigned URLs (HTTP endpoint and S3 SDK, GET and PUT), master key, cross-bucket key isolation, TTL expiry, orphan cleanup, MIME detection, size limits, path traversal attempts, binary files, concurrent reads and writes, RW lock behavior at unit and HTTP level, request IDs, and security headers.
All development tooling lives inside a sandboxed dev container so the host stays clean and supply-chain blast radius is contained. The host only needs docker, make, git, and a shell — no Python interpreter, no pip, no uv, no project deps installed globally.
The project uses uv with a hash-locked uv.lock (committed) and a supply-chain age gate ([tool.uv] exclude-newer in pyproject.toml) that refuses to install any package version published after a fixed date. Every dep mutation bumps that date to 3 days ago in the same commit, then re-locks.
| Target | What it does | Bumps age gate? |
|---|---|---|
make pkg-lock | Refresh uv.lock under the current gate | No |
make pkg-add PKG=name[==ver] | Add a package | Yes |
make pkg-remove PKG=name | Remove a package | Yes |
make pkg-update PKG=name | Upgrade one package | Yes |
make pkg-upgrade | Upgrade every package | Yes |
Never run uv directly — every supported mutation has a Make target so the gate stays anchored.
make build produces the production image. The Dockerfile is multi-stage, pins both the Python base and uv by @sha256 digest, installs with uv sync --frozen --no-dev (lockfile-verified, no dev deps), and copies only the resulting venv + app source into the runtime stage. There is no pip invocation anywhere in this project.