Skip to main content
Glama

S3 MCP-Server

CI Trivy Scan npm-Version npm-Downloads Lizenz: MIT Node.js-Version

Ein Amazon S3 Model Context Protocol (MCP)-Server, der Tools für die Interaktion mit S3-Buckets und -Objekten bereitstellt.

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

Überblick

Dieser MCP-Server ermöglicht Large Language Models (LLMs) wie Claude die Interaktion mit AWS S3-Speicher. Er bietet Tools für:

  • Auflisten verfügbarer S3-Buckets

  • Auflisten von Objekten innerhalb eines Buckets

  • Abrufen von Objektinhalten

Der Server wird mit TypeScript und dem MCP SDK erstellt und bietet LLMs eine sichere und standardisierte Möglichkeit, mit S3 zu interagieren.

Related MCP server: AWS MCP Server

Installation

Voraussetzungen

  • Node.js 18 oder höher

  • npm oder yarn

  • AWS-Anmeldeinformationen konfiguriert (entweder über Umgebungsvariablen oder AWS-Anmeldeinformationsdatei)

  • Docker (optional, für containerisiertes Setup)

Aufstellen

  1. Über npm installieren:

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

# Or as a dependency in your project
npm install aws-s3-mcp
  1. Beim Erstellen aus der Quelle:

# 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. Konfigurieren Sie AWS-Anmeldeinformationen und S3-Zugriff:

Erstellen Sie eine .env Datei mit Ihrer AWS-Konfiguration:

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

Oder legen Sie diese als Umgebungsvariablen fest.

Konfiguration

Der Server kann mit den folgenden Umgebungsvariablen konfiguriert werden:

Variable

Beschreibung

Standard

AWS_REGION

AWS-Region, in der sich Ihre S3-Buckets befinden

us-east-1

S3_BUCKETS

Durch Kommas getrennte Liste zulässiger S3-Bucket-Namen

(leer)

S3_MAX_BUCKETS

Maximale Anzahl von Buckets, die in der Auflistung zurückgegeben werden sollen

5

AWS_ACCESS_KEY_ID

AWS-Zugriffsschlüssel (wenn keine Standardanmeldeinformationen verwendet werden)

(aus der AWS-Konfiguration)

AWS_SECRET_ACCESS_KEY

AWS-Geheimschlüssel (wenn keine Standardanmeldeinformationen verwendet werden)

(aus der AWS-Konfiguration)

Ausführen des Servers

Direkte Node.js-Ausführung

Sie können den Server direkt mit Node.js ausführen:

# 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-Setup 🐳

Sie können den S3 MCP-Server als Docker-Container ausführen, indem Sie entweder Docker CLI oder Docker Compose verwenden.

Verwenden der Docker-CLI

  1. Erstellen Sie das Docker-Image:

docker build -t aws-s3-mcp .
  1. Führen Sie den Container mit Umgebungsvariablen aus:

# 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. Überprüfen Sie die Containerprotokolle:

docker logs aws-s3-mcp-server
  1. Anhalten und Behälter entfernen:

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

Beachten Sie, dass der Container keine Ports verfügbar macht, da er für die Verwendung mit Claude Desktop über Docker Exec und nicht über direkte HTTP-Verbindungen konzipiert ist.

Verwenden von Docker Compose

  1. Erstellen und starten Sie den Docker-Container:

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

# View logs
docker compose logs -f s3-mcp
  1. So stoppen Sie den Container:

docker compose down

Docker mit MinIO zum Testen verwenden

Das Docker Compose-Setup umfasst einen MinIO-Dienst für lokale Tests:

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

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

Der MinIO-Dienst erstellt automatisch zwei Test-Buckets ( test-bucket-1 und test-bucket-2 ) und lädt Beispieldateien zum Testen hoch.

Debuggen mit MCP Inspector

So debuggen Sie den Server mit 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

Bei Verwendung der Option --docker-compose führt das Skript Folgendes aus:

  1. Starten Sie MinIO und die S3 MCP-Servercontainer, falls diese nicht ausgeführt werden

  2. Starten Sie den mit dem S3 MCP-Server verbundenen MCP Inspector

  3. Anschließend können Sie die S3-Tools mit der lokalen MinIO-Instanz testen

Verbindung zu Claude Desktop herstellen

