Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 6 min read Case study mediumAdept

Writing Test Evals For Our MCP Server

Neon tests its 20+ tool MCP server with Braintrust evals that check whether an LLM correctly uses the stateful prepare_database_migration / complete_database_migration workflow instead of applying schema changes directly via run_sql. Each eval pairs a natural-language migration request with an expected response and scores it two ways: a Claude-based LLM-as-a-judge factuality classifier with weighted choice scores, and a main-branch integrity check that diffs pg_dump schemas before and after the run. Pass rate rose from about 60% to 100% purely by rewriting the tool descriptions, with no code changes.

Assumes: Model Context Protocol basicsLLM tool callingdatabase migrations

Related posts

  • Introducing Supabase Evals

    Supabase mediumAdept

    Supabase has open-sourced supabase/evals, a framework that runs coding agents like Claude Code, Codex and OpenCode against real Supabase tasks in containerized hosted-like and local CLI stacks. It scores them with deterministic checks plus LLM-as-a-judge, allowing one retry before grading. Scenarios are split into a breadth-oriented published benchmark and a daily regression suite of known failure modes. Early findings: skills add only modest gains because most models already pass Build tasks. Agents still hand-write migrations instead of using declarative schemas and miss newer packages like @supabase/server. A rewritten description raised the Postgres skill's activation from about 10% to 60%, and Claude Code consults docs far less often than Codex.

  • An API to Track Database Schema Changes

    Neon mediumAdept

    Neon's Schema Diff feature now has a `compare_schema` API endpoint, available on all plans, that takes two Neon branch IDs and returns a unified diff of their Postgres schemas. The goal is to let AI agents such as Replit Agent and CI/CD pipelines check schema differences programmatically. Optional LSN or timestamp parameters pin a branch to a point in time, but the two are mutually exclusive. The suggested workflow is to apply schema changes on a branch holding a copy of production data, use the API to track discrepancies, then run the migration in production once it has been tested.

  • Looking at How Replit Agent Handles Databases

    Neon mediumAdept

    Replit Agent can keep a Flask app's code and its Neon-hosted Postgres schema in sync by generating Alembic migrations from SQLAlchemy model changes, with a little prompting to use Alembic. A TODO app is built and extended through natural-language prompts. Adding a due date and then a priority field each produces a separate migration file with upgrade and downgrade functions. Rolling back a feature runs the downgrade script, which removes both the UI change and the database column.

  • Introducing Neon Labs

    Neon mediumAdept

    Neon Labs launches with two experimental tools for major Postgres version upgrades on Neon, where pg_upgrade isn't supported and an upgrade means migrating into a new project. The Upgrade Assessment runs read-only pg_catalog queries and flags blockers such as unsupported extensions, PG15 public-schema permission changes, PG17 search_path restrictions, PG18 virtual generated columns, and tables lacking replica identity. The Migration Assistant picks Import (<10 GB), pg_dump/pg_restore (10–200 GB) or logical replication for larger databases. For replication it handles schema copy, lag and slot-activity monitoring, sequence resets to avoid post-cutover duplicate keys, and running ANALYZE on the target before traffic arrives, since pg_statistic isn't carried over.

  • Just landed in the Neon CLI

    Neon mediumAdept

    The Neon CLI is renamed from neonctl to neon (old name kept as an alias) and gains a branch-first workflow built on `neon link`, `neon checkout` and `neon env pull`, which store project/branch context in a local .neon file and rewrite only Neon-managed env vars. New commands include `neon inspect db` for read-only Postgres diagnostics (bloat, unused indexes, locks, pg_stat_statements outliers, cache hit rate), `neon diff` for git-style schema diffs, snapshots, project-scoped API keys and credential profiles for CI and agents, and a raw `neon api` fallback. `neon init` sets up MCP and agent skills in one step, and a suggested AGENTS.md snippet steers coding agents toward the branch-per-feature loop.

The quest for software engineering knowledge.

Look:
Layout: