Standard Model Context Protocol (MCP) server configuration with read-only DB connection pooling, safe query isolation, and scoped GitHub OAuth tokens.
Secure GitHub & PostgreSQL MCP Configuration
Overview
This configuration defines Model Context Protocol (MCP) servers allowing agents to safely inspect GitHub issues/PRs and query PostgreSQL database tables using read-only credentials.
Configuration (claude_desktop_config.json / mcp_config.json)
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_read_scoped_token_here"
}
},
"postgres-readonly": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://readonly_user:password@localhost:5432/my_database?sslmode=require"
]
}
}
}
Security Best Practices
1. Never use superuser credentials: Always create a dedicated readonly_user with GRANT SELECT only.
2. Connection Pooling: Use connection pooling (pgBouncer) to prevent agent query spikes from exhausting database slots.