
AI-Safe MCP Server for SQL
Giving an AI direct database access is one of those ideas that sounds useful immediately and dangerous a few seconds later. You want the model to inspect schema, understand relationships, run queries, and help with analysis. But you also do not want it to mutate data, run unrestricted SQL, or pull back massive result sets because a prompt was vague. That was the motivation behind ajan-sql . It is a small MCP server for SQL that gives AI clients schema-aware, read-only SQL access with a guard layer in front of query execution. What ajan-sql does ajan-sql runs as an MCP server over stdio and connects to SQL through DATABASE_URL . It currently exposes these tools: list_tables describe_table list_relationships run_readonly_query explain_query sample_rows It also exposes schema resources: schema://snapshot schema://table/{name} The goal is simple: give LLMs useful database visibility without handing them unsafe SQL execution. Why I built it A lot of AI + database demos jump from “the model
Continue reading on Dev.to
Opens in a new tab



