Why Your AI Keeps Getting It Wrong: A Parable About MCP and the Source of Truth

A story about documentation, hallucinations, and how the Model Context Protocol (MCP) finally made AI assistants reliable.

Why Your AI Keeps Getting It Wrong: A Parable About MCP and the Source of Truth
··5 min read·Photo by New Material on Unsplash

Meet Jane. She's a meticulous payments architect at a growing fintech company. She built "NexusPay" — a custom payment gateway — and did something many architects skip: she wrote excellent documentation.

Clear authentication flows. Required fields. Structured error codes with explanations. Working example requests. It was the single source of truth for how payments should work.

Jane was proud of her docs. There was just one problem.

Nobody was reading them.

The Irony of Great Documentation

Jane's developers weren't lazy — they were busy. Like most developers in 2026, they'd adopted AI coding assistants to move faster.

When a frontend engineer needed to add a refund feature, they'd type something like:

"Write a React hook to process a refund with NexusPay."

The AI would generate code. The developer would paste it in. And then… it would fail.

Not with a dramatic crash. But with subtle, frustrating bugs:

  • It called a deprecated endpoint (/v1/refund instead of the current /v2/payments/refunds).
  • It parsed error messages as strings instead of using Jane's structured error codes.
  • It included a removed rememberMe flag that violated new security rules.

The generated code looked correct. It felt correct. But it was wrong in ways that cost hours of debugging.

Jane would sigh and say, “The documentation is right there! Why doesn’t anyone just read it?”

The uncomfortable truth: the developers weren’t writing the code. The AI was. And the AI had no way to read Jane’s documentation.

The Root Problem: AIs Don’t Know — They Guess

AI coding assistants don’t “know” anything in the human sense. They pattern-match against their training data — millions of public repos, Stack Overflow threads, tutorials, and outdated examples.

Payment integration code on the internet? Often outdated, full of workarounds, and cargo-culted practices from years ago.

The AI wasn’t being lazy or malicious. It simply had no access to Jane’s internal source of truth.

Enter Sakhile

Frustrated, Jane mentioned the issue to her colleague Sakhile, a senior full-stack developer who’d been exploring new AI tooling.

Sakhile smiled and said: “You need MCP.”

Jane raised an eyebrow. “Another protocol? I need people to read the docs, not learn new acronyms.”

Sakhile laughed. “Model Context Protocol — MCP — is exactly what makes the AI read your docs.”

What Is MCP? (The Simple Version)

Model Context Protocol (MCP) is an open standard that acts like a universal bridge between AI assistants and your data sources.

Think of it as USB-C for AI.

Normally, when you ask an AI a question, it’s like talking to someone who has read thousands of books but has never seen your company’s internal wiki. They know a lot in general, but nothing specific to your world.

MCP lets you hand the AI a secure, standardized connection to your documentation, OpenAPI specs, code types, and internal systems. Now when the AI answers, it can check the real source of truth first.

How Sakhile Made It Work

Sakhile built a lightweight MCP server. It wasn’t complex. It simply exposed three key sources in a standardized way:

  • Jane’s OpenAPI specification
  • The internal documentation wiki
  • The company’s TypeScript type definitions

Any MCP-compatible AI could now discover and query these sources before generating code.

Before and After MCP

Before MCP:

Developer prompt: “Write code to refund a transaction on NexusPay.”
AI thinks: “Based on thousands of similar examples I’ve seen, here’s a generic refund implementation.”
Result: Code that mostly works… but breaks on edge cases specific to NexusPay. Debugging ensues.

After MCP:

Developer prompt: “Write code to refund a transaction on NexusPay.”
AI thinks: “The user has access to the NexusPay MCP server. Let me query it.”
MCP server returns: Current endpoint (/v2/payments/refunds), required fields, valid reason codes, and correct auth scopes.
Result: Accurate, production-ready code on the first try.

Why This Matters

I made up Jane, Sakhile, and NexusPay. But this exact frustration plays out in companies everywhere:

  • You have good documentation.
  • Your team uses AI to ship faster.
  • The AI generates code based on outdated or generic patterns.
  • Everyone wastes time debugging and gets frustrated.

The problem isn’t the AI. It’s the lack of proper context. MCP creates the missing bridge so your internal knowledge becomes usable by the tools your team already relies on.

The Broader Shift

MCP is part of a larger move toward retrieval-augmented AI — systems that don’t just rely on what they memorized during training, but can fetch fresh, authoritative information at the moment it’s needed.

For developers and teams, this means:

  • Documentation stops gathering dust and becomes a living asset.
  • Internal standards and best practices actually get followed in AI-generated code.
  • Less time debugging, more time building.
  • Institutional knowledge stays accessible instead of trapped in unread wikis.

The Punchline

Sakhile’s MCP server took just an afternoon to set up. Jane didn’t have to rewrite her docs. The developers didn’t have to change their workflow.

The AI simply started getting it right.

Jane’s documentation finally became what she always intended: the actual source of truth.

That’s the quiet power of MCP. Not another thing to learn. Just a better connection between the knowledge you already have and the AI tools your team already uses.


This story is fictional. The problem — and the solution — is not. If your AI coding assistant keeps getting internal systems wrong, MCP is worth exploring.

Learn more: Model Context Protocol

Comments

No comments yet. Be the first to share your thoughts!

Sign in to join the discussion and leave a comment.

Subscribe to the Newsletter

Get notified when new articles go live. No spam, unsubscribe anytime.