Case study · 2025

Guardian MCP

An AI coding agent's memory and safety net. Learned about moats the hard way.

Guardian MCP was my closed-source MCP server that gave AI coding agents persistent memory and safety rails: AST-parsed code search over tree-sitter, decision tracking and gated engineering workflows. Frontier models improved past the need, and I sunset it. The postmortem taught me more than the launch.

Role
Creator
Stack
Rust · TypeScript · tree-sitter · MCP
Status
Sunset
Guardian MCP landing page from 2025, before the product was sunset
The 2025 landing page. Guardian MCP has since been sunset.

In one line I built a moat out of model weaknesses. The models got better, and the moat evaporated in one release cycle.

Constraints

  • AI agents hallucinate config values and break patterns they cannot see
  • Code search had to be structural, not string matching
  • Solo project: built for my own use first, productised second

The build

In 2025, AI coding agents had a memory problem: they would hallucinate a port number, forget an architectural decision made two sessions ago, and break patterns the codebase had established. Guardian MCP was my fix: an MCP server that indexed the repository with tree-sitter across 17 languages, answered structural queries about functions and call sites, recorded decisions, and rejected plans that cited packages or functions that did not exist.

It worked, and I used it daily. I built a SaaS version on a Rust/Axum and Postgres back end and shipped it for macOS, Linux and Windows. Then the frontier models absorbed the use case: longer context, better recall, native code understanding. The features I had built as a product became model capabilities, so I sunset it rather than sell a patch for a problem that was disappearing.

The lesson was worth the build: a moat made of model weaknesses is a lease, not an asset. Whatever I build in AI tooling now has to survive the models getting better, because they will.

Decisions, including the rejected ones

Code understanding

Chose: AST parsing with tree-sitter

Rejected: Regex and embedding search

Agents ask structural questions: who calls this, what shape is this config. Text similarity answers a different question than the one being asked.

Safety model

Chose: Gated workflows: analyse, plan, approve, then edit

Rejected: Advisory warnings the agent could ignore

A guardrail an agent can skip is a suggestion. Gates made the failure mode inspection instead of cleanup.

End of life

Chose: Sunset it

Rejected: Pivoting to chase the models

The honest read was that the problem was evaporating. Stopping cost less than pretending otherwise.

What it took

  • tree-sitter AST search
  • Decision memory
  • Gated plan workflow
  • Rust/Axum back end
  • MCP protocol server