使用MCP客户端连接PostgreSQL 数据库,直接复制以下内容
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://postgres:postgres@localhost:5432/postgres"
]
}
}
}
然后把账号密码ip端口修改改成自己的内容,其他的不用改: