Reference Servers · MODEL CONTEXT PROTOCOL
a21071 mcp postgres
MCP example for postgres
WHAT IT CONNECTS
What a21071 mcp postgres gives an AI Agent
- CRUD operations for User and Post entities
- Type-safe database operations using Prisma
- MCP-compatible tool interface
- Built with TypeScript for type safety
- Clone the repository
- Install dependencies:
- Set up PostgreSQL database:
- Run database migrations:
- Build the project:
- **getData**: Retrieve user data from PostgreSQL
- **addUserData**: Add new user to database
- **deleteUserData**: Delete user by ID, email or name
- **updateUserData**: Update user information
- Watch mode:
- [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/sdk) - MCP server SDK
- [Prisma](https://www.prisma.io/) - Type-safe database client
- [TypeScript](https://www.typescriptlang.org/) - Type checking
SECURITY
An MCP listing is not a security review
An MCP server may receive model context, credentials, local files, or permission to call external systems. Review its code, requested environment variables, network behavior, package provenance, and maintenance status before connecting it to an agent.
README
Repository documentation
A Model Context Protocol (MCP) server that provides PostgreSQL database operations through MCP tools.
- CRUD operations for User and Post entities
- Type-safe database operations using Prisma
- MCP-compatible tool interface
- Built with TypeScript for type safety
- Clone the repository
- Install dependencies:
git clone https://github.com/a21071/mcp-postgres.git
cd mcp-postgres
npm install- Set up PostgreSQL database:
docker-compose up -d- Run database migrations:
npx prisma migrate dev- Build the project:
npm run buildRun the server:
npm start-
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" }
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[]
}
- Watch mode:
npm run watch- @modelcontextprotocol/sdk - MCP server SDK
- Prisma - Type-safe database client
- TypeScript - Type checking
MIT
COMMUNITY
Save, rate, and discuss
Loading community data…