Provides database operations for PostgreSQL, enabling CRUD operations on User and Post entities with type-safe queries through the MCP interface
Utilizes Prisma for type-safe database operations, providing a structured interface to interact with the PostgreSQL database schema
MCP PostgreSQL Server
-
A Model Context Protocol (MCP) server that provides PostgreSQL database operations through MCP tools.
Features
CRUD operations for User and Post entities
Type-safe database operations using Prisma
MCP-compatible tool interface
Built with TypeScript for type safety
Related MCP server: PostgreSQL MCP Server
Installation
Clone the repository
Install dependencies:
Set up PostgreSQL database:
Run database migrations:
Build the project:
Usage
Run the server:
Available MCP Tools
getData: Retrieve user data from PostgreSQL
{ "tableName": "user" }addUserData: Add new user to database
{ "email": "user@example.com", "name": "John Doe", "age": 30 }deleteUserData: Delete user by ID, email or name
{ "id": "clxyz...", "email": "user@example.com", "name": "John Doe" }updateUserData: Update user information
{ "id": "clxyz...", "email": "new@example.com", "name": "New Name" }
Database Schema
The server uses the following Prisma schema:
Development
Watch mode:
Dependencies
@modelcontextprotocol/sdk - MCP server SDK
Prisma - Type-safe database client
TypeScript - Type checking
License
MIT