MCP Resources and Prompts — Context Exposure Beyond Tools

Tools get 90 percent of MCP attention. The other two server primitives solve different problems. Resources expose data for reading; prompts expose reusable templates as slash-commands. Many servers should use resources instead of wrapping reads in tools, and prompts instead of hard-coding workflows in client prompts. This lesson names the decision rule and walks the `resources/*` and `prompts/*` messages.

Build 45 min Python (stdlib, resource + prompt handler)

Prerequisites: Phase 13 · 07 (MCP server)

#Learning Objectives

  • Decide between exposing a capability as a tool, a resource, or a prompt for a given domain.
  • Implement resources/list, resources/read, resources/subscribe and handle notifications/resources/updated.
  • Implement prompts/list and prompts/get with argument templates.
  • Recognize when the host surfaces prompts as slash-commands vs auto-injected context.
Full Access lesson

Keep going. The rest of this lesson is one step away.

Unlock all 503 lessons, video, code, quizzes and every future update. Pay in your own currency with Paystack.

The text and code of this lesson are based on AI Engineering from Scratch by Rohit Ghumare, MIT licensed.