selectel-s3-mcp-ai-cli
This server provides read-only inspection and analysis of Selectel S3 object storage.
List buckets and objects with pagination.
Read object metadata, inline object content, and previews of small objects.
Generate presigned GET URLs for temporary access.
Inspect bucket configuration: location, versioning, CORS, policy, and Object Lock.
List object versions and delete markers.
Inspect multipart uploads and their parts.
Analyze storage usage: largest objects, prefix usage, and unfinished uploads.
Bound scans with limits and continuation tokens, returning partial-result markers when needed.
Selectel S3 MCP Server & AI CLI
MCP-сервер и CLI для S3 Селектел (Selectel Object Storage): подключение к Claude Code, Cursor и Codex, просмотр бакетов, восстановление бэкапов и работа с файлами через Go-бинарь selectel-s3.
English guide · Каталог S3 MCP-серверов
English
A Go MCP server, CLI and agent skill for Selectel S3 Object Storage. Connect Claude Code, Cursor and Codex to scoped object storage for inspection and backup recovery. Six profile pools; tagging and lifecycle tools are disabled. See the full English guide.
Related MCP server: cloudru-s3-mcp-ai-cli
Возможности
Object CRUD, серверные copy/move, версии, multipart, presigned GET/PUT.
CORS, политика бакета и Object Lock configuration; регистрация по возможностям профиля.
Ограниченные сканы: крупные объекты, использование префиксов, брошенные загрузки.
Потоковый CLI, JSON, диагностика, установка MCP-конфигураций и встроенного skill.
Быстрый старт
Возьми бинарь своей платформы из Releases (v0.1.1 опубликован; есть в MCP Registry и Smithery) либо собери с Go 1.27.2:
go build -o selectel-s3 ./cmd/selectel-s3
./selectel-s3 version
./selectel-s3 auth set
./selectel-s3 auth status
./selectel-s3 ls --jsonauth set спрашивает key ID и secret без эха; без TTY читает две строки stdin. Не передавай секрет в argv. Файл ~/.config/selectel-s3/credentials создаётся атомарно с 0600; более широкие права отклоняются.
Приоритет: флаги > env > файл. Переменные: SELECTEL_S3_ACCESS_KEY_ID, SELECTEL_S3_SECRET_ACCESS_KEY, SELECTEL_S3_POOL (ru-1), SELECTEL_S3_ENDPOINT. HTTP требует SELECTEL_S3_ALLOW_INSECURE=1.
Образ: ghcr.io/stufently/selectel-s3-mcp-ai-cli:0.1.1; локальная сборка: docker build -t selectel-s3 . Образ запускает MCP от uid 65532, содержит CA-сертификаты. Передай креды через приватное окружение/файл.
Подключение к Claude Code, Cursor, Codex
Кнопка ставит MCP из Docker-образа ghcr.io/stufently/selectel-s3-mcp-ai-cli:0.1.1 в режиме только чтения. Ключи в конфиг не пишутся: Cursor подставляет ${env:…} из окружения, поэтому задай SELECTEL_S3_ACCESS_KEY_ID и SELECTEL_S3_SECRET_ACCESS_KEY там, откуда запускается Cursor; SELECTEL_S3_POOL — если бакет не в пуле по умолчанию (пустое значение = пул по умолчанию). Тот же блок — для Windsurf (mcp_config.json) и вручную для ~/.cursor/mcp.json:
{
"mcpServers": {
"selectel-s3": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SELECTEL_S3_ACCESS_KEY_ID",
"-e",
"SELECTEL_S3_SECRET_ACCESS_KEY",
"-e",
"SELECTEL_S3_POOL",
"ghcr.io/stufently/selectel-s3-mcp-ai-cli:0.1.1"
],
"env": {
"SELECTEL_S3_ACCESS_KEY_ID": "${env:SELECTEL_S3_ACCESS_KEY_ID}",
"SELECTEL_S3_SECRET_ACCESS_KEY": "${env:SELECTEL_S3_SECRET_ACCESS_KEY}",
"SELECTEL_S3_POOL": "${env:SELECTEL_S3_POOL}"
}
}
}
}selectel-s3 mcp install --client cursor --dry-run
selectel-s3 mcp install --client cursor
selectel-s3 mcp install --client claude-desktop
selectel-s3 mcp install --client codex
selectel-s3 mcp install --client claude-code --scope project
selectel-s3 mcp install --client claude-code --scope userПоследняя команда только печатает claude mcp add. Путь бинаря абсолютный; ключи в конфиг не пишутся. Cursor: ~/.cursor/mcp.json, Claude Code project: ./.mcp.json; Desktop — каталог конфигурации своей ОС. JSON сохраняет чужие ключи, .bak и идемпотентность.
Codex: ~/.codex/config.toml. Существующая таблица требует --force; заменяется только блок между # >>> selectel-s3 (managed) / # <<< selectel-s3 (managed). Таблица без маркеров не заменяется даже с --force; остальные байты TOML целы.
Уровни включаются независимо: selectel-s3 mcp --allow-write --allow-delete --allow-admin либо SELECTEL_S3_ALLOW=write,delete,admin. Флаги доступны и в mcp install. FILE_ROOT включается через SELECTEL_S3_FILE_ROOT.
Инструменты MCP
Уровень | Инструменты |
read | s3_list_buckets, s3_list_objects, s3_head_object, s3_get_object, s3_preview_object, s3_presign_get, s3_list_object_versions, s3_list_multipart_uploads, s3_list_parts, s3_get_bucket_config, s3_largest_objects, s3_prefix_usage, s3_unfinished_uploads |
read + FILE_ROOT | s3_download_file |
write | s3_put_object, s3_create_folder, s3_copy_object, s3_presign_put, s3_multipart_create, s3_multipart_presign_part, s3_multipart_complete |
write + FILE_ROOT | s3_upload_file |
delete | s3_delete_object, s3_delete_objects, s3_multipart_abort |
write + delete | s3_move_object |
admin | s3_create_bucket, s3_put_bucket_versioning, s3_put_bucket_cors, s3_put_bucket_policy, s3_delete_bucket_policy, s3_put_object_lock_configuration |
admin + delete | s3_delete_bucket |
Теги у Selectel не регистрируются. Ресурсы: selectel-s3://config, selectel-s3://capabilities, selectel-s3://pools.
Списки — до 1000 элементов с continuation_token; версии/multipart имеют второй маркер. Inline get/put — 262144 байт, preview — 65536; большие файлы идут через presigned URL или FILE_ROOT. Ответ содержит structuredContent и JSON-текст; текст свыше 256 КиБ заменяется краткой сводкой. Ошибки: code/message/retryable; 429/503 SDK повторяет адаптивно.
Аналитика сканирует максимум max_scan (по умолчанию 10000); partial/token отмечают неполный результат. Prefix usage выдаёт страницы агрегатов через next_result_offset. Это не биллинг.
Сценарий: Выбор пула и восстановление резервных копий
Выберите пул существующего бакета и проверьте архив перед восстановлением. --pool меняет и endpoint, и регион подписи; для московского пула ru-6 пример выглядит так:
selectel-s3 --pool ru-6 ls backups/daily/ --json
selectel-s3 --pool ru-6 stat backups/daily/archive.tar
selectel-s3 --pool ru-6 cp s3://backups/daily/archive.tar ./restored-selectel.tarПримеры используют существующий бакет backups и объект daily/archive.tar; замените их своими значениями. Профиль и API облака ещё требуют живой проверки.
CLI
selectel-s3 mb backups
selectel-s3 cp ./archive.tar s3://backups/daily/archive.tar --part-size 5242880
selectel-s3 ls backups/daily/ --max-keys 100 --json
selectel-s3 stat backups/daily/archive.tar
selectel-s3 cp s3://backups/daily/archive.tar ./restored.tar
selectel-s3 cp ./directory s3://backups/tree/ --recursive
selectel-s3 cp s3://backups/tree/ ./restored-directory --recursive
selectel-s3 cp s3://backups/daily/archive.tar s3://backups/copy.tar
selectel-s3 cat backups/daily/notes.txt
selectel-s3 versions backups/daily/ --json
selectel-s3 du backups/daily/ --max-scan 10000 --json
selectel-s3 presign backups/daily/archive.tar --expires 3600
selectel-s3 mv s3://backups/copy.tar s3://backups/moved.tar --yes
selectel-s3 rm backups/moved.tar --yes
selectel-s3 rb empty-bucket --yes
selectel-s3 doctor --json
selectel-s3 compat --markdowncp принимает обычные локальные пути и S3 URI s3://bucket/key либо selectel-s3://bucket/key. Большие загрузки используют manager/multipart, --recursive копирует каталоги/префиксы. Перезапись требует --overwrite и подтверждения; выгрузка атомарна. rm/rb/mv без --yes на не-TTY дают код 2; на TTY спрашивают. --json общий, ошибки — stderr и ненулевой код.
doctor проверяет источник/права кредов, DNS/TLS, часы по Date и ListBuckets: >5 минут — предупреждение, >15 — ошибка.
Skill для AI-агентов
selectel-s3 skill install
selectel-s3 skill install --target ./agent-skills/selectel-s3По умолчанию ~/.claude/skills/selectel-s3. Идемпотентно устанавливает SKILL.md и шесть references: backup/restore, share, least privilege, cost hygiene, migration, incident response. Триггеры: «selectel s3», «бакет селектел», «загрузи в s3», «presigned», «бэкап в s3».
Безопасность
MCP по умолчанию регистрирует только read; неподдерживаемые возможности и отсутствующие уровни исключают инструмент.
SELECTEL_S3_DESTRUCTIVE_POLICY: confirm использует elicitation при поддержке клиента, иначе нужен confirm:true после согласия человека; elicit требует elicitation и не допускает обхода confirm:true; block всегда запрещает, allow выполняет без гейта. Отказ предшествует любым S3-запросам. Гейт покрывает удаления, move, presigned PUT, политику/Object Lock, suspension versioning и перезаписи.
put/copy/move/multipart complete/upload file по умолчанию имеют overwrite:false: HEAD цели и If-None-Match: *. overwrite:true требует тот же гейт.
Скоуп: SELECTEL_S3_ALLOWED_BUCKETS=backups и SELECTEL_S3_ALLOWED_PREFIXES=backups/daily/. Префикс учитывает границу сегмента; daily-evil не подходит. Сегменты '..' отклоняются. Частичный скоуп запрещает целый бакет и широкие списки даже при наличии его в ALLOWED_BUCKETS. Copy/move проверяет источник и цель.
Файловые MCP-инструменты используют os.Root: только относительные пути внутри FILE_ROOT; '..', абсолютные пути и симлинки наружу отклоняются. На каждый вызов одна JSON-строка в stderr; SELECTEL_S3_AUDIT_FILE дополнительно пишет в 0600. Секреты и X-Amz-Signature/Credential/Security-Token редактируются в логах/ошибках. Полная подписанная ссылка — только результат операции. Ограничивай также права самого S3-ключа.
s3_download_file по умолчанию публикует скачанный файл без замены существующего, в том числе созданного во время скачивания. Для замены передай overwrite:true: применяется разрушительная политика с подтверждением через форму либо confirm:true после согласия человека.
Пулы и классы хранения Selectel
ru-1 и ru-3 — Санкт-Петербург; ru-6 (Multi-AZ), ru-7, gis-1 (изолированный ГИС) — Москва; uz-2 — Узбекистан. Регион SigV4 равен пулу; path-style по умолчанию. Эндпоинты и совместимость.
Стандартное, холодное, ледяное; ледяное только ru-3. Класс выбирается в панели при создании и потом не меняется; create_bucket не принимает класс. Цены от 2,56 / 1,25 / 0,89 ₽/ГБ·мес — непроверенная сводка владельца за 2026-10. Максимум presigned 604800 секунд тоже не подтверждён; документация говорит о 15 минутах срока подписи запроса.
Объект до 50 ТБ, один PUT до 5 ГБ, multipart до 10000 частей. На бакет запросов/с: всего 2000, GET+HEAD 1000, POST 200, PUT и DELETE по 300; превышение даёт 429. TTL задаётся в панели и применяется к новым объектам.
FAQ
Как выбрать регион Selectel S3 для MCP? Укажите SELECTEL_S3_POOL или флаг --pool с идентификатором из таблицы совместимости. Пул должен совпадать с пулом вашего бакета; ru-1 — значение по умолчанию.
Можно ли настроить lifecycle и теги Селектел через этот MCP-сервер? В профиле проекта эти возможности выключены, поэтому соответствующие инструменты не регистрируются. Настройки TTL через панель описаны в ресерче Selectel.
Как восстановить бэкап из Selectel S3? Используйте stat, затем cp s3://bucket/key ./new-file. CLI скачивает потоково и публикует локальный файл атомарно; новый путь позволяет избежать замены существующего архива.
Что такое MCP-сервер? Программа предоставляет агентам инструменты и ресурсы через Model Context Protocol; здесь stdio.
Как подключить MCP-сервер к Claude Code? Сохрани ключи auth set, затем используй project install либо напечатанную user-команду.
Безопасно ли давать агенту доступ к S3? Ограничь ключи, скоуп и уровни; сохрани confirm/block и одобряй разрушительные эффекты осознанно.
Чем это отличается от aws-cli и rclone? Бинарь объединяет MCP, гейт, аудит, аналитику, skill и CLI; aws-cli/rclone остаются самостоятельными средствами передачи/автоматизации.
Почему нет lifecycle и тегов? Selectel S3 API их не поддерживает. TTL новых объектов — в панели; теги исключены профилем.
Другие провайдеры
Общий каталог: MCP-серверы и CLI для российских S3.
Провайдер | Репозиторий | Сценарий |
Selectel | Выбор пула и восстановление резервных копий | |
Yandex Cloud | Инвентаризация объектов и проверка версий бэкапов | |
VK Cloud | Проверка Hotbox/Icebox и доступ к нужному региону | |
Cloud.ru | Диагностика доступа к Evolution Object Storage | |
Timeweb Cloud | Восстановление архивов и учёт объёма префикса | |
MWS | Проверка HMAC-доступа и короткие ссылки на архивы | |
Beget | Просмотр и восстановление файлов из готового бакета | |
Shared Go kit | Общие MCP, CLI, защиты и CI |
Лицензия
MIT. Проверенные факты и предположения.
Проверки в Docker: bash scripts/go.sh go test -race ./..., bash scripts/conformance.sh, bash scripts/mcp_smoke.sh, bash scripts/mutation_gate.sh, bash scripts/check_docs.sh. Conformance использует versitygw v1.8.0 и тестовые ключи.
Общие MCP/CLI, защиты и проверки поставляет s3-mcp-ai-cli-kit v0.1.2; в этом репозитории остаются встроенный профиль, тонкий main и документы Selectel.
Available Tools
13 toolss3_get_bucket_configA
Read a bucket's configuration in one call: location, versioning status, CORS rules, bucket policy JSON and Object Lock configuration; read-only. Use it before changing any of them with the s3_put_bucket_* tools. Each section holds its value (versioning status is empty when versioning was never enabled), {"status":"absent"} when nothing is configured, or {"status":"unsupported"} when the provider lacks the feature. Needs whole-bucket scope: fails with scope_denied when only some prefixes of the bucket are allowed.
Inputs: bucket (required).
s3_get_objectA
Return a small object's whole body inline as UTF-8 text or base64; read-only. Use it for objects up to 262144 bytes (256 KiB); to look at the start of a larger file use s3_preview_object, to save it to disk use s3_download_file, and to hand it over use s3_presign_get. Returns key, bytes, data, encoding and content_type. Fails instead of truncating when the object exceeds max_bytes, and fails on non-UTF-8 content unless encoding is base64.
Inputs: key (required), bucket (required), encoding, max_bytes, +1 more.
s3_head_objectA
Read one object's metadata without downloading its body; read-only. Use it to check existence, size or content type before s3_get_object, s3_download_file or s3_presign_get. Returns key, size (bytes), etag, content_type, last_modified, version_id and user metadata. A missing key fails with a not-found error (NotFound or http_404).
Inputs: key (required), bucket (required), version_id.
s3_largest_objectsA
Find the largest objects under a prefix by scanning up to max_scan keys (default 10000); read-only. Use it to locate what consumes space; use s3_prefix_usage for totals per sub-prefix and s3_list_objects for plain browsing. Returns objects[] sorted by size descending (at most limit, default 10), scanned, partial and continuation_token. partial:true means the scan stopped early and the ranking covers only scanned keys; pass continuation_token to rank the next batch.
Inputs: bucket (required), limit, prefix, max_scan, +1 more.
s3_list_bucketsA
List the buckets these credentials can see, filtered by the configured bucket scope; read-only, up to 1000 per page. Use it to discover bucket names; to list keys inside a bucket use s3_list_objects. Returns buckets[] (name, created_at) and continuation_token, which is empty on the last page. Buckets outside the allowed scope are omitted rather than reported as errors.
Inputs: max_keys, continuation_token.
s3_list_multipart_uploadsA
List in-progress multipart uploads (started, not yet completed or aborted) in a bucket; read-only, one page of up to 1000. Use it for a raw page of uploads; use s3_unfinished_uploads to find uploads older than N hours across many pages, and s3_list_parts for the parts of one upload. Returns uploads[] (Key, UploadId, Initiated and more), truncated, continuation_token and upload_id_marker; send them back as continuation_token and upload_id for the next page.
Inputs: bucket (required), prefix, max_keys, upload_id, +1 more.
s3_list_objectsA
List one page of current object keys under a prefix in a bucket; read-only. Use it to browse objects; use s3_list_object_versions for old versions and delete markers, and s3_largest_objects or s3_prefix_usage for size analysis across many pages. Returns objects[] (key, size in bytes, etag, last_modified, storage_class), truncated, and continuation_token for the next page. Fails with scope_denied outside the configured bucket/prefix scope.
Inputs: bucket (required), prefix, max_keys, continuation_token.
s3_list_object_versionsA
List object versions and delete markers under a prefix; read-only, one page of up to 1000 entries. Use it to find a version_id to inspect or restore with s3_head_object, s3_get_object or s3_download_file; use s3_list_objects when only current objects matter. Returns versions[], delete_markers[], truncated, continuation_token and version_marker; send both markers back together for the next page.
Inputs: bucket (required), prefix, max_keys, version_marker, +1 more.
s3_list_partsA
List the parts already uploaded for one multipart upload; read-only. Use it before s3_multipart_complete to collect part numbers and ETags, or to check upload progress. Returns parts[] (PartNumber, ETag, Size, LastModified), truncated and continuation_token (a part-number marker) for the next page. An unknown upload_id fails with NoSuchUpload.
Inputs: key (required), bucket (required), upload_id (required), max_keys, +1 more.
s3_prefix_usageA
Sum bytes and object counts per first-level sub-prefix under prefix, scanning up to max_scan keys (default 10000); read-only. Use it to see which folders take space; use s3_largest_objects for individual files. Returns prefixes[] (prefix, bytes, count; objects directly under prefix are grouped under prefix itself), scanned, partial, continuation_token and next_result_offset when more than 1000 rows exist. partial:true means totals cover only the scanned keys; this is an estimate, not billing data.
Inputs: bucket (required), prefix, max_scan, result_offset, +1 more.
s3_presign_getA
Create a time-limited signed HTTPS GET URL for one object; read-only, signs locally and does not check that the key exists. Use it to hand a large object to a human or another program instead of reading bytes through s3_get_object. Returns url, method, headers and expires_seconds (default 3600). Anyone holding the URL can download the object until it expires, so share it only with the intended recipient.
Inputs: key (required), bucket (required), version_id, expires_seconds.
s3_preview_objectA
Read only the first bytes of an object (default and maximum 65536) with a ranged GET; read-only. Use it to inspect the format or header of a file of any size; use s3_get_object when you need the full body of a small object. Returns key, bytes, data, encoding (base64 is chosen automatically for binary data when encoding is omitted), content_type, detected_type (sniffed MIME type) and, for .csv keys or CSV content types, csv_header.
Inputs: key (required), bucket (required), encoding, max_bytes, +1 more.
s3_unfinished_uploadsA
Find multipart uploads started more than older_than_hours ago (default 24), scanning up to max_scan uploads (default 10000); read-only. Use it to spot abandoned uploads that still occupy storage, then remove them with s3_multipart_abort; use s3_list_multipart_uploads for a raw page regardless of age. Returns uploads[] (key, upload_id, initiated; at most 1000), scanned, partial, continuation_token and upload_id_marker; when partial is true send both markers back to continue.
Inputs: bucket (required), prefix, max_scan, upload_id, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Each tool targets a distinct S3 read operation, and descriptions explicitly route between near-neighbours (s3_get_object vs s3_preview_object vs s3_presign_get; s3_list_multipart_uploads vs s3_unfinished_uploads; s3_largest_objects vs s3_prefix_usage). The 'use X instead of Y' guidance and stated size/page limits make misselection unlikely.
All names use the same s3_ prefix and snake_case, with mostly verb_noun forms (s3_get_object, s3_list_buckets, s3_head_object, s3_presign_get). A few deviate to noun-phrase/attribute style (s3_largest_objects, s3_prefix_usage, s3_unfinished_uploads), but the pattern remains predictable.
13 tools is well within a healthy range and each covers a distinct read-only S3 capability (buckets, objects, versions, multipart, config, presign, size analysis). No tool feels like filler.
Read coverage is thorough, but several descriptions point to tools that do not exist in this set (s3_download_file, s3_multipart_abort, s3_multipart_complete, s3_put_bucket_*), creating dead ends. There is also no way to save a large object to disk locally and no write/mutation surface at all.
Maintenance
Related MCP Connectors
An MCP server for the STRG.com s3-compatible object storage network for all management operations. Full documentation access, ask questions, create buckets, configure scoped access keys, CORS rules, lifecycle policies and perform any S3 operation.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Go MCP server for GitLab: 2 dynamic tools reach 1000+ REST/GraphQL actions. Free/CE, no paid tier.
MCP tools for TON Sites, TON DNS and TON Storage.
Related MCP Servers
- AlicenseAqualityBmaintenanceBeget S3 MCP server and Go CLI: browse, preview and restore files in a bucket. Read-only by default; write, delete and admin tools only behind switches, destructive calls confirmed by a person.101MIT
- AlicenseAqualityBmaintenanceCloud.ru S3 MCP server and Go CLI: browse, preview and restore files in a bucket. Read-only by default; write, delete and admin tools only behind switches, destructive calls confirmed by a person.14MIT
- AlicenseAqualityBmaintenanceMWS S3 MCP server and Go CLI: browse, preview and restore files in a bucket. Read-only by default; write, delete and admin tools only behind switches, destructive calls confirmed by a person.14MIT
- AlicenseAqualityBmaintenanceVK Cloud S3 MCP server and Go CLI: browse, preview and restore files in a bucket. Read-only by default; write, delete and admin tools only behind switches, destructive calls confirmed by a person.14MIT