PostgreSQL 数据库
PostgreSQL连接 PostgreSQL 数据库,执行 SQL 查询、查看表结构、分析数据。
安装命令
npx -y @modelcontextprotocol/server-postgres postgresql://user:pass@localhost/db 配置示例
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://user:password@localhost:5432/mydb"]
}
}
} 包含工具
querylist_tablesdescribe_table
常见问题(FAQ)
PostgreSQL 数据库 MCP 是做什么的?
PostgreSQL 数据库 是一个 MCP 服务器,主要能力是:连接 PostgreSQL 数据库,执行 SQL 查询、查看表结构、分析数据。
PostgreSQL 数据库 如何安装到 Claude Code?
执行安装命令并加入 MCP 配置即可:npx -y @modelcontextprotocol/server-postgres postgresql://user:pass@localhost/db
PostgreSQL 数据库 提供哪些工具?
当前包含工具:query、list_tables、describe_table
PostgreSQL 数据库 适合新手吗?
适合程度取决于你的使用场景。当前难度标记为 intermediate,建议先用只读或测试环境验证。