So verwenden Sie diesen Server mit Claude Desktop:

  1. Bearbeiten Sie Ihre Claude Desktop-Konfigurationsdatei:

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

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

  2. Fügen Sie den S3 MCP-Server zur Konfiguration hinzu:

{
  "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-Option für Claude Desktop 🐳

Sie können Claude Desktop auch so konfigurieren, dass ein laufender Docker-Container für den MCP-Server verwendet wird:

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

⚠️ Wichtige Voraussetzungen : Damit diese Docker-Konfiguration funktioniert, MÜSSEN Sie zuerst den Docker-Container erstellen und ausführen, BEVOR Sie Claude Desktop starten:

# 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

Ohne einen laufenden Container zeigt Claude Desktop beim Versuch, S3-Tools zu verwenden, Fehler an.

Die obige Docker-Konfiguration verwendet exec , um MCP-Anfragen direkt an den laufenden Container zu senden. Es ist keine Portzuordnung erforderlich, da Claude direkt mit dem Container kommuniziert und nicht über einen Netzwerkport.

Hinweis : Stellen Sie sicher, dass der Containername in der Konfiguration ( aws-s3-mcp-server ) mit dem Namen Ihres laufenden Containers übereinstimmt.

Wichtig : Bitte beachten Sie Folgendes, wenn Sie die obige Konfiguration verwenden

  • Ersetzen Sie AWS_ACCESS_KEY_ID und AWS_SECRET_ACCESS_KEY durch Ihre tatsächlichen Anmeldeinformationen

  • S3_BUCKETS sollte eine durch Kommas getrennte Liste der Buckets enthalten, auf die Sie Zugriff gewähren möchten

  • AWS_REGION sollte auf die Region eingestellt werden, in der sich Ihre Buckets befinden

💣 Wenn ein Fehler auf Claude Desktop auftritt

Wenn bei der obigen Konfiguration in Claude Desktop Fehler auftreten, versuchen Sie es mit absoluten Pfaden wie folgt:

# 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"
      }
    }
  }
}

Verfügbare Tools

Bucket-Liste

Listet verfügbare S3-Buckets auf, auf die der Server Zugriff hat. Dieses Tool berücksichtigt die S3_BUCKETS -Konfiguration, die die angezeigten Buckets einschränkt.

Parameter: Keine

Beispielausgabe:

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

Listenobjekte

Listet Objekte in einem angegebenen S3-Bucket auf.

Parameter:

  • bucket (erforderlich): Name des S3-Buckets, aus dem Objekte aufgelistet werden sollen

  • prefix (optional): Präfix zum Filtern von Objekten (wie ein Ordnerpfad)

  • maxKeys (optional): Maximale Anzahl der zurückzugebenden Objekte

Beispielausgabe:

[
  {
    "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"
  }
]

Objekt abrufen

Ruft ein Objekt aus einem angegebenen S3-Bucket ab. Textdateien werden als einfacher Text zurückgegeben, Binärdateien mit eingeschränkten Details.

Parameter:

  • bucket (erforderlich): Name des S3-Buckets

  • key (erforderlich): Schlüssel (Pfad) des abzurufenden Objekts

Beispiel für eine Textausgabe:

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

Beispiel einer Binärausgabe:

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

Sicherheitsüberlegungen

  • Der Server greift nur auf die Buckets zu, die in der Umgebungsvariable S3_BUCKETS angegeben sind.

  • AWS-Anmeldeinformationen müssen über die entsprechenden Berechtigungen für die Buckets verfügen

  • Verwenden Sie beim Konfigurieren von AWS-Berechtigungen das Prinzip der geringsten Privilegien

  • Für den Produktionseinsatz sollten Sie die Verwendung von IAM-Rollen mit spezifischen S3-Berechtigungen in Betracht ziehen

Verwendung mit Claude

Wenn Sie mit Claude in der Desktop-App interagieren, können Sie ihn bitten, S3-Operationen auszuführen wie:

  • „Liste alle meine S3-Buckets auf“

  • "PDF-Dateien im My-Documents-Bucket zusammenfassen"

  • „Holen Sie sich die Datei README.txt aus meinem Dokumenten-Bucket.“

Claude verwendet das entsprechende MCP-Tool, um die Anfrage auszuführen und Ihnen die Ergebnisse anzuzeigen.

Lizenz

MIT

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