🐘
PostgreSQL MCP Server
✓ 官方/认证Anthropic (官方)
用自然语言查询 PostgreSQL 数据库,支持只读模式和完整 SQL 模式
⭐ 10.1k
GitHub Stars
stdio
安装方式
MIT
开源协议
4
可用工具
📖 详细介绍
Anthropic 官方 PostgreSQL MCP Server,让 AI 助手直接执行 SQL 查询、获取表结构、解析数据。支持只读安全模式(推荐生产使用)和读写模式,提供连接池和 schema 反射。
✨ 核心特性
✓执行任意 SQL
✓只读安全模式
✓Schema 自省
✓查询计划分析
✓连接池支持
🛠️ 可用工具 (4)
query()
list_tables()
describe_table()
explain_query()
🎯 适用场景
▸自然语言查数据
▸生成报表
▸数据库 schema 探索
▸数据迁移辅助
▸BI 查询
⚙️ 安装与配置
系统要求
- •Python 3.10+
- •PostgreSQL 12+
- •数据库连接字符串
安装命令
uvx mcp-server-postgres postgresql://user:pass@host:5432/dbClaude Desktop 配置 (claude_desktop_config.json)
{
"mcpServers": {
"postgres-mcp-server": {
"command": "uvx",
"args": [
"mcp-server-postgres",
"postgresql://user:pass@host:5432/db"
]
}
}
}🔗 相关链接
🧩 相关 MCP Servers
🐬
MySQL MCP Server
Community
MySQL 数据库读写查询 MCP,支持 Schema 浏览、SQL 执行、事务管理、连接池
MySQLSQL关系型数据库只读
⭐4.2kstdio简单
🐘
PostgreSQL MCP
Community
PostgreSQL 完整功能 MCP,支持 pgvector、PostGIS、pg_trgm,零配置快速接入
PostgreSQLpgvectorPostGISSQL
⭐5.6kstdio简单
🗄️
SQLite MCP Server
✓ 官方Anthropic (官方)
查询和操作本地 SQLite 数据库文件,适合原型和嵌入式应用
SQLite本地嵌入式官方
⭐10.1kstdio简单
📋
Airtable MCP Server
Community
AI 读写 Airtable 数据库:创建/查询/更新记录、字段管理、附件
Airtable数据库低代码No-Code
⭐0.3kstdio中等