An MCP server for PostgreSQL with SSH tunnel support, enabling AI assistants like Claude to query and introspect databases through direct, SSH config, or explicit SSH connections. Version 0.1.4 is the latest stable release. It provides read-only query execution, EXPLAIN plans, schema/table listing, and connection status monitoring. Unlike other PostgreSQL MCP servers, it natively handles SSH tunneling for bastion hosts, supporting both SSH config aliases and explicit credentials. Works cross-platform on macOS, Linux, and Windows.
npm install postgres-ssh-mcpNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Example configuration for connecting to a PostgreSQL database through the MCP server.
Always set both SSH_HOSTNAME and SSH_USER if using explicit SSH; or use SSH_HOST for SSH config alias.
Set DB_READ_ONLY=true for safety (default) or use parameterized queries to prevent injection.
Use SSH config alias (SSH_HOST) with IdentityFile set in ~/.ssh/config instead.
Use 'npx -y postgres-ssh-mcp' or install globally with 'npm install -g postgres-ssh-mcp'.
Check that DB_HOST, DB_NAME, DB_USER, and DB_PASSWORD are all defined in the MCP server env.
Verify the SSH config alias exists in ~/.ssh/config or use explicit SSH_HOSTNAME/SSH_USER.
Check that PostgreSQL is running and accessible; for SSH tunnels, verify SSH credentials and network.
No dependency data recorded yet.