Skip to main content
Glama

MCP PostgreSQL Server

by a21071

MCP PostgreSQL 服务器

-

通过 MCP 工具提供 PostgreSQL 数据库操作的模型上下文协议 (MCP) 服务器。

特征

  • User 和 Post 实体的 CRUD 操作
  • 使用 Prisma 进行类型安全的数据库操作
  • MCP兼容工具接口
  • 使用 TypeScript 构建以确保类型安全

安装

  1. 克隆存储库
  2. 安装依赖项:
git clone https://github.com/a21071/mcp-postgres.git cd mcp-postgres npm install
  1. 设置 PostgreSQL 数据库:
docker-compose up -d
  1. 运行数据库迁移:
npx prisma migrate dev
  1. 构建项目:
npm run build

用法

运行服务器:

npm start

可用的 MCP 工具

  • getData :从 PostgreSQL 检索用户数据
    { "tableName": "user" }
  • addUserData :将新用户添加到数据库
    { "email": "user@example.com", "name": "John Doe", "age": 30 }
  • deleteUserData :通过 ID、电子邮件或姓名删除用户
    { "id": "clxyz...", "email": "user@example.com", "name": "John Doe" }
  • updateUserData :更新用户信息
    { "id": "clxyz...", "email": "new@example.com", "name": "New Name" }

数据库架构

服务器使用以下 Prisma 模式:

model User { id String @id @default(cuid()) email String @unique name String? age Int? createdAt DateTime @default(now()) posts Post[] }

发展

  • 观看模式:
npm run watch

依赖项

执照

麻省理工学院

-
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 工具对用户和帖子实体执行 PostgreSQL 数据库操作(创建、读取、更新、删除)。

  1. 特征
    1. 安装
      1. 用法
        1. 可用的 MCP 工具
      2. 数据库架构
        1. 发展
          1. 依赖项
            1. 执照

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                A server implementing the Model Context Protocol (MCP) for Cursor that allows using a PostgreSQL database as storage for model contexts, enabling secure database exploration and querying.
                Last updated -
                JavaScript
                • Linux
                • Apple
              • -
                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 -
                4
                JavaScript
              • -
                security
                F
                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 -
                16,948
                JavaScript
                • Linux
                • Apple
              • -
                security
                A
                license
                -
                quality
                A template project for building custom MCP servers that enables direct access to PostgreSQL databases, allowing SQL query execution and schema information retrieval through the Model Context Protocol.
                Last updated -
                3
                Python
                MIT License
                • Apple
                • Linux

              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