← Back to writing

I gave my AI assistant an API into my own product

AIAgentic AIChessEngineering

It became my best QA engineer.

CoachMyChess is the chess coaching app I built for my kids. Last week I mounted an MCP server on its backend, authenticated it with Clerk, and pointed my personal AI assistant at it. Within days it had caught my puzzle pipeline mislabeling mates, test-driven my student and coach flows as a fake 9-year-old, and written the fix prompts for my coding agent.

Here is the whole thing, technically.

The setup: MCP + Clerk, no new auth system

The key decision: don't build a second identity system.

CoachMyChess already uses Clerk. So the MCP server trusts the same Clerk-issued tokens. The assistant authenticates as a parent identity from my Clerk instance, and the server validates it like any other client. One identity system, two surfaces.

On the assistant side it's a custom connector pointed at https://www.coachmychess.com/mcp. The credential is stored once; every call carries it. No API keys in chat, no secrets in prompts.

The tools are deliberately narrow and child-scoped. Every read or write takes a childId:

• list_children, get_child_progress • get_todays_workout, get_workout_status, get_workout_history • get_game_analysis, submit_game

Child-scoping is the security model. A call can only ever touch one kid's data. There is no "list everything" tool, and there never will be.

Total time from "I should do this" to the assistant pulling live data: under an hour. Most of that was me. The assistant side was a connector config and a skill file.

Bug hunt #1: the mate-in-3 that wasn't

It started with my son Advik. He told me a puzzle labeled "mate in 3" wasn't actually mate in 3, and the prescribed moves weren't the engine's top moves.

I asked the assistant to verify. It couldn't. Not properly.

The MCP tools exposed puzzle IDs, themes, sources, and ratings, but not FENs or solution lines. The one thing needed to check the claim was the one thing missing.

Lesson one, and it's a big one: your agent is only as useful as the data you expose. Labels aren't verifiable. Positions are. If you want an AI to check your work, give it the primitives — FENs, solution lines, timestamps — not the conclusions.

Bug hunt #2: the fake 9-year-old

So I created a student login called Milo, handed the credentials to my assistant, and told it to test-drive the student flow like a kid. Read-only. Don't solve anything.

It found the smoking gun in the first workout. Step 1 was tagged "Checkmate," a warm-up, rated 808 for a 580-rated profile. The assistant pulled the FEN and ran Stockfish 19 to depth 33: +4.0 pawns, best move 14.hxg4. Winning material. No forced mate anywhere.

Meanwhile my backend had the position tagged mate / matein1.

Two independent confirmations of the same systemic bug: puzzle themes are never engine-verified. Advik's report wasn't a one-off. It was the pipeline.

The test drive also surfaced UX friction no API test would catch. A correct PIN that silently does nothing until a parent approves the device — the only signal is a transient toast, so a 9-year-old is just stuck. A strictly linear workout with no exercise list and no way to preview what's next. An 808-rated "confidence boost" warm-up for a 580-rated kid.

The coach view: bugs and a missing feature

Then I had it log in as a coach. Same story.

The dashboard showed three students, 561 games, 420 puzzle attempts. And a list of data bugs: a student page celebrating "Improvement Streak! 0 consecutive wins" on a failed attempt. An openings table showing 0% win rates across the board while the profile header said 49%. Streak counts that changed between two loads of the same page. A typo ("Asmiloplays"). A leaked dev string in the Tips tab: "Run the seed script to populate tips." And a phantom "Failed" attempt recorded for Milo, who never submitted a move. Viewing a puzzle apparently counts as failing it.

But the most interesting finding was a missing feature, not a bug. There is no parent debrief. The Insights tab is student-facing encouragement ("Great progress on pawnendgame!"). Nothing in the product answers the question I built it for: is my kid actually improving, and what should we work on? The agent noticed the gap because it was looking at the product the way a parent would.

The loop speed is the point

Here is what struck me. In a single session, the assistant went: user report, attempted verification, identified the data gap, test-drove both user roles, engine-verified the position, diagnosed the systemic cause, and wrote a prioritized, paste-ready fix prompt for my coding agent, with regression tests specified.

No context switching. No ticket queue. No "let me reproduce that and get back to you."

I corrected it once, early on, when it said it couldn't test-drive the app. It was thinking API; the answer was a browser login. After that it never made that mistake again. Check the actual mechanism before declaring a limit. Good advice for agents and engineers alike.

What this unlocks next

The exercise didn't just find bugs. It designed features.

Scheduled nudging. The workout-status tool unblocked this: a daily check that notifies me only when a nudge is actually warranted — daily cooldown, gentle escalation. My kids don't have the assistant; I relay. The agent watches, I parent.

The parent debrief. Now spec'd: a weekly report per child — what they did, what improved, what needs work, one concrete suggestion. Printable. The product's founding question, finally answered.

An engine-verification gate. Every puzzle gets Stockfish-checked before it's ever served. mateinN means forced mate in exactly N, verified, or the puzzle doesn't ship. Plus a backfill audit of the existing puzzle store.

Always-on QA. The real unlock. I can point the assistant at any flow, as any user role, any time — and it reports back like a QA engineer who never sleeps and writes its own bug tickets.

If you're building this

Four things I'd tell another founder:

1. Reuse the auth you have. I used Clerk for the MCP server because I already used Clerk for the app. A second identity system is where these projects go to die.

2. Scope tools narrowly. Child-scoped tools meant I never worried about what the assistant could touch. Design the blast radius first.

3. Expose verifiable primitives. FENs, not "mate in 3." Timestamps, not "recent." An agent that can't verify will just repeat your labels back to you. Confidently.

4. Let it be a user, not just an API client. The browser test-drive found everything the API never would: the stuck PIN screen, the linear workout, the missing parent view. Give your agent a login.

The whole arc — from "I wonder if this could work" to a diagnosed systemic bug with a fix prompt sitting in my coding agent — took days, most of them mine, thinking. The assistant's part took minutes.

That's the part I keep coming back to. Not that the AI is smart. That the loop is fast.

Comments