Skip to main content
Glama
Zlash65

PostgreSQL SSH MCP Server

by Zlash65

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PORTNoHTTP server port3000
MAX_ROWSNoMaximum rows returned per query1000
MCP_HOSTNoHTTP server bind address0.0.0.0
SSH_HOSTNoSSH server hostname
SSH_PORTNoSSH server port22
SSH_USERNoSSH username
READ_ONLYNoBlock data modifications. Set false to allow writes.true
SSH_ENABLEDNoSet true to enable SSH tunnelingfalse
AUTH0_DOMAINNoAuth0 tenant domain (e.g., tenant.us.auth0.com)
DATABASE_SSLNotrue or false. Auto-enabled for non-localhost.auto
DATABASE_URINoFull connection string (e.g., postgresql://user:pass@host:5432/db)
SSH_PASSWORDNoSSH password (alternative to key)
DATABASE_HOSTNoDatabase hostname
DATABASE_NAMENoDatabase name
DATABASE_PORTNoDatabase port5432
DATABASE_USERNoDatabase username
MCP_AUTH_MODENoAuthentication mode: none or oauthnone
MCP_STATELESSNoStateless mode (each request re-initializes)true
QUERY_TIMEOUTNoQuery timeout in milliseconds30000
AUTH0_AUDIENCENoAuth0 API identifier / audience
DATABASE_SSL_CANoPath to CA certificate bundle
DATABASE_PASSWORDNoDatabase password
MCP_ALLOWED_HOSTSNoComma-separated allowed Host headers
MCP_ALLOWED_ORIGINSNoComma-separated allowed CORS origins (* for any)
SSH_STRICT_HOST_KEYNoVerify host key against known_hoststrue
MCP_SERVER_POOL_SIZENoServer instances for stateless mode4
SSH_KNOWN_HOSTS_PATHNoCustom known_hosts file~/.ssh/known_hosts
SSH_PRIVATE_KEY_PATHNoPath to private key file
POOL_DRAIN_TIMEOUT_MSNoTimeout for draining pool during reconnect5000
MAX_CONCURRENT_QUERIESNoMaximum concurrent queries10
SSH_KEEPALIVE_INTERVALNoKeepalive interval in milliseconds10000
SSH_TRUST_ON_FIRST_USENoAuto-add unknown hosts (when strict is enabled)true
MCP_SESSION_TTL_MINUTESNoSession TTL for stateful mode30
MCP_RESOURCE_DOCUMENTATIONNoURL to API documentation (RFC 9728)
SSH_MAX_RECONNECT_ATTEMPTSNoMax reconnect attempts (-1 for unlimited)5
SSH_PRIVATE_KEY_PASSPHRASENoPassphrase for encrypted keys
MCP_SESSION_CLEANUP_INTERVAL_MSNoSession cleanup interval300000
DATABASE_SSL_REJECT_UNAUTHORIZEDNoSet false to allow self-signed certificatestrue

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
execute_queryB

Execute SQL with optional parameters. Results are capped by MAX_ROWS and include a truncated flag.

explain_queryB

Return an EXPLAIN plan for a query. ANALYZE executes the query.

list_schemasA

List schemas (excludes system schemas by default).

list_tablesA

List tables in a schema with estimated row counts and sizes.

describe_tableA

Describe a table (columns, constraints, indexes).

list_databasesA

List databases with owner, encoding, and size.

get_connection_statusA

Get connection status, pool stats, and tunnel state.

list_active_connectionsB

List active connections from pg_stat_activity.

list_long_running_queriesC

List queries running longer than a threshold.

get_database_versionA

Get PostgreSQL server version.

get_database_sizeB

Get database size and largest tables.

get_table_statsA

Get table statistics (rows, vacuum/analyze, scan counts).

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Zlash65/postgresql-ssh-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server