Skip to main content
Glama
a21071

MCP PostgreSQL Server

by a21071

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

  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": "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 watch

Dependencies

License

MIT

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    D
    maintenance
    A 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.
    Last updated
  • A
    license
    -
    quality
    D
    maintenance
    A 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.
    Last updated
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    A standardized Model Context Protocol server for interacting with PostgreSQL databases, enabling full CRUD operations, schema management, and database introspection.
    Last updated
    1
  • F
    license
    -
    quality
    B
    maintenance
    MCP server for managing users in PostgreSQL, enabling CRUD operations and search via natural language commands.
    Last updated

View all related MCP servers

Related MCP Connectors

  • MCP server for managing Prisma Postgres.

  • MCP (Model Context Protocol) server for Appwrite

  • MCP server for interacting with the Supabase platform

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/a21071/mcp-postgres'

If you have feedback or need assistance with the MCP directory API, please join our Discord server