PostgreSQL 数据库

PostgreSQL

连接 PostgreSQL 数据库,执行 SQL 查询、查看表结构、分析数据。

分类:database 难度:intermediate 作者:modelcontextprotocol

安装命令

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,建议先用只读或测试环境验证。

今日继续阅读

对应任务:执行技术 SEO 基线迭代。自动写入下一步入口,缩短跳转路径。

自动执行时间:2026-03-10 09:12:01