Требуется строка подключения PostgreSQL.
# Claude Desktop — claude_desktop_config.json:
{
"mcpServers": {
"postgres": {
"command": "uvx",
"args": ["postgres-mcp", "--access-mode=unrestricted"],
"env": { "DATABASE_URI": "postgresql://user:pass@localhost:5432/mydb" }
}
}
}
# Claude Code (CLI):
claude mcp add postgres -e DATABASE_URI=postgresql://user:pass@localhost/mydb -- uvx postgres-mcp --access-mode=unrestricted
# OpenCode — ~/.config/opencode/opencode.json:
{
"mcp": {
"postgres": {
"type": "local",
"command": ["uvx", "postgres-mcp", "--access-mode=unrestricted"],
"environment": { "DATABASE_URI": "postgresql://user:pass@localhost/mydb" }
}
}
}