DEV Community

Ryan Banze
Ryan Banze

Posted on

# MCP Units: Composable Modules for the Agentic Era

Every app you've ever shipped was built for a human to click through. That era has an expiry date.


AI agents are no longer coming — they're already here, reshaping the tools you use, the workflows you run, and decisions that used to need a human in the loop. And as that happens, a new layer of infrastructure is quietly becoming the standard. Agentic protocols. MCP. A2A. x402. Not buzzwords — actual contracts between agents and the systems they need to act in.

The shift is architectural and worth sitting with for a second. HTTP was built for browsers. For humans who navigate, click, and wait. Agentic protocols are built for something that doesn't navigate — it decides. It doesn't need a button. It needs a verb.

MCP is where I think this gets most practical. You take your existing capabilities — whatever your app already does — and you expose them as things an agent can call: tools it can invoke, data it can read, prompt templates it can fetch. You're not rebuilding anything. You're giving what you've already built a surface agents can reach.

What surprised me most when I went deep on the protocol is how bidirectional it actually is. Elicitation lets your server pause mid-execution and ask the agent back for what it needs. Sampling flips it entirely — your server calls the model, not the other way around. Completions guide the agent through valid inputs before it even makes a call. It's not a pipe. It's a conversation.

The apps that don't make this shift won't disappear. They'll just become invisible to the agents making decisions on behalf of your users.

What You'll Walk Away Able to Build

By the end of this section you've got a working MCP server and client running from the command line — your own code, two transports, real capabilities. Not a wrapper around someone else's demo. Something you built. Here's what gets you there.

The full video walkthrough is on the YouTube playlist and a structured course version with all code is on Udemy.

Section 1 — Simple Tools

This one's the entry point and honestly the most satisfying. You take a function you've probably already written and with one decorator it becomes something an agent can discover, understand, and call. No new infrastructure. No glue code. The function is the thing.

Section 2 — Resources

Not every capability should be an action. Some things your app holds — reference data, configs, live state — an agent should be able to read but never trigger. Resources handle that. The agent can look, it can't touch. It's a small distinction that matters a lot once you're building something real.

Section 3 — Prompts

I see this one get skipped and it's a mistake. If you've ever copy-pasted the same system prompt across three different integrations and then had to update all three when something changed — prompts solve that. Define your instructions once on the server, with parameters, and every client that connects gets the same thing. One place to update. Everywhere benefits.

Section 4 — Structured Return Types

This is where most people hit their first real gotcha. Whether you get structured data your app can act on, a text blob you have to parse, or — if you get it wrong — a memory address, all comes down to how you annotate the return type. Once you see it laid out across six patterns side by side you won't forget it.

Section 5 — CallToolResult Patterns

Tool responses can carry a lot more than text. Images, documents, errors, and — this is the part I find most useful — metadata that your application sees but the model never does. Routing hints, cache keys, UI flags. None of it leaks into the model context. What the agent sees and what your app sees can be two completely different things, and that separation is what lets you build real product logic on top of MCP responses.

Section 6 — Async + Context

Once your tools start doing real work — calling APIs, processing lists, writing to state — you want them to communicate back while they're running, not just when they're done. This section covers how to push progress, warnings, and log messages to the client mid-execution. And when a tool changes server state, connected clients get notified immediately. No polling loop, no manual refresh.

Section 7 — Full Tour

Everything from the six sections above, combined into one server. 19 tools, 2 resources, 2 prompts — wired into MCP Inspector and Claude Desktop, driven by a Python client over both transports. The point of this section isn't to introduce anything new. It's to show you what the whole thing looks like when it's actually running together.

Not Sure If You're Ready?
If any of the above felt unfamiliar, there's a prerequisite section that covers the building blocks: Python intermediate, decorators, JSON, type hints, async/await, SQLite, and Starlette/Uvicorn. It's aimed at students newer to coding and only covers what actually shows up in the course. Skip it if you don't need it.

Where to Go Next
This section is the foundation. What comes after goes into the patterns that matter in production — low-level server API, lifespan management with SQLite, sampling, elicitation, pagination, Starlette mounting, and the legacy SSE transport.

Watch it: YouTube Playlist — MCP Masterclass
Build it: Udemy Course — Model Context Protocol: Build MCP Servers and Clients in Python
All working code. No slides.

You Made It To The End
Most people don't. They skim the intro and close the tab — so the fact that you're here means you're actually thinking about building this, not just curious about the hype.

If this was useful, share it with someone who's figuring out agents, hit like, and subscribe. More sections are coming and I'd rather you not miss them.

Five seconds from you keeps this going.

Top comments (0)