{"slug": "we-stopped-giving-ai-agents-database-passwords", "title": "We stopped giving AI agents database passwords", "summary": "A developer built db-mcp-gateway, a self-hosted MCP server that sits between AI agents and databases, ensuring agents never hold credentials. The server authenticates via SSO, maps identity to YAML-defined grants, and enforces least privilege with row caps and statement timeouts.", "body_md": "Every \"connect your AI agent to a database\" tutorial ends the same\n\nway: paste a connection string into a config file. That string now lives on a laptop, in shell history, maybe in a Slack DM to unblock someone on a Friday.\n\nWe didn't want that for our own team, so we built db-mcp-gateway a\n\nself-hosted MCP server that sits between agents and databases. The\n\nagent never holds a credential. It authenticates via SSO, the gateway\n\nmaps that identity to a YAML-defined grant, and the query runs under\n\nleast privilege with a row cap and a statement timeout.\n\nWhat I want to cover in this post:\n\nFull writeup + a real `docker pull`\n\nyou can run in five minutes:\n\n[https://github.com/developerz-ai/db-mcp-gateway](https://github.com/developerz-ai/db-mcp-gateway)\n\nTags: #mcp #ai #security #postgresql", "url": "https://wpnews.pro/news/we-stopped-giving-ai-agents-database-passwords", "canonical_source": "https://dev.to/developerzai/we-stopped-giving-ai-agents-database-passwords-5eof", "published_at": "2026-07-14 17:18:58+00:00", "updated_at": "2026-07-14 17:58:51.143523+00:00", "lang": "en", "topics": ["ai-agents", "ai-infrastructure", "ai-safety", "developer-tools"], "entities": ["db-mcp-gateway", "MCP", "SSO", "PostgreSQL"], "alternates": {"html": "https://wpnews.pro/news/we-stopped-giving-ai-agents-database-passwords", "markdown": "https://wpnews.pro/news/we-stopped-giving-ai-agents-database-passwords.md", "text": "https://wpnews.pro/news/we-stopped-giving-ai-agents-database-passwords.txt", "jsonld": "https://wpnews.pro/news/we-stopped-giving-ai-agents-database-passwords.jsonld"}}