Skip to content
Hacker News · AI·· 1 h agoAI score40

Let an AI agent query your production database safely with read-only SQL over MCP

Let an AI agent query your prodution database safely with read-only SQL over MCP

AI summary

This tutorial shows how to let an AI agent answer plain-language questions about a production database on Railyard using the list_tables and query_database MCP tools. Every query passes five guard rails: write-scoped connections, admin/owner-only role caps, read-only transactions that always roll back, a statement timeout, and a 200-row cap flagged as truncated. The SQL text is never written into the MCP audit entry.

Source:Hacker News · AI · railyard.run