MCP Server Primitives: Tools vs Resources vs Prompts

MCP Server Primitives: Tools vs Resources vs Prompts

This section focuses on how to define and access MCP resources effectively. It also covers creating reusable prompt templates to streamline your client applications.

5 audio · 2:44

Nortren·

What are the three core primitives of an MCP server?

0:33
The three core MCP server primitives are tools, resources, and prompts. The key insight is that each primitive is controlled by a different part of your application stack. Tools are model-controlled: Claude decides when to call them. Resources are app-controlled: your application code decides when to fetch them, typically for UI elements or for adding context to conversations. Prompts are user-controlled: the user triggers them, usually through UI interactions like button clicks, menu selections, or slash commands. This split between who decides when each primitive runs is the simplest way to remember which one to reach for in any given situation.

Why are MCP tools called model-controlled and when should you use them?

0:33
Tools are controlled entirely by Claude. The AI model decides when to call these functions, and the results are used directly by Claude to accomplish tasks. Tools are perfect for giving Claude additional capabilities it can use autonomously. When you ask Claude to calculate the square root of three using JavaScript, it is Claude that decides to use a JavaScript execution tool to run the calculation. You expose the capability through a tool, and Claude figures out the rest. So whenever you find yourself thinking the model should be able to do this on its own when it makes sense, that is a strong signal you should expose the capability as a tool.

Why are MCP resources called app-controlled and when should you use them?

0:32
Resources are controlled by your application code. Your app decides when to fetch resource data and how to use it, typically for UI elements or to add context to conversations. In a document management example, resources can be used in two ways: fetching data to populate autocomplete options in the UI, and retrieving content to augment prompts with additional context. Think of the Add from Google Drive feature in Claude's interface. The application code determines which documents to show and handles injecting their content into the chat context. The model is not deciding to fetch the data, the application is.

Why are MCP prompts called user-controlled and when should you use them?

0:32
Prompts are triggered by user actions. Users decide when to run these predefined workflows through UI interactions like button clicks, menu selections, or slash commands. Prompts are ideal for implementing workflows that users can trigger on demand. In Claude's interface, the workflow buttons below the chat input are examples of prompts: predefined, optimized workflows that users can start with a single click. So when you find yourself thinking the user should be able to invoke this whole workflow with a single action, that is the moment to package it as a prompt rather than expecting the user to type the same instructions every time.

How do you choose between tools, resources, and prompts in MCP?

0:34
Here is a quick decision guide. Need to give Claude new capabilities the model can choose to use on its own? Use tools. Need to get data into your app for UI elements or to add context to a prompt? Use resources. Want to create predefined workflows that users trigger on demand? Use prompts. You can see all three primitives in action in Claude's official interface. The workflow buttons demonstrate prompts. The Google Drive integration shows resources in action. And when Claude executes code or performs calculations, it is using tools behind the scenes. Each primitive serves a different part of your application stack.