PostgreSQL数据库操作
STDIO提供PostgreSQL数据库操作的MCP服务器
提供PostgreSQL数据库操作的MCP服务器
-
A Model Context Protocol (MCP) server that provides PostgreSQL database operations through MCP tools.
git clone https://github.com/a21071/mcp-postgres.git cd mcp-postgres npm install
docker-compose up -d
npx prisma migrate dev
npm run build
Run the server:
npm start
getData: Retrieve user data from PostgreSQL
{ "tableName": "user" }
addUserData: Add new user to database
{ "email": "[email protected]", "name": "John Doe", "age": 30 }
deleteUserData: Delete user by ID, email or name
{ "id": "clxyz...", "email": "[email protected]", "name": "John Doe" }
updateUserData: Update user information
{ "id": "clxyz...", "email": "[email protected]", "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[] }
npm run watch
MIT