MCP Fundamentals with Claude
Learn Model Context Protocol, the open standard Anthropic built so Claude can discover and call external tools and data sources without custom glue. Understand the three primitives (tools, resources, prompts), connect to existing MCP servers from Python, and build a multi-server client.
About This Course
Learn Model Context Protocol (MCP), the open protocol Anthropic developed so Claude clients can discover and call external tools + data sources without custom integrations. Understand the JSON-RPC-over-stdio-or-HTTP shape, the three primitives (tools, resources, prompts), how to connect to existing MCP servers from Python, and how to build a multi-server MCP client. This course is the plumbing story; CLD-AI-106 covers building your own servers.
Course Curriculum
10 Lessons
Introduction to Model Context Protocol
By the end of this lesson you will know what Model Context Protocol (MCP) actually is — Anthropic's open JSON-RPC protocol for connecting Claude clients (Claude Desktop, Claude Code, custom apps) to external tools and data sources — why it exists to solve the N-clients × M-sources integration explosion, and the three primitives every MCP server exposes: tools (Claude-invoked functions), resources (client-attached read-only data), and prompts (parametrized templates). Sets the stage for the L2 hands-on where you connect a Python client to a live MCP server.
Connect to an MCP server from Python - Lab Exercises
By the end of this hands-on lab you will have built a minimal Python MCP client that discovers three tools from an in-process mock MCP server (add, get_weather, list_orion_customers), then bridged those discovered tools into a Claude tool_use loop so Claude picks which one(s) to call for a natural-language request. Uses the PythonAI container + Claude API proxy — no external MCP server or Anthropic account needed. Proves the MCP payoff: adding a new server tool requires zero client-side code changes.
MCP protocol details: JSON-RPC + transports
By the end of this lesson you will know the shape of every MCP JSON-RPC message — the six standard methods (initialize, tools/list, tools/call, resources/list, resources/read, prompts/list, prompts/get), how request/response IDs pair up, and the two transport options (stdio for local subprocess servers, HTTP+SSE for hosted). Grounds the abstract three-primitives model from L1 in wire-level detail and sets up the L4 hands-on where you exercise resources and prompts (not just tools) end-to-end.
Use all 3 MCP primitives from a Python client - Lab Exercises
By the end of this hands-on lab you will have extended L2's tool-only MCP client to also list + read resources (client-attached data like customer profiles and runbooks) and list + fetch prompt templates (reusable server-defined message shapes) using the resources/list, resources/read, prompts/list, and prompts/get JSON-RPC methods against an enhanced mock server that now exposes 1 tool + 3 resources + 2 prompt templates. Uses the PythonAI container so no external MCP server is needed.
MCP server discovery and registries
By the end of this lesson you will know how MCP clients find available servers in production — declaring stdio servers in a client config file (Claude Desktop / Claude Code style), pulling from public registries (Anthropic's directory, npm, PyPI), and pinning server versions to avoid silent-tool-set drift when a server ships a new tool. Sets up the L6 hands-on where you build a client that reads a JSON config listing multiple MCP servers and routes tool calls to the right one.
Multi-server MCP client with config file - Lab Exercises
By the end of this hands-on lab you will have built a MultiMCPClient that reads a JSON config file listing multiple in-process MCP servers (orion tools + weather tools), connects to each in parallel, aggregates their tool descriptors with server-prefixed names to avoid collisions, and routes each of Claude's tool_use calls to the correct backing server. Uses the PythonAI container + Claude API proxy — proves the pattern that ships in Claude Desktop and Claude Code.
MCP security: sandboxing and consent
By the end of this lesson you will understand MCP's security model: servers run with the host user's privileges (so scope carefully), Claude Desktop and Claude Code show explicit consent prompts before every destructive tool call, and how to review a third-party MCP server before installing it (read tools/list output, audit the source, check publisher signature). Sets up the L8 hands-on where you wrap an MCP client with a per-tool-call approval gate mirroring Claude Desktop's default behavior.
MCP approval gate: per-tool-call consent - Lab Exercises
By the end of this hands-on lab you will have wrapped an MCP client with a per-tool-call approval hook that classifies each tool by risk (read-only auto-approve, destructive prompt-for-consent, denied never-call), then run three scenarios end-to-end to prove the gate correctly allows, blocks, and prompts. Mirrors the exact pattern Claude Desktop and Claude Code apply by default. Uses the PythonAI container + Claude API proxy — no external server needed.
MCP errors + progress notifications
By the end of this lesson you will know how MCP surfaces errors and progress: JSON-RPC error objects with standard codes (-32601 method-not-found, -32602 invalid-params, -32000+ server-defined), Python-SDK isError:true results for tool exceptions vs sentinel-return for expected misses, and progress notifications for long-running tool calls that let the client stream percent-complete back to the user. Prepares you for the L10 capstone where a multi-server agent must handle failures from either backend.
Multi-server MCP + Claude agent capstone - Lab Exercises
By the end of this hands-on capstone you will have wired two in-process MCP servers (orion-tools with customer data + runbook-tools with escalation procedures), aggregated their tools with server-prefixed names, and driven Claude through a support-triage decision that requires reading from BOTH servers to reach the answer. Every technique from CLD-AI-105 — discovery, primitives, multi-server routing, approval gates, error handling — lands in one runnable file. Uses the PythonAI container + Claude API proxy.