MCP PostgreSQL Server
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
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP PostgreSQL Serveradd a new user with email jane@example.com and name Jane Smith"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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: pg-mcp
Installation
Clone the repository
Install dependencies:
git clone https://github.com/a21071/mcp-postgres.git
cd mcp-postgres
npm installSet up PostgreSQL database:
docker-compose up -dRun database migrations:
npx prisma migrate devBuild the project:
npm run buildUsage
Run the server:
npm startAvailable 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:
model User {
id String @id @default(cuid())
email String @unique
name String?
age Int?
createdAt DateTime @default(now())
posts Post[]
}
Development
Watch mode:
npm run watchDependencies
@modelcontextprotocol/sdk - MCP server SDK
Prisma - Type-safe database client
TypeScript - Type checking
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
- SupabaseOAuthcom.supabase
MCP server for interacting with the Supabase platform
A Model Context Protocol (MCP) server for Selise Blocks Cloud integration
Model Context Protocol server for Studex tools, notifications, and profile integrations
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server implementation that provides a simple interface to interact with PostgreSQL databases, enabling SQL queries, database operations, and schema management through MCP.-
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server for PostgreSQL that enables database operations like querying, schema inspection, performance analysis, and administration through a JSON-RPC 2.0 interface.MIT
- FlicenseNot gradedqualityDmaintenanceA standardized Model Context Protocol server for interacting with PostgreSQL databases, enabling full CRUD operations, schema management, and database introspection.1-
- FlicenseNot gradedqualityDmaintenanceMCP server for managing users in PostgreSQL, enabling CRUD operations and search via natural language commands.-