Walkthrough

MCP — Model Context Protocol

The USB-C of agent tooling: one protocol that lets any client use any tool server — build one, wire one, and learn the security posture.

Steps · 0 / 4 done
  1. Understand what MCP standardizes

    Before MCP, every app integrated every tool bespoke (M×N integrations). MCP makes it M+N: servers expose tools, resources, and prompts over a standard protocol; any client (Claude Code, Codex, IDEs, your own app) can use any server. Donated by Anthropic in late 2024, adopted across the major labs in 2025 — it's the de facto standard for agent tooling.

    VerifyYou can say what tools/resources/prompts each mean: model-invoked actions / app-controlled data / user-invoked templates.
  2. Build a minimal server

    The Python SDK makes a tool server small enough to read in one screen:

    from mcp.server.fastmcp import FastMCP
    
    mcp = FastMCP("orders")
    
    @mcp.tool()
    def get_order_status(order_id: str) -> str:
        """Look up the current status of an order by id."""
        return lookup(order_id)  # your real logic
    
    if __name__ == "__main__":
        mcp.run()  # stdio transport for local clients
    VerifyType hints + docstring became the tool schema — the decorator derives what you hand-wrote in lesson aa-03.
  3. Wire it into a real client

    Register the server with Claude Code and use it immediately:

    claude mcp add orders -- python /path/to/orders_server.py
    # then in a session:
    #   "check the status of ORD-8812"
    # → the model discovers get_order_status and calls it
    Verify/mcp lists your server; the model calls the tool without you naming it — discovery worked from the description.
  4. Adopt the security posture

    An MCP server is code running with real access, and its outputs enter your context window. Rules: only install servers you trust (or read); scope credentials to least privilege (read-only tokens for read-only tools); treat tool RESULTS as untrusted input — a poisoned webpage fetched by a tool can carry injection text (Module 6); and require approval gates for destructive tools. Convenience is the attack surface.

    VerifyFor each server you run, you can answer: what can it touch, with which credential, and what happens if its output is hostile?
Check your understanding
Q1. What problem does MCP actually solve?
Q2. Why treat MCP tool results as untrusted input?
· Tick off the 4 step(s) above.
· Score 100% on the quiz.