Skip to main content
Glama

S3 MCP-сервер

КИ Trivy Скан npm-версия npm-загрузки Лицензия: Массачусетский технологический институт Версия Node.js

Сервер Amazon S3 Model Context Protocol (MCP), предоставляющий инструменты для взаимодействия с контейнерами и объектами S3.

https://github.com/user-attachments/assets/d05ff0f1-e2bf-43b9-8d0c-82605abfb666

Обзор

Этот сервер MCP позволяет большим языковым моделям (LLM), таким как Claude, взаимодействовать с хранилищем AWS S3. Он предоставляет инструменты для:

  • Список доступных S3-корзин

  • Перечисление объектов в контейнере

  • Извлечение содержимого объекта

Сервер создан с использованием TypeScript и MCP SDK, что обеспечивает безопасный и стандартизированный способ взаимодействия LLM с S3.

Related MCP server: AWS MCP Server

Установка

Предпосылки

  • Node.js 18 или выше

  • npm или пряжа

  • Настроенные учетные данные AWS (через переменные среды или файл учетных данных AWS)

  • Docker (опционально, для контейнерной установки)

Настраивать

  1. Установить через npm:

# Install globally via npm
npm install -g aws-s3-mcp

# Or as a dependency in your project
npm install aws-s3-mcp
  1. Если сборка из исходного кода:

# Clone the repository
git clone https://github.com/samuraikun/aws-s3-mcp.git
cd aws-s3-mcp

# Install dependencies and build
npm install
npm run build
  1. Настройте учетные данные AWS и доступ к S3:

Создайте файл .env с вашей конфигурацией AWS:

AWS_REGION=us-east-1
S3_BUCKETS=bucket1,bucket2,bucket3
S3_MAX_BUCKETS=5
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key

Или установите их как переменные среды.

Конфигурация

Сервер можно настроить с помощью следующих переменных среды:

Переменная

Описание

По умолчанию

AWS_REGION

Регион AWS, где расположены ваши контейнеры S3

us-east-1

S3_BUCKETS

Список разрешенных имен контейнеров S3, разделенных запятыми

(пустой)

S3_MAX_BUCKETS

Максимальное количество сегментов для возврата в листинге

5

AWS_ACCESS_KEY_ID

Ключ доступа AWS (если не используются учетные данные по умолчанию)

(из конфигурации AWS)

AWS_SECRET_ACCESS_KEY

Секретный ключ AWS (если не используются учетные данные по умолчанию)

(из конфигурации AWS)

Запуск сервера

Прямое выполнение Node.js

Вы можете запустить сервер напрямую с Node.js:

# Using npx (without installing)
npx aws-s3-mcp

# If installed globally
npm install -g aws-s3-mcp
aws-s3-mcp

# If running from cloned repository
npm start

# Or directly
node dist/index.js

Настройка Docker 🐳

Вы можете запустить сервер S3 MCP как контейнер Docker, используя Docker CLI или Docker Compose.

Использование Docker CLI

  1. Создайте образ Docker:

docker build -t aws-s3-mcp .
  1. Запустите контейнер с переменными среды:

# Option 1: Pass environment variables directly
docker run -d \
  -e AWS_REGION=us-east-1 \
  -e S3_BUCKETS=bucket1,bucket2 \
  -e S3_MAX_BUCKETS=5 \
  -e AWS_ACCESS_KEY_ID=your-access-key \
  -e AWS_SECRET_ACCESS_KEY=your-secret-key \
  --name aws-s3-mcp-server \
  aws-s3-mcp

# Option 2: Use environment variables from .env file
docker run -d \
  --env-file .env \
  --name aws-s3-mcp-server \
  aws-s3-mcp
  1. Проверьте журналы контейнера:

docker logs aws-s3-mcp-server
  1. Остановитесь и удалите контейнер:

docker stop aws-s3-mcp-server
docker rm aws-s3-mcp-server

