Skip to content

MCP, in brief

A manager in a planning meeting asks: "Why do we need Playwright MCP? We already have Playwright." This lesson gives you the answer. The Model Context Protocol (MCP) is an open standard for connecting AI apps to outside tools and data. Before a standard like it, the same tool could have to be wired separately into each model or app, which the Stanford lecturer calls repeated work to avoid. MCP replaces that with one shared plug; the official documentation compares it to a USB-C port. You will meet the three roles in every connection (the host app, the client inside it, and the server that offers capabilities), the three things a server can offer (tools, resources, and prompts), and a worked illustration: how Playwright MCP lets an AI app drive a real browser while Playwright does the browser work. The lesson closes with what to ask before you connect a server, grounded in the MCP specification's guidance on consent and tool safety. Course materials are at cme295.stanford.edu; the MCP documentation is at modelcontextprotocol.io.

This is lesson 4 of Phase 6, How models reason and act, in Track 5 (AI Foundations). The phase builds toward telling apart a basic model call, a reasoning model, a retrieval-augmented call, a function call, and an agent loop, and explaining what each layer adds. This lesson adds the connection layer underneath tool use: how tools reach an AI app through one standard instead of custom wiring. The previous lesson (How models call functions) showed one model calling one function in three stages; MCP is a standard way to supply that function from outside the app. The next lesson (How agent loops work) chains many tool calls into a loop, which is where the trust questions from this lesson get sharper.

Prerequisites: the function-calling lesson is required. We assume you know the three stages of a single tool call (the model picks a function and its arguments, code runs it, the model explains the result) and that the model sees a tool's description, not its implementation. No coding background is needed; the one code example in the lesson is optional reading.

  • Explain the problem MCP solves (each tool wired separately into each AI app) and what a standard connection changes
  • Name the three roles in an MCP connection (host, client, server) and describe the job of each
  • Distinguish the three things a server can offer (tools, resources, prompts) by who controls each one
  • Explain why Playwright MCP exists, separating what MCP does (the connection) from what Playwright does (the browser work)
  • Describe the questions to ask before connecting a server, grounded in the official security guidance
  • Read time: about 15 minutes
  • Practice time: about 15 minutes (a self-check on the roles and offerings, a paper exercise mapping a fresh MCP scenario, and flashcards)
  • Difficulty: standard