Skip to main content
Glama
DynamoDB MCP Server

DynamoDB MCP Server

by imankamyabi

DynamoDB MCP サーバー

Amazon DynamoDB リソースを管理するためのモデルコンテキストプロトコルサーバー。このサーバーは、テーブル管理、キャパシティ管理、データ操作のためのツールを提供します。

著者

イマン・カミヤビ ( ikmyb@icloud.com )

Related MCP server: mcp-server-duckdb

特徴

テーブル管理

  • カスタマイズ可能な設定で新しい DynamoDB テーブルを作成する

  • 既存のテーブルを一覧表示する

  • 詳細なテーブル情報を取得する

  • テーブル設定を構成する

インデックス管理

  • グローバルセカンダリインデックス(GSI)の作成と管理

  • GSIの容量を更新

  • ローカルセカンダリインデックス(LSI)を作成する

キャパシティ管理

  • プロビジョニングされた読み取り/書き込み容量ユニットを更新する

  • テーブルスループット設定を管理する

データ操作

  • 表内の項目を挿入または置換する

  • 主キーでアイテムを取得する

  • 特定のアイテム属性を更新する

  • 条件付きでテーブルをクエリする

  • フィルターを使用してテーブルをスキャンする

注意: 誤ってデータが失われるのを防ぐため、削除操作はサポートされていません。

設定

  1. 依存関係をインストールします:

npm install
  1. AWS 認証情報を環境変数として設定します。

export AWS_ACCESS_KEY_ID="your_access_key"
export AWS_SECRET_ACCESS_KEY="your_secret_key"
export AWS_REGION="your_region"
  1. サーバーを構築します。

npm run build
  1. サーバーを起動します。

npm start

ツール

テーブル作成

指定された設定で新しい DynamoDB テーブルを作成します。

パラメータ:

  • tableName : 作成するテーブルの名前

  • partitionKey : パーティションキーの名前

  • partitionKeyType : パーティションキーのタイプ (S=文字列、N=数値、B=バイナリ)

  • sortKey : (オプション) ソートキーの名前

  • sortKeyType : (オプション) ソートキーの種類

  • readCapacity : プロビジョニングされた読み取り容量単位

  • writeCapacity : プロビジョニングされた書き込み容量単位

例:

{
  "tableName": "Users",
  "partitionKey": "userId",
  "partitionKeyType": "S",
  "readCapacity": 5,
  "writeCapacity": 5
}

リストテーブル

アカウント内のすべての DynamoDB テーブルを一覧表示します。

パラメータ:

  • limit : (オプション) 返されるテーブルの最大数

  • exclusiveStartTableName : (オプション) ページ区切りの開始テーブルの名前

例:

{
  "limit": 10
}

テーブルの説明

DynamoDB テーブルに関する詳細情報を取得します。

パラメータ:

  • tableName : 記述するテーブルの名前

例:

{
  "tableName": "Users"
}

作成_gsi

テーブルにグローバルセカンダリインデックスを作成します。

パラメータ:

  • tableName : テーブルの名前

  • indexName : 新しいインデックスの名前

  • partitionKey : インデックスのパーティションキー

  • partitionKeyType : パーティションキーの種類

  • sortKey : (オプション) インデックスのソートキー

  • sortKeyType : (オプション) ソートキーの種類

  • projectionType : 投影の種類 (ALL、KEYS_ONLY、INCLUDE)

  • nonKeyAttributes : (オプション) プロジェクトにキー以外の属性を追加する

  • readCapacity : プロビジョニングされた読み取り容量単位

  • writeCapacity : プロビジョニングされた書き込み容量単位

例:

{
  "tableName": "Users",
  "indexName": "EmailIndex",
  "partitionKey": "email",
  "partitionKeyType": "S",
  "projectionType": "ALL",
  "readCapacity": 5,
  "writeCapacity": 5
}

更新_gsi

グローバルセカンダリインデックスのプロビジョニングされた容量を更新します。

パラメータ:

  • tableName : テーブルの名前

  • indexName : 更新するインデックスの名前

  • readCapacity : 新しい読み取り容量単位

  • writeCapacity : 新しい書き込み容量単位

例:

{
  "tableName": "Users",
  "indexName": "EmailIndex",
  "readCapacity": 10,
  "writeCapacity": 10
}

作成_lsi

テーブルにローカルセカンダリインデックスを作成します (テーブルの作成中に実行する必要があります)。

パラメータ:

  • tableName : テーブルの名前

  • indexName : 新しいインデックスの名前

  • partitionKey : テーブルのパーティションキー

  • partitionKeyType : パーティションキーの種類

  • sortKey : インデックスのソートキー

  • sortKeyType : ソートキーの種類

  • projectionType : 投影の種類 (ALL、KEYS_ONLY、INCLUDE)

  • nonKeyAttributes : (オプション) プロジェクトにキー以外の属性を追加する

  • readCapacity : (オプション) プロビジョニングされた読み取り容量単位

  • writeCapacity : (オプション) プロビジョニングされた書き込み容量単位

例:

{
  "tableName": "Users",
  "indexName": "CreatedAtIndex",
  "partitionKey": "userId",
  "partitionKeyType": "S",
  "sortKey": "createdAt",
  "sortKeyType": "N",
  "projectionType": "ALL"
}

更新容量

テーブルのプロビジョニングされた容量を更新します。

パラメータ:

  • tableName : テーブルの名前

  • readCapacity : 新しい読み取り容量単位

  • writeCapacity : 新しい書き込み容量単位

例:

{
  "tableName": "Users",
  "readCapacity": 10,
  "writeCapacity": 10
}

アイテムを置く

テーブル内の項目を挿入または置き換えます。

パラメータ:

  • tableName : テーブルの名前

  • item : テーブルに入れるアイテム(JSONオブジェクトとして)

例:

{
  "tableName": "Users",
  "item": {
    "userId": "123",
    "name": "John Doe",
    "email": "john@example.com"
  }
}

アイテムを取得

主キーによってテーブルから項目を取得します。

パラメータ:

  • tableName : テーブルの名前

  • key : 取得するアイテムの主キー

例:

{
  "tableName": "Users",
  "key": {
    "userId": "123"
  }
}

アイテムの更新

テーブル内の項目の特定の属性を更新します。

パラメータ:

  • tableName : テーブルの名前

  • key : 更新するアイテムの主キー

  • updateExpression : 更新式

  • expressionAttributeNames : 属性名のマッピング

  • expressionAttributeValues : 更新式の値

  • conditionExpression : (オプション) 更新の条件

  • returnValues : (オプション) 返される値

例:

{
  "tableName": "Users",
  "key": {
    "userId": "123"
  },
  "updateExpression": "SET #n = :name",
  "expressionAttributeNames": {
    "#n": "name"
  },
  "expressionAttributeValues": {
    ":name": "Jane Doe"
  }
}

クエリテーブル

キー条件とオプションのフィルターを使用してテーブルをクエリします。

パラメータ:

  • tableName : テーブルの名前

  • keyConditionExpression : キー条件式

  • expressionAttributeValues : キー条件式の値

  • expressionAttributeNames : (オプション) 属性名のマッピング

  • filterExpression : (オプション) 結果のフィルター式

  • limit : (オプション) 返されるアイテムの最大数

例:

{
  "tableName": "Users",
  "keyConditionExpression": "userId = :id",
  "expressionAttributeValues": {
    ":id": "123"
  }
}

スキャンテーブル

オプションのフィルターを使用してテーブル全体をスキャンします。

パラメータ:

  • tableName : テーブルの名前

  • filterExpression : (オプション) フィルター式

  • expressionAttributeValues : (オプション) フィルタ式の値

  • expressionAttributeNames : (オプション) 属性名のマッピング

  • limit : (オプション) 返されるアイテムの最大数

例:

{
  "tableName": "Users",
  "filterExpression": "age > :minAge",
  "expressionAttributeValues": {
    ":minAge": 21
  }
}

サンプル質問

この DynamoDB MCP サーバーを使用するときに Claude に尋ねることができる質問の例を次に示します。

テーブル管理

  • 「パーティションキー「productId」(文字列)とソートキー「timestamp」(数値)を持つ「Products」という新しい DynamoDB テーブルを作成します。」

  • 「アカウント内のすべての DynamoDB テーブルを一覧表示する」

  • 「Users テーブルの現在の構成は何ですか?」

  • 「Usersテーブルのメールフィールドにグローバルセカンダリインデックスを追加する」

キャパシティ管理

  • 「Usersテーブルの容量を20読み取り単位と15書き込み単位に更新します」

  • 「Users テーブルの EmailIndex GSI 容量を拡大する」

  • 「Orders テーブルに現在プロビジョニングされている容量はどれくらいですか?」

