01Chapter 1: Why MCP exists: from custom integrations to one protocolThis chapter assumes you can read basic Python or TypeScript and are comfortable with JSON. You should know roughly how an LLM application calls tools: the model emits a structured request, the application runs it, and the result goes back to the model. You should also know the basics of client-serv6 min read
02Chapter 2: Hosts, clients, and servers: who does whatThis chapter assumes you can read basic Python, know what JSON looks like, and understand how an LLM application calls tools. You should also be comfortable with client-server communication. The wire format and the handshake come in later chapters. Here the question is who owns which responsibility.7 min read
03Chapter 3: The wire format: JSON-RPC requests, responses, and notificationsEvery message in the Model Context Protocol (MCP) is a JSON-RPC 2.0 message. This chapter covers the three message shapes, how requests are matched to responses, how errors are reported, and the mistakes that most often break a first implementation.6 min read
04Chapter 4: Starting a session: initialization and capability negotiationThis chapter assumes you can read JSON, know the host, client, and server roles from the earlier chapters, and understand the JSON-RPC request, response, and notification shapes. Here you will learn the three-message handshake that begins every Model Context Protocol (MCP) session. You will also lea6 min read
05Chapter 5: Moving messages: stdio and Streamable HTTPThis chapter covers how MCP messages travel between a client and a server. It assumes you can read the JSON-RPC messages from the previous chapter, know the host, client, and server roles, and have basic familiarity with HTTP and with processes and standard streams on the command line.7 min read
06Chapter 6: Tools: actions the model can invokeThis chapter assumes you have read the earlier chapters on hosts, clients, and servers, on JSON-RPC messages, and on the initialization handshake. You should be able to read a JSON-RPC request and a short Python function.6 min read
07Chapter 7: Resources: context the application can readThis chapter assumes you have read the earlier chapters on roles, JSON-RPC messages, and session initialization. You should be able to read a JSON-RPC request and its response, and know what the initialize handshake does. Basic Python is enough for the code.6 min read
08Chapter 8: Prompts: reusable templates the user selectsThis chapter assumes you know the host, client, and server roles, the JSON-RPC message shapes, and the initialization handshake from the earlier chapters. It also assumes you have seen how tools work. Here you will learn what a prompt is, how a client discovers and fetches one, and how to write one 5 min read
09Chapter 9: Building a minimal server and connecting a clientThis chapter builds a working MCP server with the official Python SDK, then writes a client that launches it, negotiates a session, and calls a tool. It assumes you can read Python and JSON. It also assumes you know the host, client and server roles, the shape of JSON-RPC messages, and the initializ5 min read
10Chapter 10: Configuring a host to launch and use serversThis chapter assumes you have read the earlier chapters on hosts, clients, and servers, on the stdio and Streamable HTTP transports, and on building a minimal server. You should be comfortable reading JSON and running commands in a terminal. Here you will learn how a host learns which servers exist,7 min read
11Chapter 11: Testing and debugging with MCP InspectorThis chapter assumes you have read the earlier chapters on JSON-RPC messages, the initialization handshake, and tools. You should also have Python 3.10 or later with the mcp package installed, and Node.js, because Inspector runs through npx.6 min read
12Chapter 12: What clients offer servers: sampling, roots, and elicitationThis chapter assumes you know the host, client, and server roles, the JSON-RPC message shapes, and the initialization handshake from earlier chapters. You should also be able to read short Python programs.5 min read
14Chapter 14: Security, trust, and user consentThis chapter covers the main security risks in the Model Context Protocol (MCP) and the duties each role carries. It assumes you know the host, client, and server roles, the JSON-RPC messages, and how tools, resources, and prompts work. You should also be comfortable with basic HTTP and the command 7 min read