npx -y @modelcontextprotocol/server-postgres postgresql://localhost/db
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://localhost/db"
]
}
}
}传输方式:stdio
query执行只读 SQL 查询