---
title: "Writing Test Evals For Our MCP Server"
description: "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."
url: "https://swe.quest/articles/writing-test-evals-for-our-mcp-server-0fecde9ebf04784e"
canonical: "https://neon.com/blog/test-evals-for-mcp"
source: "Neon"
published: "2025-06-18"
difficulty: "medium"
kind: "Case study"
reading_minutes: 6
tags: ["evals","ai-agents","testing","postgres"]
---

# Writing Test Evals For Our MCP Server

A post on [Neon](https://swe.quest/sources/neon.md), published 2025-06-18, 6 min read, Case study. Original: [https://neon.com/blog/test-evals-for-mcp](https://neon.com/blog/test-evals-for-mcp)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)

## Prerequisites

- Model Context Protocol basics
- LLM tool calling ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- database migrations ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))

## Keywords

MCP, Neon, Braintrust, LLM-as-a-judge, Claude, pg\_dump

## Related posts

- [Introducing Supabase Evals](https://swe.quest/articles/introducing-supabase-evals-c82dd59072e477b7.md): Supabase · 2026-07-31 · Medium · 5 min read · Evaluation, AI agents, AI for coding, Testing
  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.
- [An API to Track Database Schema Changes](https://swe.quest/articles/an-api-to-track-database-schema-changes-48247d0f7925f89f.md): Neon · 2025-01-09 · Medium · 4 min read · PostgreSQL, Schema migrations, API design, CI/CD, AI agents
  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.
- [Looking at How Replit Agent Handles Databases](https://swe.quest/articles/looking-at-how-replit-agent-handles-databases-9885f9639f0232ad.md): Neon · 2024-11-08 · Medium · 7 min read · Schema migrations, AI for coding, PostgreSQL, Python
  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.
- [Introducing Neon Labs](https://swe.quest/articles/introducing-neon-labs-91c029a8271e5821.md): Neon · 2026-08-26 · Medium · 6 min read · PostgreSQL, Schema migrations, Replication, Developer tools
  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.
- [Just landed in the Neon CLI](https://swe.quest/articles/just-landed-in-the-neon-cli-10a12bf3c6b45d1f.md): Neon · 2026-08-25 · Medium · 6 min read · Developer tools, PostgreSQL, AI agents, Schema migrations
  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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
