Skip to main content

Hand-wired HTTP vs MCP, side by side

Module 5 · Lesson 4 · 7 min read

TL;DR

The lab exposes one Help Desk two ways: hand-wired HTTP (you write every tool and its request) and MCP (one connect() discovers them all). The agent behaves the same either way — same tools, same answers. What differs is what you had to write and what the trace shows: an http.request span you made, versus a tools/call span MCP made for you.

Same data, two ways in

The lab connects your agent to a sandbox Help Desk preloaded with demo orders. The same Help Desk is exposed two ways, and you run the same agent against each with a radio toggle:

  • Raw HTTP (hand-wired). You define each tool yourself — name, description, parameters — and its handler makes an HTTP request to a Help Desk endpoint. Every piece of wiring is spelled out in your source.
  • MCP (discovered). One MCPClient.connect("helpdesk") returns all the tools, ready to use. The wiring is gone.

Both reach the same orders table. Issue a refund through either face and the order's balance changes for real — flip to the other face and you'll see it.

What you'll actually compare

The model-facing surface is identical on purpose: same tool names, descriptions, and parameters. So the agent behaves the same either way — ask it to refund an order and it calls issue_refund regardless. The difference isn't what the agent does; it's what you wrote and what the trace reveals:

Same capability, same behavior — the difference is the wiring you own and the span you see.
Hand-wired HTTPMCP
Source you writeFive tool({…}) blocks + a request per handlerOne connect() line, no tool defs
Trace span for an actionhttp.request — your literal calltools/call — the protocol round-trip
Who owns the definitionsYou doThe server does
Adding a sixth toolWrite another blockAppears on next connect

This is the trade from Lesson 1, made concrete: hand-wiring is verbose but every request is visible and yours; MCP is one line but the requests happen behind the protocol.

Analogy

It's the difference between assembling flat-pack furniture from the printed steps (you see and control every screw) and hiring a service that shows up and builds it (one request, done — but you didn't watch the joinery). Same table at the end; very different amount of work and visibility.

Why build it both ways

Seeing both faces is the point of the lab. The hand-wired version isn't busywork — it's the baseline that shows you exactly what the one MCP line replaced. Once you've read both traces, you understand precisely what MCP is doing for you (and what it's hiding), so you can choose it deliberately rather than cargo-culting it.

Common mistake

Concluding "MCP is just less code, so it's always better." Less code is real, but the hidden trade is visibility: when something goes wrong, the hand-wired version puts the failing http.request right in your source, while the MCP failure lives inside a tools/call you didn't write. Both are debuggable via traces (Module 6) — but know which world you're in before the incident, not during it.

Key takeaways

Key takeaways

  • One Help Desk, two faces: hand-wired HTTP and discovered MCP, same orders table.
  • The model-facing tools are identical, so the agent behaves the same either way.
  • The real differences: lines of code you own, and http.request vs tools/call spans.
  • Building both makes the MCP trade concrete — you choose it with eyes open.
Go deeper: when hand-wiring is still the right call

MCP is the better default, but hand-wiring genuinely wins in a few cases:

  • One tiny, stable integration. If you need exactly one tool against an API that never changes, a hand-written tool() is less machinery than standing up or depending on an MCP server.
  • You need to see/transform every request. Compliance logging, request rewriting, or strict egress control are easier when the HTTP call is literally in your code.
  • No server exists yet. MCP only helps if the service speaks MCP. Against a plain REST API with no MCP server, you either hand-wire or build the server yourself — and hand-wiring one tool is cheaper than building a server for it.

The decision rule: many tools, evolving APIs, multiple agents → MCP; one stable tool or strict request control → hand-wire. This module gives you both in muscle memory so the choice is informed.

Build this in AI Fluens Studio

Reading is step one. Open Studio and build a working agent end-to-end — every concept in this course is something you ship and run for real.

Open AI Fluens Studio