Follow the Journey
3 min read

How MCP Actually Works

Under the hood of Model Context Protocol

I spent a weekend reading the MCP spec. Not because I had to—because I couldn't stop.

This thing is elegant. Let me show you why.

The "aha" moment

Here's what clicked for me: MCP is just JSON over HTTP. That's it. No magic, no complex binary protocols, no proprietary nonsense.

Claude sends JSON. Your tool sends JSON back. Done.

I was expecting something complicated. Instead, I found something I could implement in an afternoon. And I did.

How the conversation works

When Claude connects to Recall, they have a little chat:

Claude: "Hey, what can you do?"

Recall: "I can search logs, get individual entries, and show you stats."

Claude: "Cool. The user wants to know why payments failed yesterday."

Recall: "Here are 47 error logs mentioning 'payment' from the last 24 hours..."

Claude: analyzes "Okay, I see the pattern. It's a Stripe timeout issue."

That's MCP. Two programs talking like colleagues.

The part that blew my mind

Claude decides when to call tools. You don't tell it to.

You say: "Why is the app slow?"

Claude thinks: "Hmm, this sounds like a performance issue. I have access to Pulse for metrics and Recall for logs. Let me check both."

Then it calls both tools, correlates the data, and gives you an answer.

I didn't program this logic. Claude figured it out from the tool descriptions. That's... kind of amazing?

What a tool looks like

Here's Recall's search tool. Nothing fancy:

{
  "name": "search_logs",
  "description": "Search logs. Use natural language.",
  "inputSchema": {
    "query": "what to search for",
    "timeRange": "how far back (e.g., '1 hour')"
  }
}

Claude reads this and knows: "Okay, I can search logs by giving it a query and a time range."

The description matters. Write it like you're explaining to a smart colleague. Claude's a smart colleague.

Implementing it in Rails

I was nervous about this part. "Protocol implementation" sounds scary.

It's not:

class McpController < ApplicationController
  def handle
    case params[:method]
    when "tools/call"
      execute_tool(params[:name], params[:arguments])
    when "tools/list"
      render json: available_tools
    end
  end
end

That's the core of it. JSON in, JSON out. Rails makes this trivial.

I had Recall's MCP server working in a few hours. Most of the time was spent on the actual search logic, not the protocol.

The moment it worked

I'll never forget the first time I asked Claude: "What errors happened in the last hour?"

And it just... answered. With real data. From my logs.

No copying. No pasting. No context switching.

Claude reached into Recall, grabbed the data, and told me what was happening.

That's when I knew MCP was going to change everything.

Why this matters for Brainz Lab

Every product I build gets an MCP interface. Day one. Non-negotiable.

Because in six months, people won't want dashboards. They'll want to ask questions and get answers. They'll want AI that can actually do things, not just chat about things.

MCP makes that possible.

The protocol is simple. The implications are massive.

— Andres

All posts Follow along

Want to follow the journey?

Get Updates