
This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A Model Context Protocol server that lets AI assistants interact with a PostgreSQL database through a standardized interface.
PostgreSQL MCP Server is cataloged as an MCP server attributed to fanzhenddz. A Model Context Protocol server that lets AI assistants interact with a PostgreSQL database through a standardized interface. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for PostgreSQL MCP Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Queries support parameterized input, and the query tool is restricted to SELECT, SHOW, EXPLAIN and WITH statements, with data modifications handled by the execute tool.
Yes; when environment variables are added to the MCP client configuration, the server connects to the database automatically on startup and the connect_db step can be skipped.
README.md · e20f32fef793 · Fetched 2026-11-13 12:57:20 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
一个基于模型上下文协议(MCP)的 PostgreSQL 数据库操作服务器,让 AI 助手能够通过标准化接口与 PostgreSQL 数据库交互。
npm install postgresql-mcp-ddz
或直接使用 npx:
npx postgresql-mcp-ddz
在 MCP 客户端配置中添加环境变量,服务器启动时会自动连接数据库:
{
"mcpServers": {
"postgresql-mcp-ddz": {
"command": "npx",
"args": ["postgresql-mcp-ddz"],
"env": {
"POSTGRES_HOST": "127.0.0.1",
"POSTGRES_PORT": "5432",
"POSTGRES_USER": "postgres",
"POSTGRES_PASSWORD": "your_password",
"POSTGRES_DB": "your_database"
}
}
}
}
支持的环境变量:
| 变量名 | 说明 | 必填 |
|---|---|---|
POSTGRES_HOST | 数据库主机地址 | 是 |
POSTGRES_PORT | 数据库端口(默认 5432) | 否 |
POSTGRES_USER | 数据库用户名 | 是 |
POSTGRES_PASSWORD | 数据库密码 | 是 |
POSTGRES_DB | 数据库名称 | 是 |
不在配置中添加环境变量时,需要通过 connect_db 工具手动连接:
{
"mcpServers": {
"postgresql": {
"command": "npx",
"args": ["postgresql-mcp-ddz"]
}
}
}
connect_db连接到 PostgreSQL 数据库(环境变量配置后可省略此步骤)。
参数:
host(字符串,必填):数据库主机地址port(数字,可选):数据库端口,默认 5432user(字符串,必填):数据库用户名password(字符串,必填):数据库密码database(字符串,必填):数据库名称示例:
{
"host": "localhost",
"port": 5432,
"user": "postgres",
"password": "password",
"database": "mydb"
}
query执行 SELECT 查询并返回结果。
参数:
sql(字符串,必填):SQL SELECT 查询语句params(数组,可选):查询参数示例:
{
"sql": "SELECT * FROM users WHERE age > $1",
"params": [18]
}
execute执行 INSERT、UPDATE 或 DELETE 查询。
参数:
sql(字符串,必填):SQL 语句params(数组,可选):查询参数示例:
{
"sql": "INSERT INTO users (name, email) VALUES ($1, $2)",
"params": ["张三", "zhangsan@example.com"]
}
list_tables列出当前数据库中的所有表。
describe_table获取指定表的结构信息,包括列、主键和外键。
参数:
table(字符串,必填):表名示例:
{
"table": "users"
}
explain使用 EXPLAIN 分析 SQL 查询性能。
参数:
sql(字符串,必填):要分析的 SQL 查询示例:
{
"sql": "SELECT * FROM users WHERE email = 'test@example.com'"
}
show_statement执行 SHOW 语句。
参数:
sql(字符串,必填):SHOW SQL 语句示例:
{
"sql": "SHOW ALL"
}
query 工具仅允许 SELECT、SHOW、EXPLAIN 和 WITH 查询execute 工具Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for PostgreSQL MCP Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/postgresql-mcp-ddz)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A Model Context Protocol server that lets AI assistants run SQL queries against AWS Athena databases and retrieve results.

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.