Skip to content

Advanced MCP server that enables PostgreSQL applications to seamlessly use DynamoDB with zero code changes. Supports complex queries, JOINs, aggregations, transactions, and window functions.

Notifications You must be signed in to change notification settings

swethasalunke-tech/postgres-dynamodb-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostgreSQL-DynamoDB MCP Server

A Model Context Protocol (MCP) server that provides tools to help customers use Amazon DynamoDB as if it were PostgreSQL. This server translates PostgreSQL-style operations into DynamoDB operations, making it easier for developers familiar with relational databases to work with DynamoDB.

Features

  • PostgreSQL-like Interface: Use familiar SQL-style operations with DynamoDB
  • Table Management: Create tables with PostgreSQL-style schema definitions
  • CRUD Operations: Insert, select, update, and delete records using intuitive commands
  • Schema Inspection: Describe tables and their structure
  • AWS Integration: Seamless integration with AWS DynamoDB service

Available Tools

create_table

Create a DynamoDB table with PostgreSQL-like schema definition.

Parameters:

  • table_name: Name of the table to create
  • columns: Array of column definitions with name, type, and key properties

insert_record

Insert a record into a DynamoDB table (equivalent to PostgreSQL INSERT).

Parameters:

  • table_name: Target table name
  • data: Key-value pairs representing the record to insert

select_records

Query records from a DynamoDB table (equivalent to PostgreSQL SELECT).

Parameters:

  • table_name: Source table name
  • key_condition: Primary key condition for querying
  • filter_expression: Optional filter for additional conditions
  • limit: Maximum number of records to return

update_record

Update an existing record in a DynamoDB table (equivalent to PostgreSQL UPDATE).

Parameters:

  • table_name: Target table name
  • key: Primary key of the record to update
  • updates: Fields and values to update

delete_record

Delete a record from a DynamoDB table (equivalent to PostgreSQL DELETE).

Parameters:

  • table_name: Target table name
  • key: Primary key of the record to delete

describe_table

Get detailed information about a table's schema and properties (equivalent to PostgreSQL \d).

Parameters:

  • table_name: Name of the table to describe

Installation

  1. Install dependencies:
pip install -r requirements.txt
  1. Configure AWS credentials:
aws configure

Usage

Run the MCP server:

python server.py

The server will start and listen for MCP protocol messages via stdio.

Configuration

Ensure your AWS credentials are properly configured with permissions to:

  • Create DynamoDB tables
  • Read/write DynamoDB items
  • Describe DynamoDB tables

Example Usage

Creating a Table

{
  "table_name": "users",
  "columns": [
    {"name": "user_id", "type": "string", "primary_key": true},
    {"name": "email", "type": "string"},
    {"name": "created_at", "type": "string", "sort_key": true}
  ]
}

Inserting Data

{
  "table_name": "users",
  "data": {
    "user_id": "123",
    "email": "user@example.com",
    "created_at": "2024-01-01T00:00:00Z"
  }
}

Querying Data

{
  "table_name": "users",
  "key_condition": {"user_id": "123"},
  "limit": 10
}

Benefits

  • Familiar Interface: Use PostgreSQL-style operations with DynamoDB
  • Reduced Learning Curve: Easier transition from relational to NoSQL databases
  • MCP Integration: Works seamlessly with MCP-compatible AI assistants and tools
  • AWS Native: Built specifically for Amazon DynamoDB with best practices

License

MIT License

About

Advanced MCP server that enables PostgreSQL applications to seamlessly use DynamoDB with zero code changes. Supports complex queries, JOINs, aggregations, transactions, and window functions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages