GuideBeginner

Mcp Deep Dive

This guide is the direct continuation of the Agent Fundamentals and Tool Calling Guide: it takes the Reservo tools already built there (`get_quote`, `list_rooms`, `book_room`, `cancel_booking`) and exposes them through the Model Context Protocol (MCP), the open standard Anthropic published in November 2024 to solve the M×N integration problem (every agent reimplementing its own adapter for every tool) with an M+N solution instead (a single MCP server, reusable by any compatible client). You build a real Reservo MCP server and client: the wire protocol — JSON-RPC 2.0 over stdio — implemented by hand with Python 3.14 and its standard library (`subprocess`, no official SDK installed, $0, no network), the `initialize`/`initialized` handshake, and the protocol's three primitives: tools, resources, and prompts. It closes by connecting the server to a real `.mcp.json`, the kind Claude Code would use. The guide anchors its teaching to the stable `2025-06-18` revision (the one actually deployed across the ecosystem today) and honestly names, without reimplementing it, the modern stateless `2026-07-28` revision as the protocol's direction. Which tool/resource/prompt an LLM would decide to use is treated as a concept; the wire protocol itself actually runs and is verified against the official specification.

64
lessons
8
modules
English · Spanish
available in
Yes
certificate
Free
access
NIEVA

Outcomes

What you'll be able to do

  • Explain why MCP exists: the M×N integration problem it solves with an M+N solution, and the host/client/server architecture (a host creates one client per server it connects to)
  • Implement the MCP wire protocol by hand: JSON-RPC 2.0 over the stdio transport (`stdout` exclusively for valid messages, `stderr` for logs), verified byte-for-byte against the official specification
  • Run the handshake — `initialize` → a response with `capabilities`/`serverInfo` → `notifications/initialized` — with `protocolVersion` fixed at `2025-06-18`, before any operation
  • Build a real MCP tools server: the `tools` capability, `tools/list` and `tools/call` — and explicitly contrast MCP's JSON Schema (`inputSchema`) with the `tool_use`/`tool_result` protocol of Claude's Messages API already covered in agent-fundamentals
  • Expose resources (context data identified by URI, *application-driven*) with `resources/list`/`resources/read`, and decide when a resource is the right tool versus a search tool
  • Expose prompts (reusable templates, *user-controlled*) with `prompts/list`/`prompts/get`, contrasting the protocol's three interaction models: tools (model-controlled), resources (application-driven), and prompts (user-controlled)
  • Build a complete MCP client: negotiate capabilities after the handshake and discover a server's three primitives in a single run
  • Connect an MCP server to Claude Code with a real `.mcp.json` file, and distinguish production transports (local stdio vs remote Streamable HTTP)
  • Recognize the trust boundary of a third-party MCP server — its tool descriptions and resource text are untrusted data unless the server itself is trusted — and know which guide to go to for real hardening
  • Assemble the complete Reservo MCP server (all four tools with their schemas, two policy resources, and the `plan_booking` prompt) along with a client that discovers and uses it end to end

Before you start

What you need to bring

It's for you if...

  • Developers who already built an agent with tool calling and want to expose those tools in a standard, reusable way instead of hardcoding them inside the agent's process
  • Developers who will connect to or build MCP servers for Claude Code, Claude Desktop, or another compatible host
  • Backend developers who want to understand the real wire protocol — JSON-RPC 2.0 over stdio — instead of relying solely on an SDK
  • Anyone evaluating whether to adopt MCP on their team who first needs to understand the integration problem it solves and its host/client/server architecture

Requirements and materials

  • Agent Fundamentals and Tool Calling Guide completed (or equivalent: what a tool is, its JSON Schema contract, the `tool_use`/`tool_result` protocol)
  • Basic Python: functions, dictionaries, exception handling
  • Python 3.14 installed with its standard library; no API key, internet connection, or the official MCP SDK required

Content

The syllabus, module by module

Open any of them to see its lessons.

Common questions

What people usually ask

Start whenever you like

Reviews

What students say

These reviews are from enrolled students who completed at least 50% of the course. We moderate reviews only on content grounds (spam, offensive language, personal data), never for being critical or negative.

No approved reviews yet.

Be the first to share your experience!