简介
PostgreSQL MCP 是一个让 AI Agent 直接访问 PostgreSQL 数据库的 MCP 服务器,GitHub 3,000+ stars。运行查询、探索表结构、管理数据。支持只读模式保障安全。
MCP server that gives AI agents direct access to PostgreSQL databases. Run queries, explore schemas, manage tables, and analyze data through natural language. 3,000+ stars.
这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。
将以下配置添加到 .mcp.json:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": { "POSTGRES_CONNECTION_STRING": "postgresql://user:pass@localhost/mydb" }
}
}
}PostgreSQL MCP 是一个让 AI Agent 直接访问 PostgreSQL 数据库的 MCP 服务器,GitHub 3,000+ stars。运行查询、探索表结构、管理数据。支持只读模式保障安全。
Part of MCP Servers. Licensed under MIT.