MOFAKH.COM
← Back to profile
MCP Servers

Learning path: MCP servers from zero

Nov 28, 20265 min readWritten

The ordered path through the Model Context Protocol: what it is and why it exists, how an AI agent actually uses a tool, building a first MCP server in C#, then moving it from a laptop to the internet, securing it, designing good tools and running it in Azure. Two small projects grow through it, and every part ends by answering the questions that most often cause confusion at that stage.

This is the map for learning MCP servers from the ground up. It assumes no prior knowledge of how AI agents talk to other systems: having used a chat assistant is enough. Words such as "tool", "agent", "host", "transport" and "token" are easy to nod along to without really understanding, so each one is built up from scratch. The parts are ordered so that each idea rests on the one before, and each part ends with the common questions at that stage, answered properly.

The same two rules as every series in this notebook apply. No forward references: no part leans on a term an earlier part has not built. And no permanent black boxes: every "the AI just does X" gets opened at least once.

The two projects

Concepts stick when they have to do a job, so two small projects run through the path.

HelloMcp is the warm-up: a tiny MCP server with two tools, one that greets someone by name and one that rolls a die. It has no data and no security. Its whole purpose is to make the moving parts visible: what the AI sees, what it sends, and what comes back.

PhotoDrop is the real one. It is the photo-upload service from the Azure series, and later parts give it an MCP server so that an AI assistant can answer questions such as "how many photos did I upload this month?" or "which of my albums is the largest?". That raises every hard question at once: the server must be reachable over the internet, it must know who is asking, and each account must only ever see its own photos.

Where the path goes
HelloMcp
on your laptop
two toy tools
no security
grows into
An HTTP MCP server
reachable by URL
same tools
new door
grows into
PhotoDrop MCP
hosted in Azure
signed-in users
only their own photos

Local first. Everything up to hosting runs on a laptop with the .NET SDK, VS Code and an AI assistant that supports MCP. The hosting parts reuse what the Azure series already set up.

The parts

Part 1: What MCP is and why it exists. A model knows a lot, but nothing about your data. The three roles (host, client, server), why an agent and an MCP server are different things, tools versus resources versus prompts, and when a model calls a tool versus answering from what it already knows.

Part 2: The agent loop. Exactly what happens between typing a prompt and reading the answer: who sends what to whom, why a tool's result goes back to the model instead of straight to the screen, why the model needs the whole conversation every time, and who pays for which part.

Part 3: Your first MCP server in C#. Building HelloMcp step by step with the official C# SDK: why that "SDK" is really a set of NuGet packages, how NuGet picks the right build for your .NET version, the packages and why each is there, the attributes that turn a method into a tool, why the description is the most important line you write, connecting it to VS Code, and proving the answer really came from your code.

Part 4: stdio, plainly. What "stdio" actually means, why a stray Console.WriteLine can break a server, and the difference between how the AI reaches your server and what your server reaches.

Part 5: HTTP transport and stateless servers. Giving the same tools a URL: a small web app, calling it by hand with plain HTTP requests, connecting VS Code by address, and the idea underneath it all: what the initialize greeting is, stateful versus stateless servers, and why a public server should be stateless.

Coming next

These parts get written after the step they describe is built, so they are listed here and nowhere else for now:

  • Who is calling? Authentication versus authorization, and where the checks belong.
  • OAuth for MCP servers: sign-in, what is inside a token, and the rules the MCP spec adds.
  • Each account sees only its own data: building PhotoDrop's first real tool.
  • Designing good tools: shape, size, paging, errors, and text that tries to steer the model.
  • Hosting an MCP server in Azure: where it runs and what sits in front of it.
  • Running it in production: logging, limits, cost, and a checklist of every gotcha met along the way.
Note to self
MCP is moving quickly. The specification had a major revision in July 2026, and the C# SDK followed with version 2. Wherever a detail depends on a version, the part says which one, and the topic's links page points at the official sources to check against.
Previous
Start of this topic