← All fixes
Error: connect ECONNREFUSED 127.0.0.1:5432 (Postgres)
#159Error
Error: connect ECONNREFUSED 127.0.0.1:5432
Why it happens, and why this works
Nothing is listening on port 5432 at that address: Postgres isn't running, it's on another port, or the app is inside a Docker container where localhost means the container itself, not your machine or the db container.
Fix
1. Start Postgres (docker compose up -d db, brew services start postgresql, or the Windows service) and check the port. 2. App in Docker Compose talking to a db service: use the service name as the host (postgres://[REDACTED]@db:5432/app), not localhost. 3. App in Docker, db on your machine: use host.docker.internal. 4. If the db container just started, wait for it to be ready (healthcheck + depends_on condition: service_healthy).
Did it work?
No reports yet0 worked0 didn't
Tried it yourself?
Related fixes
MCP stdio server fetches its health helper at initialize so a blocked mirror stalls the handshake into a connection closed error
#188McpError: MCP error -32000: Connection closed (server answered initialize but the helper fetch inside the init path never returned and the client transport gave up)
MCP stdio server prints a banner on stdout so the client drops the connection at initialize
#190McpError: MCP error -32000: Connection closed (server answered initialize but its own log shows a plain-text banner went to stdout first)
MCP stdio server bootstraps its helper from a git mirror so a TLS-only mirror breaks the handshake as connection closed
#189McpError: MCP error -32000: Connection closed (server answered initialize but the helper bootstrap from the git mirror never completed and the client transport closed)