LearnThatStack Ace your next interview
AI Engineering

Model Context Protocol (MCP).

Start free Change topic Change

Practise Model Context Protocol (MCP) one question at a time. Answer out loud or in writing, get graded, and see exactly what you missed.

Try one question

What is the Model Context Protocol, and what problem does it solve?

The answer

The Model Context Protocol (MCP) is an open standard that lets AI applications connect to outside tools and data through one common interface. Anthropic released it in November 2024.

The problem it solves is integration cost. Before MCP, every AI app wrote custom glue for every system: one connector for GitHub, another for Postgres, another for Slack. With M apps and N systems, you maintain M times N connectors.

MCP turns that into M plus N. You expose a system once as an MCP server, and any MCP-capable app can use it. The official analogy is a USB-C port for AI applications: one connector, many devices.

The real payoff is portability. Integrations move between hosts, and you add one without rewriting the app.

Example · what grading looks like
What are the three server primitives in MCP, and who controls each one?

“OK, so a server can offer three kinds of things: tools, resources and prompts, and what really separates them is who gets to decide when each one is used. Tools are up to the model. Say I've got a Jira server with a create_ticket tool: the model sees it in the list and decides in the middle of the conversation to call it, and the host would normally check with me before it actually runs. Resources are driven by the application. They're read-only things with a URI, like a project's README or a table schema, and the host chooses what to attach as context, the model doesn't go and fetch them itself. And prompts belong to the user: they're templates I kick off myself, say a 'draft release notes' command. I'd use that split when designing a server too: anything that changes state goes in a tool, so there's an approval step in front of it.”

Knew it

Names all three primitives with correct control owners and solid examples for each. Would be stronger noting that sampling, roots and elicitation are client primitives, not server ones, since that's a common follow-up trap.

Missed: Doesn't mention that sampling, roots, and elicitation are client-side primitives, not server ones


Get your own answers graded

Sign up free. Your account comes with 50 credits for grading, and it remembers what you missed.

What it covers

All 56 questions

Each on its own page

What MCP is and where it fits

The problem MCP solves, the host-client-server roles, and how it compares with REST, RAG, A2A and plain function calling.

6 questions

  1. What is the Model Context Protocol, and what problem does it solve?
  2. Explain the MCP architecture: what are hosts, clients, and servers?
  3. How is MCP different from a REST API? Pro
  4. How is MCP different from RAG, and do they compete? Pro
  5. How does MCP differ from A2A, and when would you use each? Pro
  6. When should you use MCP versus plain function calling in your own application? Pro

Tools, resources and prompts

The three server primitives, who controls each, how they are discovered and called, plus resource templates and subscriptions.

6 questions

  1. What are the three server primitives in MCP, and who controls each one?
  2. What exactly is an MCP tool, and how does a client discover and call one?
  3. How do resources differ from tools in MCP, and when would you expose data as a resource?
  4. What are MCP prompts, and how do they show up in a host application?
  5. How do resource subscriptions work, and what does a server need to implement? Pro
  6. What are resource templates, and how does argument completion work with them? Pro

Protocol messages and lifecycle

JSON-RPC message shapes, connecting to a server, notifications, pagination, and progress, cancellation and tasks for long-running calls.

6 questions

  1. What is the wire format of MCP messages? Describe the JSON-RPC 2.0 basics the protocol relies on.
  2. At a high level, what happens when an MCP client first connects to a server? Pro
  3. What role do notifications play in MCP? Give concrete examples. Pro
  4. How does pagination work for MCP list operations? Pro
  5. What is the MCP Tasks extension, and when would you put a long-running tool call behind a task? Pro
  6. How do progress reporting, cancellation, and timeouts work for long-running MCP requests? Pro

Transports and server state

stdio and Streamable HTTP, local versus remote servers, the retired HTTP+SSE transport, and stateful versus stateless designs.

6 questions

  1. What transports does MCP support today, and how do you choose between them? Pro
  2. What are the practical differences between local and remote MCP servers? Pro
  3. Describe the stdio transport precisely. What rules trip people up? Pro
  4. Explain how the Streamable HTTP transport works, including sessions and streaming. Pro
  5. What was the original HTTP+SSE transport, why was it deprecated, and how do implementations stay backwards compatible? Pro
  6. Compare stateful and stateless designs for a Streamable HTTP MCP server. What breaks when you go stateless? Pro

Building, configuring and testing servers

Writing servers with the Python and TypeScript SDKs, wiring them into Claude Desktop and Claude Code, testing them, and the registry.

