Skip to main content
Glama

PostgreSQL Read-Only MCP Server

by currentspace
check_tunnel.sh1.39 kB
#!/bin/bash # Check the status of the shared SSH tunnel echo "=== SSH Tunnel Status ===" echo # Check if tunnel lock exists if [ -f /tmp/pg_mcp_tunnel/tunnel.lock ]; then echo "Tunnel Lock File:" cat /tmp/pg_mcp_tunnel/tunnel.lock | python3 -m json.tool echo # Get PID from lock file PID=$(cat /tmp/pg_mcp_tunnel/tunnel.lock | grep -o '"pid":[0-9]*' | cut -d: -f2) # Check if process is running if ps -p $PID > /dev/null 2>&1; then echo "✓ Tunnel process (PID: $PID) is running" else echo "✗ Tunnel process (PID: $PID) is NOT running" fi echo # Check if port is listening if lsof -i :5433 > /dev/null 2>&1; then echo "✓ Port 5433 is listening" echo "Processes using port 5433:" lsof -i :5433 | grep LISTEN else echo "✗ Port 5433 is NOT listening" fi echo # Check references if [ -f /tmp/pg_mcp_tunnel/refs.json ]; then echo "Active References:" cat /tmp/pg_mcp_tunnel/refs.json | python3 -m json.tool # Count active references REF_COUNT=$(cat /tmp/pg_mcp_tunnel/refs.json | grep -o '"pid"' | wc -l | tr -d ' ') echo echo "Total active instances: $REF_COUNT" else echo "No reference file found" fi else echo "No tunnel lock file found - tunnel is not running" fi echo

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/currentspace/pg_mcp_prod'

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