P

AI Tool

Postgres MCP

连接 AI agents 与 PostgreSQL 数据库的 MCP 服务器

Postgres MCP 是一款连接 AI agents 与 PostgreSQL 数据库的 Model Context Protocol 服务器。通过 MCP 协议暴露数据库 Schema 检查、行查询、SQL 执行和 RPC 调用等核心能力,使 AI 在对话中直接完成数据库相关任务。支持即插即用连接 Claude Desktop、Cursor、Codex 等主流 MCP 客户端,无需额外配置即可开始使用。

分类 developer-tools
价格 Free / Open Source
平台 macOS / Linux / Windows

使用场景

  • 基于真实 Schema 生成数据库迁移脚本
  • 对话式查询和调试生产数据
  • 自动生成 TypeScript 数据库类型定义
  • 数据库安全策略检查与审计
  • 触发数据库触发的业务逻辑

主要功能

  • Schema introspection: exposes tables, columns, indexes, and foreign keys as MCP resources
  • Read and write query execution with parameterized SQL support
  • Transaction support for safe multi-step data modifications
  • Row-level security (RLS) policy visibility for Postgres Pro users
  • Connection pooling awareness via libpq environment variables