7 questions

  1. How do you connect an MCP server to Claude Desktop? Pro
  2. What is the MCP Inspector, and how do you use it during development? Pro
  3. How would you build a minimal MCP server in Python? What is FastMCP? Pro
  4. How would you build a minimal MCP server in TypeScript with the official SDK? Pro
  5. How do you configure MCP servers in Claude Code, and what do its scopes mean? Pro
  6. How do you test an MCP server, from unit tests to end-to-end client tests? Pro
  7. Describe the MCP ecosystem and how the official registry works. Pro

Tool design and error handling

Writing tool schemas the model can use well, annotations and why they are untrusted, structured output, and protocol versus tool errors.

4 questions

  1. What makes a good tool schema? Give concrete design guidelines. Pro
  2. What are tool annotations, and why must hosts treat them as untrusted? Pro
  3. What is structured tool output in MCP, and how does it interact with backwards compatibility? Pro
  4. How should MCP servers handle errors? Distinguish protocol errors from tool execution errors. Pro

Sampling, roots and elicitation

Client-side features a server can ask for, how multi round-trip requests replaced server-initiated requests, and building sampling in a host.

5 questions

  1. What is sampling in MCP? Describe the flow and why it is designed with a human in the loop. Pro
  2. What are roots in MCP, and what guarantees do they provide? Pro
  3. Explain elicitation. When was it added and what constraints does it have? Pro
  4. What are Multi Round-Trip Requests (MRTR) in MCP, and which server-initiated requests do they replace? Pro
  5. You are implementing sampling support in a host application. What design and security decisions do you face? Pro

Spec versions and migration

Date-based versioning, extensions and deprecation, how the spec changed across revisions, and moving a server to the stateless revision.

4 questions

  1. How is the MCP specification versioned, and how do client and server agree on a version? Pro
  2. What is the MCP extensions framework, and how does the feature deprecation policy work? Pro
  3. Trace the evolution of the MCP specification across its major revisions. What migration concerns does each introduce? Pro
  4. How would you migrate an MCP server from the 2025-11-25 spec to the stateless 2026-07-28 revision? Pro

OAuth authorization for remote servers

The OAuth 2.1 flow for remote servers, client registration, token audience binding, and the confused deputy problem.

4 questions

  1. Walk through the OAuth 2.1 authorization flow for a remote MCP server. Pro
  2. Why did MCP lean on dynamic client registration, and what replaced it? Pro
  3. What is token audience binding in MCP, and why is token passthrough forbidden? Pro
  4. Explain the confused deputy problem in the context of MCP. Pro

Attacks and security hardening

Prompt injection through tool output, tool poisoning and rug pulls, and the security checklist for a public remote server.

3 questions

  1. How does prompt injection threaten MCP-based agents, and what mitigations actually help? Pro
  2. What are tool poisoning and rug-pull attacks on MCP, and how do you defend against them? Pro
  3. You are deploying a remote MCP server to production for external users. What is on your security checklist? Pro

Production architecture and debugging

Multi-tenant servers, gateways and composition, scaling to many servers and tools, and debugging servers in production.

5 questions

  1. How do you debug an MCP server's behavior in production, and what does the protocol's logging capability provide? Pro
  2. Design a multi-tenant remote MCP server for a SaaS product. What are the hard problems? Pro
  3. What happens when an MCP server is also an MCP client? Discuss composition patterns and their risks. Pro
  4. Your platform team wants agents to use 50 MCP servers with hundreds of tools efficiently. How do you architect this? Pro
  5. A remote MCP integration works in testing but fails intermittently in production. Walk through your systematic debugging approach. Pro
Practice · Questions

All questions

Showing of 56
Beginner 14
01

What is the Model Context Protocol, and what problem does it solve?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

The Model Context Protocol (MCP) is an open standard that lets AI applications connect to outside tools and data through one common interface. Anthropic released it in November 2024.

The problem it solves is integration cost. Before MCP, every AI app wrote custom glue for every system: one connector for GitHub, another for Postgres, another for Slack. With M apps and N systems, you maintain M times N connectors.

MCP turns that into M plus N. You expose a system once as an MCP server, and any MCP-capable app can use it. The official analogy is a USB-C port for AI applications: one connector, many devices.

The real payoff is portability. Integrations move between hosts, and you add one without rewriting the app.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

Explain the MCP architecture: what are hosts, clients, and servers?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

MCP splits an integration into three roles: a host, one or more clients inside it, and servers that expose capabilities.

Host (Claude Desktop, IDE, agent)
├── Client A  <-->  Server A  (filesystem, local)
├── Client B  <-->  Server B  (GitHub, remote)
└── Client C  <-->  Server C  (database, local)

