这是一个轻量级的模型上下文协议(MCP)服务器,用于在PostgreSQL数据库上执行SQL查询,并且具备可配置的权限。
git clone https://github.com/perrypixel/Simple-Postgres-MCP
cd Simple-Postgres-MCP
npm install
npm run build
将以下内容添加到您的MCP客户端配置文件(mcp.json
)中:
{
"mcpServers": {
"simple-postgresql-mcp": {
"command": "node",
"args": [
"/path/to/build/index.js",
"postgresql://username:password@localhost:5432/database_name",
"write"
]
}
}
}
{
"mcpServers": {
"simple-postgresql-mcp": {
"command": "node",
"args": [
"/path/to/build/index.js",
"postgresql://username:password@localhost:5432/database_name",
"readonly"
]
}
}
}
⚠️ 重要提示
请更新配置中的路径,使其指向您
build
文件夹内的index.js
文件。
mcp.json
文件中(例如Cursor、Windsurf、Copilot等)。如果您觉得这个工具很有用,可以通过以下方式支持开发: