MCP postgresql

Dodaje serwer mcp postgresql

Generacja hasła PowerShell

> [guid]::NewGuid().ToString()

872779d0-a0a1-4c91-b8b8-d580d78af8d7  - przykładowe hasło

Utwórz użytkownika tylko do odczytu dla Claude’a – psql

CREATE USER claude WITH PASSWORD '--hasło--';

GRANT CONNECT ON DATABASE rag_db TO claude;

GRANT SELECT ON ALL TABLES IN SCHEMA public TO claude;

Dodaj serwer PostgreSQL (zakres user = dostępny we wszystkich projektach)

# claude mcp add --scope user postgres -- \
npx -y @modelcontextprotocol/server-postgres \
postgresql://claude:_silne_hasło_@localhost:5432/rag_db

Sprawdzenie

# claude mcp list

postgres: npx -y @modelcontextprotocol/server-postgres postgresql://claude:xxxxxxx@localhost:5432/rag_db - ✓ Connected

mariadb: npx -y @benborla29/mcp-server-mysql - ✓ Connected

Zapis na poziomie usera – wszystkie projekty

# cat /home/jonatan/.claude.json