dotsagent.io
Ngôn ngữ:Tiếng Việt
Dữ liệu · Crystal DBA

Thiết lập Postgres MCP Pro

Hỗ trợ truy vấn Postgres, kiểm tra schema, tinh chỉnh index và kiểm tra tình trạng hoạt động, thay thế server tham chiếu đã lưu trữ.

Nhà phát hành
Crystal DBA Cộng đồng
Chạy cục bộ
uvx postgres-mcp --access-mode=restricted
Giao thức truyền tải
stdio, sse
Xác thực
Connection string Postgres trong DATABASE_URI.
Môi trường
DATABASE_URI
Phạm vi truy cập
Chế độ hạn chế chỉ cho phép đọc; chế độ không hạn chế cho phép đọc và ghi.
Giấy phép
MIT
Mã nguồn
github.com/crystaldba/postgres-mcp
Trạng thái
Đang hoạt động

Cài đặt

Server này chạy trên máy của bạn dưới dạng tiến trình con của client. Bạn cần cài runtime mà lệnh của server sử dụng, chẳng hạn Node.js cho npx, uv cho uvx hoặc Docker, cùng mọi biến được liệt kê trong mục Environment.

Claude Code

shell
claude mcp add --scope project --env DATABASE_URI='<DATABASE_URI>' postgres-mcp-pro -- uvx postgres-mcp --access-mode=restricted

Cursor

.cursor/mcp.json
{
  "mcpServers": {
    "postgres-mcp-pro": {
      "command": "uvx",
      "args": [
        "postgres-mcp",
        "--access-mode=restricted"
      ],
      "env": {
        "DATABASE_URI": "${env:DATABASE_URI}"
      }
    }
  }
}

Codex

~/.codex/config.toml
[mcp_servers.postgres-mcp-pro]
command = "uvx"
args = ["postgres-mcp", "--access-mode=restricted"]
env_vars = ["DATABASE_URI"]

Cấu hình cho các client khác →

Giữ --access-mode=restricted cho mọi cơ sở dữ liệu quan trọng; chế độ không hạn chế cho phép agent ghi dữ liệu.

Các server khác trong dữ liệu

Nguồn

  1. github.com/crystaldba/postgres-mcp