Dev.to
7/17/2026

NpgsqlRest: Exposing PostgreSQL as REST APIs and MCP tools via SQL annotations
Original: I Spent Two Years Deleting My Backend. This Is What's Left
Short summary
NpgsqlRest is a MIT-licensed tool that eliminates traditional backend layers by exposing PostgreSQL SQL files as REST endpoints via comment annotations. It supports auth, caching, rate limiting, uploads, SSE, and MCP tool exposure for AI agents, all declared inline next to the SQL. The tool auto-generates typed TypeScript and Dart clients from database metadata and supports in-process testing on rolled-back transactions.
- •SQL files with comment annotations become REST endpoints — no controllers, services, or ORMs needed
- •Supports @authorize, @cached, @mcp (AI agent tools), rate limiting, and auto-generated typed clients
- •MIT-licensed, single native executable, testable via in-process SQL test files with transaction rollback
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