データ操作

  • 「ID '123'、名前 'John Doe'、メールアドレス ' john@example.com ' の新しいユーザーを挿入します。」

  • 「ID '123' のユーザーを取得する」

  • 「ユーザー '123' のメールアドレスを ' john.doe@example.com ' に更新します」

  • 「ユーザー '123' が行ったすべての注文を検索する」

  • 「21歳以上のユーザーをすべてリストする」

  • 「EmailIndex をクエリして、メールアドレス ' john@example.com ' を持つユーザーを検索します」

構成

AWS認証情報の設定

  1. AWS マネジメントコンソールから AWS アクセスキー ID、シークレットアクセスキー、リージョンを取得します。

  2. 一時的な認証情報 (IAM ロールなど) を使用する場合は、セッション トークンも取得します。

  3. これらの認証情報に DynamoDB 操作のための適切な権限があることを確認します。

Claude Desktopでの使用

これをclaude_desktop_config.jsonに追加します:

Docker(推奨)

{
  "mcpServers": {
    "dynamodb": {
      "command": "docker",
      "args": [ "run", "-i", "--rm", "-e", "AWS_ACCESS_KEY_ID", "-e", "AWS_SECRET_ACCESS_KEY", "-e", "AWS_REGION", "-e", "AWS_SESSION_TOKEN", "mcp/dynamodb-mcp-server" ],
      "env": {
        "AWS_ACCESS_KEY_ID": "your_access_key",
        "AWS_SECRET_ACCESS_KEY": "your_secret_key",
        "AWS_REGION": "your_region",
        "AWS_SESSION_TOKEN": "your_session_token"  
      }
    }
  }
}

建物

ドッカー:

docker build -t mcp/dynamodb-mcp-server -f Dockerfile .

発達

自動リロード付きの開発モードで実行するには:

npm run dev

ライセンス

このMCPサーバーはMITライセンスに基づいてライセンスされています。つまり、MITライセンスの条件に従って、ソフトウェアを自由に使用、改変、配布することができます。詳細については、プロジェクトリポジトリのLICENSEファイルをご覧ください。

Available Tools

12 tools
create_gsiC

Creates a global secondary index on a table

Inputs: indexName (required), partitionKey (required), partitionKeyType (required), projectionType (required), +6 more.

create_lsiC

Creates a local secondary index on a table (must be done during table creation)

Inputs: indexName (required), partitionKey (required), partitionKeyType (required), projectionType (required), +6 more.

create_tableC

Creates a new DynamoDB table with specified configuration

Inputs: partitionKey (required), partitionKeyType (required), readCapacity (required), tableName (required), +3 more.

describe_tableC

Gets detailed information about a DynamoDB table

Inputs: tableName (required).

get_itemC

Retrieves an item from a table by its primary key

Inputs: key (required), tableName (required).

list_tablesC

Lists all DynamoDB tables in the account

Inputs: exclusiveStartTableName, limit.

put_itemC

Inserts or replaces an item in a table

Inputs: item (required), tableName (required).

query_tableC

Queries a table using key conditions and optional filters

Inputs: expressionAttributeValues (required), keyConditionExpression (required), tableName (required), expressionAttributeNames, +2 more.

scan_tableC

Scans an entire table with optional filters

Inputs: tableName (required), expressionAttributeNames, expressionAttributeValues, filterExpression, +1 more.

update_capacityC

Updates the provisioned capacity of a table

Inputs: readCapacity (required), tableName (required), writeCapacity (required).

update_gsiC

Updates the provisioned capacity of a global secondary index

Inputs: indexName (required), readCapacity (required), tableName (required), writeCapacity (required).

update_itemC

Updates specific attributes of an item in a table

Inputs: expressionAttributeNames (required), expressionAttributeValues (required), key (required), tableName (required), +3 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific DynamoDB operations with no overlap. For example, create_table vs. describe_table vs. update_item are all unambiguous in their functions, and even similar-sounding tools like query_table and scan_table are clearly differentiated in their descriptions.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with snake_case throughout, such as create_table, describe_table, and update_item. The naming is predictable and readable, making it easy for agents to understand the action and target resource.

    Tool Count5/5

    With 12 tools, this server is well-scoped for DynamoDB operations, covering core CRUD, indexing, capacity management, and table lifecycle. Each tool earns its place without being overwhelming or insufficient for the domain.

    Completeness4/5

    The tool set provides strong coverage of DynamoDB's key operations, including table management, item CRUD, indexing, and capacity updates. A minor gap is the lack of tools for deleting tables or indexes, which could limit full lifecycle management, but core workflows are well-supported.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers