DynamoDB-Toolbox

by dynamodb-toolbox

262 downloads
Not rated
GitHub Website

About

Leverages your Schemas and Access Patterns to interact with your [DynamoDB](https://aws.amazon.com/dynamodb) Database using natural language.

Details

Author
dynamodb-toolbox
Downloads
262
Categories
Other, Database, Cloud Service

- Simplifies complex DynamoDB request construction
- Validates both input and output items against schemas
- Rich schema syntax with defaults, composition, transformation
- Full TypeScript type-safety with auto-completion
- Tree-shakable – import only what you need
- First-class support for single-table designs
- Compatible with LLRT (Low Latency Runtime)

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name DynamoDB-Toolbox
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install via npm (npm install dynamodb-toolbox), then import and configure entities and tables. Use the provided API (e.g., MusicEntity.build(UpdateItemCommand).item({...}).send()) to craft DynamoDB requests. Detailed guides are available in the official documentation.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "dynamodb-toolbox": {
            "dynamodb": {
                "command": "node",
                "args": [
                    "/ABSOLUTE/PATH/TO/FOLDER/build/index.js"
                ]
            }
        }
    }
}

McpServers

{
    "dynamodb": {
        "command": "node",
        "args": [
            "/ABSOLUTE/PATH/TO/FOLDER/build/index.js"
        ]
    }
}

Why use DynamoDB-Toolbox? <!-- omit in toc -->

If you're here, we're assuming you know DynamoDB.

If you don't, check out the official AWS docs.

> TLDR: _DynamoDB is a key-value DB designed to run high-performance applications at any scale. It automatically scales up and down based on your current traffic, and removes the need to maintain connections, which makes it the go-to DB for many projects, including (but not limited to) serverless applications._

If you've ever used the official Document Client, you know that it’s painful to use.

Take a look at this UpdateCommand example straight from the AWS documentation:

await documentClient.send(
  new UpdateCommand({
    TableName: 'Music',
    Key: {
      // 👇 No type-safety on the Primary Key
      artist: 'Acme Band',
      songTitle: 'Happy Day'
    },
    // 👇 Complex string expressions (+ still no type-safety)
    UpdateExpression: 'SET #Y = :y, #AT = :t',
    // 👇 Attribute names provided separately
    ExpressionAttributeNames: {
      '#AT': 'albumTitle',
      '#Y': 'year'
    },
    // 👇 Attribute values as well
    ExpressionAttributeValues: {
      // 👇 No validation or type-safety to enforce DB schema
      ':t': 'Louder Than Ever',
      ':y': '2015'
    },
    ReturnValues: 'ALL_NEW'
  })
)

It's a very simple example (updating two fields of a Music item), yet already complex 😰

Things only get messier as your data grows in complexity: What if your items have many attributes, with some of them deep or optional? What if you need to index an item based on its value or handle different types of items? What about polymorphism?

In those cases, which are fairly common, the required code to generate those requests gets very hard to maintain. That's when DynamoDB-Toolbox comes to the rescue 💪

Here's is a quick preview with the DynamoDB-Toolbox version of the UpdateCommand described above:

// Validated AND type-safe syntax 🙌
await MusicEntity.build(UpdateItemCommand)
  .item({
    artist: 'Acme Band',
    songTitle: 'Happy Day',
    albumTitle: 'Louder Than Ever',
    year: '2015'
  })
  .options({ returnValues: 'ALL_NEW' })
  .send()

And just like that, we went from an obscure 20 lines to a readable and elegant 10-liner 🤩

Not bad, eh? Let's get started!

Become a Sponsor!

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.