Обратите внимание, что контейнер не предоставляет никаких портов, поскольку он предназначен для использования с Claude Desktop через Docker exec, а не через прямые HTTP-соединения.

Использование Docker Compose

  1. Соберите и запустите Docker-контейнер:

# Build and start the container
docker compose up -d s3-mcp

# View logs
docker compose logs -f s3-mcp
  1. Чтобы остановить контейнер:

docker compose down

Использование Docker с MinIO для тестирования

Настройка Docker Compose включает службу MinIO для локального тестирования:

# Start MinIO and the MCP server
docker compose up -d

# Access MinIO console at http://localhost:9001
# Default credentials: minioadmin/minioadmin

Служба MinIO автоматически создает два тестовых контейнера ( test-bucket-1 и test-bucket-2 ) и загружает файлы образцов для тестирования.

Отладка в MCP Inspector

Для отладки сервера с помощью MCP Inspector:

# Run inspector with local Node.js
sh run-inspector.sh

# Run inspector with Docker Compose and MinIO
sh run-inspector.sh --docker-compose

# Run inspector with Docker CLI (without Docker Compose)
sh run-inspector.sh --docker

При использовании опции --docker-compose скрипт выполнит следующие действия:

  1. Запустите контейнеры MinIO и сервера S3 MCP, если они не запущены.

  2. Запустите MCP Inspector, подключенный к серверу S3 MCP.

  3. Затем вы можете протестировать инструменты S3 на локальном экземпляре MinIO.

Подключение к Claude Desktop

Чтобы использовать этот сервер с Claude Desktop:

  1. Отредактируйте файл конфигурации Claude Desktop:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

  2. Добавьте сервер S3 MCP в конфигурацию:

{
  "mcpServers": {
    "s3": {
      "command": "npx",
      "args": ["aws-s3-mcp"],
      "env": {
        "AWS_REGION": "us-east-1",
        "S3_BUCKETS": "bucket1,bucket2,bucket3",
        "S3_MAX_BUCKETS": "5",
        "AWS_ACCESS_KEY_ID": "your-access-key",
        "AWS_SECRET_ACCESS_KEY": "your-secret-key"
      }
    }
  }
}

Вариант Docker для Claude Desktop 🐳

Вы также можете настроить Claude Desktop для использования работающего контейнера Docker для сервера MCP:

{
  "mcpServers": {
    "s3": {
      "command": "docker",
      "args": ["exec", "-i", "aws-s3-mcp-server", "node", "dist/index.js"],
      "env": {}
    }
  }
}

⚠️ Важные предварительные условия : для работы этой конфигурации Docker вам СЛЕДУЕТ сначала собрать и запустить контейнер Docker ПЕРЕД запуском Claude Desktop:

# 1. First, build the Docker image (only needed once or after changes)
docker build -t aws-s3-mcp .

# 2. Then start the container (required each time before using with Claude)
# Using Docker Compose (recommended)
docker compose up -d s3-mcp

# Or using Docker CLI
docker run -d --name aws-s3-mcp-server --env-file .env aws-s3-mcp

Без запущенного контейнера Claude Desktop будет выдавать ошибки при попытке использования инструментов S3.

Конфигурация Docker выше использует exec для отправки запросов MCP напрямую в работающий контейнер. Сопоставление портов не требуется, поскольку Claude взаимодействует с контейнером напрямую, а не через сетевой порт.

Примечание : убедитесь, что имя контейнера в конфигурации ( aws-s3-mcp-server ) совпадает с именем запущенного контейнера.

Важно : при использовании указанной выше конфигурации обратите внимание на следующее:

  • Замените AWS_ACCESS_KEY_ID и AWS_SECRET_ACCESS_KEY на ваши фактические учетные данные.

  • S3_BUCKETS должен содержать список контейнеров, разделенных запятыми, к которым вы хотите разрешить доступ.

  • AWS_REGION должен быть установлен на регион, где расположены ваши контейнеры.

💣 Если возникла ошибка на Claude Desktop

