PostgreSQL Server

MCP example for postgres

Installation

Installing for Claude Desktop

Manual Configuration Required

This MCP server requires manual configuration. Run the command below to open your configuration file:

npx mcpbar@latest edit -c claude

This will open your configuration file where you can add the PostgreSQL Server MCP server manually.

MCP PostgreSQL Server

-MCP Postgres Logo

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

Installation

  1. Clone the repository
  2. Install dependencies:
git clone https://github.com/a21071/mcp-postgres.git
cd mcp-postgres
npm install
  1. Set up PostgreSQL database:
docker-compose up -d
  1. Run database migrations:
npx prisma migrate dev
  1. Build the project:
npm run build

Usage

Run the server:

npm start

Available MCP Tools

  • 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"
    }
    

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 watch

Dependencies

License

MIT

Share:
Details:
  • Stars


    0
  • Forks


    0
  • Last commit


    3 months ago
  • Repository age


    3 months
View Repository

Auto-fetched from GitHub .

MCP servers similar to PostgreSQL Server:

 

 
 
  • Stars


  • Forks


  • Last commit


 

 
 
  • Stars


  • Forks


  • Last commit


 

 
 
  • Stars


  • Forks


  • Last commit


PostgreSQL Server: MCP Server – MCP.Bar