The host is the AI application the user sees. It holds the model conversation, renders the UI, and asks the user for permission.

A client is a connector the host creates, and each client talks to exactly one server. Ten servers means ten clients. Since the 2026-07-28 revision, every request a client sends carries its own protocol version and capabilities, so no session state sits between requests.

A server is a separate program offering capabilities to its client. It may run locally as a subprocess or remotely over HTTP.

That one-to-one pairing is the isolation boundary. A server sees only what its own client sends, never other servers or the full conversation.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

What are the three server primitives in MCP, and who controls each one?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

MCP servers expose three primitives: tools, resources, and prompts. They differ mainly in who decides when each one is used.

  • Tools are model-controlled. The LLM chooses and calls them mid-turn, normally behind user approval.
  • Resources are application-controlled. The host decides what data to read and attach as context.
  • Prompts are user-controlled. The user picks them on purpose, like a slash command or menu item.

This control axis should drive your design. Anything with side effects belongs in a tool, so the host can gate it. Plain read-only context belongs in a resource, so the host stays in charge of the context window. A workflow a person should trigger belongs in a prompt.

Sampling, roots, and elicitation are client primitives, not server ones.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

What exactly is an MCP tool, and how does a client discover and call one?

Visual

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
Visual

A tool is a function a server exposes that the model can choose to call. Each tool has a unique name, a description, and an inputSchema, the JSON Schema that describes its arguments.

Discovery and calling are two JSON-RPC methods. The client sends tools/list and hands the returned definitions to the model. When the model picks one, the client sends tools/call with the name and arguments. The server returns content blocks such as text, images, or embedded resources.

// client -> server
{"jsonrpc": "2.0", "id": 2, "method": "tools/call",
 "params": {"name": "get_weather", "arguments": {"city": "Berlin"}}}

// server -> client
{"jsonrpc": "2.0", "id": 2,
 "result": {"content": [{"type": "text", "text": "18C, cloudy"}], "isError": false}}

Two details matter. Tools are model-controlled, so hosts should ask the user before running one. And if the server declares the listChanged capability, it can send notifications/tools/list_changed, and the client must re-list to stay current.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

How do resources differ from tools in MCP, and when would you expose data as a resource?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A tool is an action the model calls, while a resource is read-only data the host reads and puts into context.

Tools Resources
Who invokes it the model the host or user
Purpose perform work supply context
Addressed by name plus arguments a URI
Side effects allowed none expected
Method tools/call resources/read

Roughly, resources are GET and tools are POST.

{
  "uri": "file:///project/schema.sql",
  "name": "Database schema",
  "mimeType": "text/plain"
}

Expose data as a resource when it is stable, addressable content a user may want to attach: a file, a schema, a log. Host support varies, though, and some clients ignore resources. If the model itself must fetch the data, also ship a tool.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

What are MCP prompts, and how do they show up in a host application?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Prompts are reusable message templates that a server exposes by name. They are user-controlled, so a person picks one and the model does not invoke it on its own.

A client lists them with prompts/list and fetches one with prompts/get, passing any declared arguments. The server returns a list of messages, each with a role and content, which the host puts into the conversation.

{
  "description": "Review a diff for bugs",
  "messages": [
    { "role": "user", "content": { "type": "text", "text": "Review this diff:\n..." } }
  ]
}

In hosts they appear as explicit user actions, such as slash commands namespaced by server in Claude Code and menu items in Claude Desktop. Message content can embed resources, so one pick pulls in files plus instructions.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

07

What is the wire format of MCP messages? Describe the JSON-RPC 2.0 basics the protocol relies on.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

MCP messages are JSON-RPC 2.0 messages, UTF-8 JSON objects that carry "jsonrpc": "2.0". The transport only decides how they are framed and delivered.

There are three shapes. A request has an id, a method, and optional params, and expects exactly one reply. A response repeats that id with either result or error, never both. A notification has a method but no id, so nothing is sent back.

