swethasalunke-tech/postgres-dynamodb-mcp-server
If you are the rightful owner of postgres-dynamodb-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A Model Context Protocol (MCP) server that enables PostgreSQL-style operations on Amazon DynamoDB, simplifying the transition for developers familiar with relational databases.
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 createcolumns: 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 namedata: 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 namekey_condition: Primary key condition for queryingfilter_expression: Optional filter for additional conditionslimit: 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 namekey: Primary key of the record to updateupdates: Fields and values to update
delete_record
Delete a record from a DynamoDB table (equivalent to PostgreSQL DELETE).
Parameters:
table_name: Target table namekey: 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
- Install dependencies:
pip install -r requirements.txt
- 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