Skip to main content
Glama

S3 MCP サーバー

CI トリヴィスキャン npmバージョン npmダウンロード ライセンス: MIT Node.js バージョン

S3 バケットおよびオブジェクトと対話するためのツールを提供する Amazon S3 モデルコンテキストプロトコル (MCP) サーバー。

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

概要

このMCPサーバーは、Claudeのような大規模言語モデル(LLM)がAWS S3ストレージと連携できるようにします。以下のツールを提供します。

  • 利用可能なS3バケットの一覧表示

  • バケット内のオブジェクトの一覧表示

  • オブジェクトの内容を取得しています

サーバーは TypeScript と MCP SDK を使用して構築されており、LLM が S3 とインターフェースするための安全で標準化された方法を提供します。

Related MCP server: AWS MCP Server

インストール

前提条件

  • Node.js 18以上

  • npmまたはyarn

  • 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 アクセスを構成します。

AWS 設定で.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

または、これらを環境変数として設定します。

構成

サーバーは次の環境変数を使用して構成できます。

変数

説明

デフォルト

AWS_REGION

S3バケットが配置されているAWSリージョン

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 のセットアップ 🐳

Docker CLI または Docker Compose を使用して、S3 MCP サーバーを Docker コンテナとして実行できます。

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

コンテナーは、直接の HTTP 接続ではなく、Docker exec を介して Claude Desktop で使用されるように設計されているため、ポートを公開しないことに注意してください。

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

MinIO で Docker を使ってテストする

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 サービスは、2 つのテスト バケット ( 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. S3 MCPサーバーに接続されたMCPインスペクターを起動します。

  3. その後、S3ツールをローカルのMinIOインスタンスに対してテストすることができます。

Claudeデスクトップに接続しています

このサーバーを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"
      }
    }
  }
}

Claude デスクトップ用の Docker オプション 🐳

また、MCP サーバーで実行中の Docker コンテナを使用するように Claude Desktop を構成することもできます。

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

⚠️ 重要な前提条件: この Docker 構成が機能するには、Claude Desktop を起動する前に、まず Docker コンテナをビルドして実行する必要があります。

# 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 の権限を設定するときは、最小権限の原則を使用します。

  • 本番環境での使用には、特定のS3権限を持つIAMロールの使用を検討してください。

クロードとの使用

デスクトップ アプリで Claude と対話する場合、次のような S3 操作を実行するように要求できます。

  • 「すべてのS3バケットを一覧表示する」

  • 「my-documents-bucket 内の PDF ファイルを要約する」

  • 「my-documents-bucket から README.txt ファイルを取得する」

Claude は適切な 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