dynamodb mcp server
Enables management of DynamoDB resources through the Model Context Protocol, supporting table and index creation, capacity management, and data operations without delete functionality to prevent accidental data loss.
Enables management of DynamoDB resources through the Model Context Protocol, supporting table and index creation, capacity management, and data operations without delete functionality to prevent accidental data loss.
A Model Context Protocol server for managing Amazon DynamoDB resources. This server provides tools for table management, capacity management, and data operations.
Iman Kamyabi ([email protected])
Note: Delete operations are not supported to prevent accidental data loss.
Install dependencies:
npm install
Configure AWS credentials as environment variables:
export AWS_ACCESS_KEY_ID="your_access_key"
export AWS_SECRET_ACCESS_KEY="your_secret_key"
export AWS_REGION="your_region"
Build the server:
npm run build
Start the server:
npm start
Creates a new DynamoDB table with specified configuration.
Parameters:
- tableName
: Name of the table to create
- partitionKey
: Name of the partition key
- partitionKeyType
: Type of partition key (S=String, N=Number, B=Binary)
- sortKey
: (Optional) Name of the sort key
- sortKeyType
: (Optional) Type of sort key
- readCapacity
: Provisioned read capacity units
- writeCapacity
: Provisioned write capacity units
Example:
{
"tableName": "Users",
"partitionKey": "userId",
"partitionKeyType": "S",
"readCapacity": 5,
"writeCapacity": 5
}
Lists all DynamoDB tables in the account.
Parameters:
- limit
: (Optional) Maximum number of tables to return
- exclusiveStartTableName
: (Optional) Name of the table to start from for pagination
Example:
{
"limit": 10
}
Gets detailed information about a DynamoDB table.
Parameters:
- tableName
: Name of the table to describe
Example:
{
"tableName": "Users"
}
Creates a global secondary index on a table.
Parameters:
- tableName
: Name of the table
- indexName
: Name of the new index
- partitionKey
: Partition key for the index
- partitionKeyType
: Type of partition key
- sortKey
: (Optional) Sort key for the index
- sortKeyType
: (Optional) Type of sort key
- projectionType
: Type of projection (ALL, KEYS_ONLY, INCLUDE)
- nonKeyAttributes
: (Optional) Non-key attributes to project
- readCapacity
: Provisioned read capacity units
- writeCapacity
: Provisioned write capacity units
Example:
{
"tableName": "Users",
"indexName": "EmailIndex",
"partitionKey": "email",
"partitionKeyType": "S",
"projectionType": "ALL",
"readCapacity": 5,
"writeCapacity": 5
}
Updates the provisioned capacity of a global secondary index.
Parameters:
- tableName
: Name of the table
- indexName
: Name of the index to update
- readCapacity
: New read capacity units
- writeCapacity
: New write capacity units
Example:
{
"tableName": "Users",
"indexName": "EmailIndex",
"readCapacity": 10,
"writeCapacity": 10
}
Creates a local secondary index on a table (must be done during table creation).
Parameters:
- tableName
: Name of the table
- indexName
: Name of the new index
- partitionKey
: Partition key for the table
- partitionKeyType
: Type of partition key
- sortKey
: Sort key for the index
- sortKeyType
: Type of sort key
- projectionType
: Type of projection (ALL, KEYS_ONLY, INCLUDE)
- nonKeyAttributes
: (Optional) Non-key attributes to project
- readCapacity
: (Optional) Provisioned read capacity units
- writeCapacity
: (Optional) Provisioned write capacity units
Example:
{
"tableName": "Users",
"indexName": "CreatedAtIndex",
"partitionKey": "userId",
"partitionKeyType": "S",
"sortKey": "createdAt",
"sortKeyType": "N",
"projectionType": "ALL"
}
Updates the provisioned capacity of a table.
Parameters:
- tableName
: Name of the table
- readCapacity
: New read capacity units
- writeCapacity
: New write capacity units
Example:
{
"tableName": "Users",
"readCapacity": 10,
"writeCapacity": 10
}
Inserts or replaces an item in a table.
Parameters:
- tableName
: Name of the table
- item
: Item to put into the table (as JSON object)
Example:
{
"tableName": "Users",
"item": {
"userId": "123",
"name": "John Doe",
"email": "[email protected]"
}
}
Retrieves an item from a table by its primary key.
Parameters:
- tableName
: Name of the table
- key
: Primary key of the item to retrieve
Example:
{
"tableName": "Users",
"key": {
"userId": "123"
}
}
Updates specific attributes of an item in a table.
Parameters:
- tableName
: Name of the table
- key
: Primary key of the item to update
- updateExpression
: Update expression
- expressionAttributeNames
: Attribute name mappings
- expressionAttributeValues
: Values for the update expression
- conditionExpression
: (Optional) Condition for update
- returnValues
: (Optional) What values to return
Example:
{
"tableName": "Users",
"key": {
"userId": "123"
},
"updateExpression": "SET #n = :name",
"expressionAttributeNames": {
"#n": "name"
},
"expressionAttributeValues": {
":name": "Jane Doe"
}
}
Queries a table using key conditions and optional filters.
Parameters:
- tableName
: Name of the table
- keyConditionExpression
: Key condition expression
- expressionAttributeValues
: Values for the key condition expression
- expressionAttributeNames
: (Optional) Attribute name mappings
- filterExpression
: (Optional) Filter expression for results
- limit
: (Optional) Maximum number of items to return
Example:
{
"tableName": "Users",
"keyConditionExpression": "userId = :id",
"expressionAttributeValues": {
":id": "123"
}
}
Scans an entire table with optional filters.
Parameters:
- tableName
: Name of the table
- filterExpression
: (Optional) Filter expression
- expressionAttributeValues
: (Optional) Values for the filter expression
- expressionAttributeNames
: (Optional) Attribute name mappings
- limit
: (Optional) Maximum number of items to return
Example:
{
"tableName": "Users",
"filterExpression": "age > :minAge",
"expressionAttributeValues": {
":minAge": 21
}
}
Here are some example questions you can ask Claude when using this DynamoDB MCP server:
Add this to your claude_desktop_config.json
:
{
"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:
docker build -t mcp/dynamodb-mcp-server -f Dockerfile .
To run in development mode with auto-reloading:
npm run dev
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.