Если вы столкнулись с ошибками в приведенной выше конфигурации в Claude Desktop, попробуйте использовать абсолютные пути следующим образом:

# Get the path of node and aws-s3-mcp
which node
which aws-s3-mcp
{
  "globalShortcut": "",
  "mcpServers": {
    "s3": {
      "command": "your-absolute-path-to-node",
      "args": ["your-absolute-path-to-aws-s3-mcp/dist/index.js"],
      "env": {
        "AWS_REGION": "your-aws-region",
        "S3_BUCKETS": "your-s3-buckets",
        "S3_MAX_BUCKETS": "your-max-buckets",
        "AWS_ACCESS_KEY_ID": "your-access-key",
        "AWS_SECRET_ACCESS_KEY": "your-secret-key"
      }
    }
  }
}

Доступные инструменты

список-ведра

Перечисляет доступные S3-корзины, к которым у сервера есть разрешение на доступ. Этот инструмент учитывает конфигурацию S3_BUCKETS , которая ограничивает отображаемые корзинки.

Параметры: Нет

Пример вывода:

[
  {
    "Name": "my-images-bucket",
    "CreationDate": "2022-03-15T10:30:00.000Z"
  },
  {
    "Name": "my-documents-bucket",
    "CreationDate": "2023-05-20T14:45:00.000Z"
  }
]

список-объектов

Перечисляет объекты в указанном контейнере S3.

Параметры:

  • bucket (обязательно): Имя корзины S3, из которой нужно получить список объектов.

  • prefix (необязательно): префикс для фильтрации объектов (например, путь к папке)

  • maxKeys (необязательно): максимальное количество возвращаемых объектов.

Пример вывода:

[
  {
    "Key": "sample.pdf",
    "LastModified": "2023-10-10T08:12:15.000Z",
    "Size": 2048576,
    "StorageClass": "STANDARD"
  },
  {
    "Key": "sample.md",
    "LastModified": "2023-10-12T15:30:45.000Z",
    "Size": 1536000,
    "StorageClass": "STANDARD"
  }
]

получить-объект

Извлекает объект из указанного контейнера S3. Текстовые файлы возвращаются как обычный текст, а двоичные файлы возвращаются с ограниченными подробностями.

Параметры:

  • bucket (обязательно): Имя ведра S3

  • key (обязательно): Ключ (путь) объекта для извлечения

Пример текстового вывода:

This is the content of a text file stored in S3.
It could be JSON, TXT, CSV or other text-based formats.

Пример двоичного вывода:

Binary content (image/jpeg): base64 data is /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRof...

Соображения безопасности

  • Сервер будет иметь доступ только к тем контейнерам, которые указаны в переменной среды S3_BUCKETS .

  • Учетные данные AWS должны иметь соответствующие разрешения для корзин

  • Используйте принцип наименьших привилегий при настройке разрешений AWS.

  • Для использования в производственной среде рассмотрите возможность использования ролей IAM с определенными разрешениями S3.

Использование с Клодом

При взаимодействии с Клодом в настольном приложении вы можете попросить его выполнить такие операции S3, как:

  • «Список всех моих S3-корзин»

  • «Обобщить файлы PDF в корзине my-documents»

  • "Получить файл README.txt из my-documents-bucket"

Клод воспользуется соответствующим инструментом MCP для выполнения запроса и покажет вам результаты.

Лицензия

Массачусетский технологический институт

Available Tools

3 tools
get-objectB

Retrieve an object from an S3 bucket

ParametersJSON Schema
NameRequiredDescriptionDefault
bucketYesName of the S3 bucket
keyYesKey (path) of the object to retrieve

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description does not disclose behavioral traits such as size limits, access requirements, error handling, or return format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is concise with one sentence, but lacks depth; efficient but could include more context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema and no description of return value (object content) or error behavior; incomplete for a retrieval tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with clear descriptions for both parameters; description adds no additional meaning beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description uses specific verb 'Retrieve' and resource 'object from an S3 bucket', clearly distinguishing from sibling tools list-buckets and list-objects.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use or alternatives; usage is implied but not elaborated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list-bucketsA

List available S3 buckets

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits, but it only states 'List available S3 buckets' without mentioning any side effects, authorization, format, or limits. This is minimal transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence with no wasted words. Every part is essential.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, no output schema), the description adequately explains its purpose. It could mention the return format, but not strictly necessary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the description does not need to add param info. The baseline is 4, and the description's mention of 'available' adds slight context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'list' and resource 'S3 buckets', clearly distinguishing it from sibling tools like get-object and list-objects.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

While no explicit when/when-not guidance is given, the context is clear: use this when you need to list available S3 buckets. Alternatives are not needed since siblings cover different resources.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list-objectsB

List objects in an S3 bucket

ParametersJSON Schema
NameRequiredDescriptionDefault
bucketYesName of the S3 bucket
prefixNoPrefix to filter objects (like a folder)
maxKeysNoMaximum number of objects to return

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden of behavioral disclosure. It does not mention pagination, performance implications, error handling, or that it is a read-only operation. Minimal behavioral insight beyond the action itself.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, very concise. However, it could include more useful information without becoming overly verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description is incomplete. It does not describe the output format, pagination behavior, or error cases, leaving the agent with insufficient context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (all parameters have descriptions). The description adds no additional meaning beyond the schema; baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List objects in an S3 bucket' uses a specific verb and resource, clearly distinguishing it from siblings 'get-object' (gets a single object) and 'list-buckets' (lists all buckets).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool vs alternatives, or how to apply parameters like prefix or maxKeys. The purpose is clear but the description lacks usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 3 tool updatesv1.0.0
    • Changedget-object1 field changed
      • removedInput schema / additionalProperties
        Removed value: -false
    • Changedlist-buckets1 field changed
      • removedInput schema / additionalProperties
        Removed value: -false
    • Changedlist-objects5 fields changed
      • removedInput schema / additionalProperties
        Removed value: -false
      • addedInput schema / properties / maxKeys / anyOf
        Added value: +[
        +  {
        +    "type": "number"
        +  },
        +  {
        +    "type": "null"
        +  }
        +]
      • removedInput schema / properties / maxKeys / type
        Removed value: -[
        -  "number",
        -  "null"
        -]
      • addedInput schema / properties / prefix / anyOf
        Added value: +[
        +  {
        +    "type": "string"
        +  },
        +  {
        +    "type": "null"
        +  }
        +]
      • removedInput schema / properties / prefix / type
        Removed value: -[
        -  "string",
        -  "null"
        -]
  2. 3 tool updates
    • First observedget-object
    • First observedlist-buckets
    • First observedlist-objects

TDQS

A3.7/5.0

Scored across 3 tools

Disambiguation5/5

Each tool targets a distinct S3 operation: retrieving objects, listing buckets, and listing objects. There is no overlap or ambiguity in their purposes.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern using snake_case (e.g., get-object, list-buckets), making them predictable and easy to understand.

Tool Count5/5

With 3 tools, the server is tightly scoped to basic read operations, avoiding unnecessary bloat while covering essential S3 actions for a minimal MCP server.

Completeness3/5

The server covers listing and retrieval but lacks write operations like put-object or delete-object, which are notable gaps for a general S3 server. Agents cannot perform updates or deletions.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    An MCP server that provides tools for interacting with AWS S3 buckets, enabling direct access to S3 operations through the Model Context Protocol.
    1
    -
  • F
    license
    C
    quality
    D
    maintenance
    A Model Context Protocol server allowing Claude AI to interact with AWS resources through natural language, enabling users to query and manage AWS services without using the traditional AWS Console or CLI.
    3
    6
    -
  • A
    license
    A
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server for AWS S3 integration using FastMCP and boto3. This server provides access to S3 functionality through MCP-compatible tools.
    10
    1
    MIT