Skip to content
mgd.dev

The OSI Model is a Lie (And Why It's the Best Tool for MCP)

July 05, 2025
2 min read
mcposimental-modelarchitecturerants

OSI-MCP Banner

The take: the OSI model is a lie—and a useful one. The internet is spaghetti; OSI is the tidy placemat you put under it so you don’t stain the table. When your MCP server is behaving like a gremlin, this model gives you a flashlight and a checklist.

Stop panicking and start localizing. Here’s the shortest, sharpest OSI‑for‑MCP you’ll actually use.

The Seven Layers, Translated for MCP

  • 7 · Application: The LLM + tool dance. Bad tool choice, wrong tool schema, missing capability? That’s you, not the network.
  • 6 · Presentation: JSON schemas, Content‑Type, TLS. If your error disappears when you pretty‑print the payload, this is the layer.
  • 5 · Session:
    typescript
    1Mcp-Session-Id
    , resume semantics, “unable to connect” hand‑waves. If state vanishes between turns, chase this.
  • 4 · Transport: Streaming HTTP vs HTTP + SSE, chunking, backpressure. Stream dies early? Layer 4 is haunted.
  • 3 · Network: TCP/IP, gateways, proxies. Random 502s from the abyss. Rarely your bug; always your incident.
  • 2/1 · Data/Physical: Disks, NICs, Wi‑Fi, burritos‑in‑microwaves. If everything else checks out… yeah.

But Why Bother

  • Faster triage: Name the failure class, halve your search space.
  • Clean seams: Layer 7 shouldn’t know Layer 4 exists. Future you will thank past you.
  • Security clarity: Which layer owns which secret? Stop leaking tokens into logs.

A Nod to the Trenches

The Simplescraper guide nails the “two transports” tax (Layer 4 pain) and the docs gap. The OSI lens is how you write your own docs—one layer at a time—without re‑litigating first principles.

So What / Try This Next

  • Add logs at boundaries: Raw request → parsed MCP → tool call → response. Breadcrumbs, not vibes.
  • Write layer tests: Does streaming survive 10MB? Does missing
    typescript
    1Mcp-Session-Id
    fail loud?
  • Error messages by layer: “Tool not found” (7), “Session expired” (5), “Stream closed” (4). Give your model clues.

Now stop yelling at your transport and fix your schema (or, yes, your Wi‑Fi).

Related Articles

MCP is Sticking

MCP is Sticking

When competing tech giants all sign on to the same protocol, you know something real is happening. The Feb 22nd NYC event was the canary in the coal mine.

MCP and the King's Hand

MCP and the King's Hand

Giving the brains hands.