{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_weather","arguments":{"city":"Oslo"}}}
{"jsonrpc":"2.0","id":1,"result":{"content":[{"type":"text","text":"12C, clear"}]}}

An id is a string or an integer, never null, and a sender never reuses one still awaiting its reply. An error holds an integer code, a message, and optional data. Batching was allowed early on, then removed in the 2025-06-18 revision.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

08

What transports does MCP support today, and how do you choose between them?

Part of Pro
09

How do you connect an MCP server to Claude Desktop?

Part of Pro
10

What is the MCP Inspector, and how do you use it during development?

Part of Pro
11

What are the practical differences between local and remote MCP servers?

Part of Pro
12

At a high level, what happens when an MCP client first connects to a server?

Part of Pro Visual
13

How is MCP different from a REST API?

Part of Pro
14

How is MCP different from RAG, and do they compete?

Part of Pro
Intermediate 24
15

How is the MCP specification versioned, and how do client and server agree on a version?

Part of Pro
16

What role do notifications play in MCP? Give concrete examples.

Part of Pro
17

Describe the stdio transport precisely. What rules trip people up?

Part of Pro
18

Explain how the Streamable HTTP transport works, including sessions and streaming.

Part of Pro Visual
19

What was the original HTTP+SSE transport, why was it deprecated, and how do implementations stay backwards compatible?

Part of Pro Visual
20

How would you build a minimal MCP server in Python? What is FastMCP?

Part of Pro
21

How would you build a minimal MCP server in TypeScript with the official SDK?

Part of Pro
22

What makes a good tool schema? Give concrete design guidelines.

Part of Pro
23

What are tool annotations, and why must hosts treat them as untrusted?

Part of Pro
24

What is structured tool output in MCP, and how does it interact with backwards compatibility?

Part of Pro
25

How do resource subscriptions work, and what does a server need to implement?

Part of Pro Visual
26

What are resource templates, and how does argument completion work with them?

Part of Pro
27

How does pagination work for MCP list operations?

Part of Pro
28

What is sampling in MCP? Describe the flow and why it is designed with a human in the loop.

Part of Pro Visual
29

What are roots in MCP, and what guarantees do they provide?

Part of Pro
30

Explain elicitation. When was it added and what constraints does it have?

Part of Pro
31

How do you configure MCP servers in Claude Code, and what do its scopes mean?

Part of Pro
32

What are Multi Round-Trip Requests (MRTR) in MCP, and which server-initiated requests do they replace?

Part of Pro Visual
33

What is the MCP Tasks extension, and when would you put a long-running tool call behind a task?

Part of Pro
34

How do you test an MCP server, from unit tests to end-to-end client tests?

Part of Pro
35

How does MCP differ from A2A, and when would you use each?

Part of Pro
36

How should MCP servers handle errors? Distinguish protocol errors from tool execution errors.

Part of Pro
37

Describe the MCP ecosystem and how the official registry works.

Part of Pro Visual
38

What is the MCP extensions framework, and how does the feature deprecation policy work?

Part of Pro
Expert 18
39

Walk through the OAuth 2.1 authorization flow for a remote MCP server.

Part of Pro Visual
40

Why did MCP lean on dynamic client registration, and what replaced it?

Part of Pro
41

What is token audience binding in MCP, and why is token passthrough forbidden?

Part of Pro
42

Explain the confused deputy problem in the context of MCP.

Part of Pro Visual
43

How does prompt injection threaten MCP-based agents, and what mitigations actually help?

Part of Pro
44

What are tool poisoning and rug-pull attacks on MCP, and how do you defend against them?

Part of Pro
45

When should you use MCP versus plain function calling in your own application?

Part of Pro
46

Compare stateful and stateless designs for a Streamable HTTP MCP server. What breaks when you go stateless?

Part of Pro
47

How do progress reporting, cancellation, and timeouts work for long-running MCP requests?

Part of Pro Visual
48

How do you debug an MCP server's behavior in production, and what does the protocol's logging capability provide?

Part of Pro
49

You are deploying a remote MCP server to production for external users. What is on your security checklist?

Part of Pro
50

Design a multi-tenant remote MCP server for a SaaS product. What are the hard problems?

Part of Pro
51

Trace the evolution of the MCP specification across its major revisions. What migration concerns does each introduce?

Part of Pro
52

You are implementing sampling support in a host application. What design and security decisions do you face?

Part of Pro
53

What happens when an MCP server is also an MCP client? Discuss composition patterns and their risks.

Part of Pro
54

Your platform team wants agents to use 50 MCP servers with hundreds of tools efficiently. How do you architect this?

Part of Pro
55

A remote MCP integration works in testing but fails intermittently in production. Walk through your systematic debugging approach.

Part of Pro
56

How would you migrate an MCP server from the 2025-11-25 spec to the stateless 2026-07-28 revision?

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for Model Context Protocol (MCP)? Send them this set.
Quick recap

Model Context Protocol (MCP) in pictures.

A quick recap of Model Context Protocol (MCP) in 37 short animated pictures, one idea at a time. About 10 min to get the whole topic back in your head before you walk in. Pause any picture, slow it down, or step through it.

Pro The first chapter is free to play. The other 33 pictures come with Pro.

Get Pro · $10/mo
Pro · $10/mo

49 of 56 Model Context Protocol (MCP) answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git