Skip to main content

Module 2: Model Context Protocol

The Model Context Protocol (MCP) is the infrastructure layer that makes AI tool use composable, reusable, and interoperable. Announced by Anthropic in November 2024, it solves the N×M integration problem that made connecting AI systems to real-world tools expensive and fragile. This module covers the protocol from first principles through production deployment.


Module Map


Lessons at a Glance

#LessonWhat You Will Master
01What is MCPThe N×M integration problem; how MCP reduces it to N+M; the USB-C analogy; adoption landscape; comparison with function calling
02Architecture: Client-ServerHost, client, server roles; stdio and HTTP+SSE transports; JSON-RPC 2.0 message format; initialization handshake; full lifecycle
03Tools, Resources, PromptsThe three MCP primitives; schemas; when to use each; full Python implementations of all three
04Building an MCP ServerEnd-to-end Python MCP server using the official SDK; filesystem server with 4 tools; testing with MCP Inspector; connecting to Claude Desktop
05Security and PermissionsAttack surfaces; tool poisoning; confused deputy attacks; permission scoping; transport security; production security checklist
06Ecosystem and ServersOfficial Anthropic servers; community servers; registries; IDE integrations; evaluating third-party servers
07MCP vs Function CallingDeep comparison of both approaches; decision matrix; when to use each; hybrid patterns

Key Concepts This Module Covers

The N×M problem. Before MCP, connecting N AI applications to M tools required N×M custom integrations. MCP reduces this to N+M by providing a standard protocol both sides implement once.

Three primitives. MCP defines exactly three things a server can expose: Tools (executable functions), Resources (readable data), and Prompts (reusable templates). Understanding when to use each is the most important design decision in MCP server development.

Transport independence. MCP works over stdio (for local servers launched as subprocesses) and HTTP+SSE (for remote servers). The same server logic runs in both contexts.

Security model. MCP introduces new attack surfaces - tool poisoning, confused deputy attacks, resource injection - that require explicit countermeasures. Security is not optional in production MCP deployments.

Ecosystem momentum. By early 2025, MCP had been adopted by Claude Desktop, VS Code, Cursor, Zed, and hundreds of community-built servers covering databases, APIs, development tools, and cloud services.


:::tip Prerequisites This module assumes familiarity with: basic Python async programming, the concept of tool use and function calling in LLMs (covered in Module 1, Lesson 03), and REST APIs. No prior MCP experience required. :::

© 2026 EngineersOfAI. All rights reserved.