PostgreSQL MCP Server 是一个模型上下文协议(MCP)服务器,它提供直接执行 PostgreSQL 数据库查询的能力。该服务器支持对 PostgreSQL 数据库执行自定义 SQL 查询,支持参数化查询和可配置的超时设置。此项目专为 Cursor IDE 设计。
PostgreSQL MCP Server 是一个模型上下文协议(MCP)服务器,可直接执行 PostgreSQL 数据库查询。支持自定义 SQL 查询、参数化查询和可配置的超时设置,专为 Cursor IDE 打造。
要通过 Smithery 自动安装适用于 Claude Desktop 的 PostgreSQL 数据库查询服务器,请执行以下命令:
npx -y @smithery/cli install @1Levick3/postgresql-mcp-server --client claude
npm install
npm run build
{
"mcpServers": {
"postgresql-mcp": {
"command": "node",
"args": ["/Users/1Levick3/Desktop/postgresql-mcp-server/build/index.js"],
"disabled": false,
"alwaysAllow": [],
"env": {
"POSTGRES_CONNECTION_STRING": "postgresUrl",
"POSTGRES_SSL_CERT_PATH": "/Users/1levick3/Desktop/root.crt"
}
}
}
}
npm run dev
- 启动带有热重载功能的开发服务器。npm run lint
- 运行 ESLint 代码检查。npm test
- 运行测试。