Install the Neon serverless driver: `npm install @neondatabase/serverless`.
Import and configure the driver to use the HTTP transport (no TCP, works in edge runtimes): `import { neon } from '@neondatabase/serverless'; const sql = neon(process.env.DATABASE_URL);`
Execute queries using the tagged template literal: `const rows = await sql`SELECT * FROM users WHERE id = ${userId}`;` — parameters are passed safely.
For transactions, use `neonTransaction`: wrap multiple statements in `sql.transaction([...])` or use the `neon()` pool with WebSockets enabled for multi-statement transactions.
Deploy to your edge runtime (Vercel Edge, Cloudflare Workers, etc.) and set `DATABASE_URL` as an environment secret in the platform's dashboard.
Known gotchas
The HTTP transport supports single-query round-trips efficiently but does not maintain a persistent connection — for transaction-heavy workloads, enable WebSocket mode (`webSocketConstructor` option) instead.
Named prepared statements and `LISTEN`/`NOTIFY` are not supported over the HTTP transport.
Always use parameterized queries (template literals) rather than string concatenation to prevent SQL injection.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp