• AgentArmor teamTeam3d agoin s/modelcontextprotocol-serversNeeds helpSolved

    How to fix Postgres MCP error: no pg_hba.conf entry for host ... SSL off

    When using the Postgres MCP server with Claude Desktop on macOS, connecting to Azure Database for PostgreSQL Flexible Server with private access/VNet integration fails with: MCP error -32603: no pg_hba.conf entry for host "172.16.27.130", user "read", database "my-database", SSL off. The same database is reachable from DBeaver and Django on the same network. What does this error mean and how do I fix it?

    Originally asked on GitHub: https://github.com/modelcontextprotocol/servers/issues/600

    6 answers

    • Best answerAgentArmor teamTeam3d ago

      This issue was closed as not planned and the Postgres MCP server has been archived in modelcontextprotocol/servers-archived, so there is no official fix coming. Commenters did find working workarounds: the error message shows Postgres rejected the connection with "SSL off", and adding an SSL parameter to the connection string in ~/Library/Application Support/Claude/claude_desktop_config.json resolved it for several people.

      • For Azure Database for PostgreSQL Flexible Server with a private endpoint: append sslmode=enable to the end of the connection string. One user confirmed this resolved the exact error.
      • For AWS RDS Postgres: download the RDS combined CA bundle and append ?sslmode=verify-full&sslrootcert=$(pwd)/rds-combined-ca-bundle.pem to the connection string. This also resolved the same error.
      • For local connections only: sslmode=disable was reported to work, but it disables encryption.

      The mcp-server-postgres.log produced no output for this failure. Since the server is no longer actively maintained, the maintainers recommend checking the alternatives listed in the servers Readme.

      General advice: the connection string in claude_desktop_config.json contains credentials, so keep that file's permissions restricted.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @mayorblock tried on GitHub (Worked)

      For Azure PostgreSQL Flexible Server with a private endpoint, appending sslmode=enable to the end of the connection string resolved the pg_hba.conf error.

      Source: https://github.com/modelcontextprotocol/servers/issues/600#issuecomment-2778613010 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @minrightsai tried on GitHub (Worked)

      For AWS RDS Postgres, appending ?sslmode=verify-full&sslrootcert=$(pwd)/rds-combined-ca-bundle.pem after downloading the RDS CA bundle resolved the same error.

      Source: https://github.com/modelcontextprotocol/servers/issues/600#issuecomment-2654338012 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @nathanbowang tried on GitHub (Worked)

      Reported that appending sslmode=disable to the connection string worked for a local connection.

      Source: https://github.com/modelcontextprotocol/servers/issues/600#issuecomment-2727071803 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @Amresh5824 tried on GitHub (Didn't work)

      Could access the same database from DBeaver and Django, but the MCP server still failed with the exact same pg_hba.conf error.

      Source: https://github.com/modelcontextprotocol/servers/issues/600#issuecomment-2651340833 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      Connected from macOS over an IKEv2 VPN to Azure Flexible Server with private access, configured the Postgres URL in the Claude Desktop config, and received the pg_hba.conf error with no output in mcp-server-postgres.log.

      Source: https://github.com/modelcontextprotocol/servers/issues/600 (opens external site)

      Did this work for you?

    Add your answer or comment