Skip to main content
Glama

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

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

-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

MCP 도구를 통해 User 및 Post 엔터티에 대한 PostgreSQL 데이터베이스 작업(생성, 읽기, 업데이트, 삭제)을 수행할 수 있는 모델 컨텍스트 프로토콜 서버입니다.

  1. 특징
    1. 설치
      1. 용법
        1. 사용 가능한 MCP 도구
      2. 데이터베이스 스키마
        1. 개발
          1. 종속성
            1. 특허

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol server providing both read and write access to PostgreSQL databases, enabling LLMs to query data, modify records, and manage database schemas.
                Last updated -
                317
                7
              • A
                security
                A
                license
                A
                quality
                A Model Context Protocol server that enables powerful PostgreSQL database management capabilities including analysis, schema management, data migration, and monitoring through natural language interactions.
                Last updated -
                18
                808
                116
                AGPL 3.0
                • Linux
                • Apple
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that enables interaction with PostgreSQL databases to list tables, retrieve schemas, and execute read-only SQL queries.
                Last updated -
                24
                MIT License
                • Linux
                • Apple
              • A
                security
                A
                license
                A
                quality
                A Model Context Protocol server that enables interaction with PostgreSQL databases for analyzing setups, debugging issues, managing schemas, migrating data, and monitoring performance.
                Last updated -
                1
                1
                1
                MIT License

              View all related MCP servers

              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