Core Primitives

MCP interview question · Medium difficulty

What are the core primitives an MCP server exposes?medium

Status
✓
Type
conceptual
Topic
core-primitives
Frequency
common
Tags
mcp, tools, resources, prompts, sampling
Answer

Tools, resources, prompts, and sampling.

Explanation

Tools are callable functions the model can invoke (create_issue, run_query) and are the most commonly used primitive. Resources are data — files, databases, structured or unstructured content — the host can read and inject into context. Prompts are reusable, parameterized templates a server offers for specific repeated tasks. Sampling is the least common and most advanced: it lets the server ask the client to run an LLM completion, a server-initiated AI call back through the client, which enables recursive or agentic server behavior. Most servers implement only tools; resources and prompts are less common, and sampling is rare.

Follow-upHow is a resource different from a tool call?
Follow-upWhat would a server use sampling for instead of just calling an LLM API directly itself?