MCPs configured for Atrapaclientes development - SSH, PostgreSQL Production DB, gh_grep
~/.ssh/atrapaclientesCommon tasks:
# Check API logs
docker logs -f --tail 200 atrapaclientes-api-1
# Health check
curl https://api.atrapaclientes.es/api/health
# Check migrations ran
SELECT * FROM migrations ORDER BY id DESC LIMIT 5;
# Restart API
docker restart atrapaclientes-api-1
# Update repository and redeploy
cd ~/atrapaclientes && git pull origin main && \
docker compose -f docker-compose.prod.yml down && \
docker compose -f docker-compose.prod.yml build --no-cache && \
docker compose -f docker-compose.prod.yml up -d
⚠️ IMPORTANT - Setup SSH Tunnel First!
Before using PostgreSQL MCP, create an SSH tunnel in PowerShell:
ssh -i $env:USERPROFILE\.ssh\atrapaclientes -L 5432:localhost:5432 [email protected]
This forwards port 5432 through SSH, then PostgreSQL MCP can connect locally.
Common queries:
-- Check multi-tenant isolation
SELECT DISTINCT tenant_id, COUNT(*) FROM participantes GROUP BY tenant_id;
-- View recent participations
SELECT id, email, created_at FROM participantes ORDER BY created_at DESC LIMIT 10;
-- Check premio stock
SELECT nombre, stock, entregados FROM premios WHERE stock > 0;
-- Verify migrations
SELECT id, migration, timestamp FROM migrations ORDER BY id DESC;
-- Check campaign status
SELECT id, nombre, estado, fecha_inicio, fecha_fin FROM campanas;
-- Audit log search
SELECT user_id, action, entity_type, created_at FROM audit_logs ORDER BY created_at DESC LIMIT 20;
Example prompts:
Find examples of multi-tenant architecture in NestJS using gh_grep
Show me how to implement JWT refresh tokens with Axios interceptors use gh_grep
Find React Query examples for form submission with optimistic updates
"docker": {
"enabled": false // Change to true to enable
}
When to enable:
ssh -i $env:USERPROFILE\.ssh\atrapaclientes -L 5432:localhost:5432 [email protected]
Keep this running while using PostgreSQL MCP!
Show me the last 10 participantes in the database
How many campaigns are currently active?
Query the audit log for recent changes
Check the migrations table
Use SSH to check if API is healthy
Show recent container logs from production
Can you restart the API container?
Host: 195.78.230.159
Port: 5432
User: postgres
Password: YG5uVh3mK9pQwX2jL8sRtZ6b
Database: atrapaclientes
SSH User: fansmar
SSH Host: 195.78.230.159
SSH Key: ~/.ssh/atrapaclientes
| MCP | Status | Type | Purpose |
|---|---|---|---|
| SSH | ✅ Enabled | Local | Production VPS access |
| PostgreSQL | ✅ Enabled | Local | Production DB queries (via SSH tunnel) |
| gh_grep | ✅ Enabled | Remote | GitHub code search |
| Docker | 🟡 Disabled | Local | Container management |
audit_logs tableDebugging participations issue:
Query the database: SELECT * FROM participaciones WHERE tenant_id = 'xxx' ORDER BY created_at DESC LIMIT 10
Check if a participant exists: SELECT * FROM participantes WHERE email = '[email protected]'
Verify deployment:
Check migrations: SELECT * FROM migrations ORDER BY id DESC LIMIT 5
Verify campaign is published: SELECT * FROM campanas WHERE id = 'campaign-id'
Production debugging:
SSH into server and check API health
View error logs: docker logs -f --tail 500 atrapaclientes-api-1
Check database connections: SELECT * FROM pg_stat_activity;
PostgreSQL MCP says "Connection refused"?
ssh -i ... -L 5432:localhost:5432 [email protected]SSH MCP not connecting?
Test-Path ~\.ssh\atrapaclientesls -la ~/.ssh/atrapaclientesssh -i ~/.ssh/atrapaclientes [email protected] "echo OK"Can't query specific table?
SELECT * FROM information_schema.tables WHERE table_schema='public';SELECT * FROM pg_roles WHERE rolname='postgres';Setup SSH tunnel:
ssh -i $env:USERPROFILE\.ssh\atrapaclientes -L 5432:localhost:5432 [email protected]
Test connection:
Query the production database: SELECT COUNT(*) FROM participantes;
Monitor production:
Check API logs: docker logs -f --tail 200 atrapaclientes-api-1
Search code patterns:
Use gh_grep to find NestJS multi-tenant examples