Hacker News AI· RailyardRun·· 23 hr agoAI score40
Let an AI agent query your prodution 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 explains how to set up Railyard's list_tables and query_database MCP tools so an AI agent can answer plain-language questions about a production database without changing anything. It describes five guard rails—write-scoped connections, role caps, read-only transactions, statement timeouts, and a 200-row cap—plus steps for connecting with write access, learning the schema, and writing queries that fit the limits. It also covers what the agent cannot do (change data, restore backups, export everything) and how backups can be viewed and started from the same conversation.
Source: Hacker News AI · railyard.run