All AI interview guides

AI engineer interview guide

MCP Interview Questions

The short answer. MCP interview questions are usually architecture questions wearing protocol clothes. You are expected to explain what the client and server negotiate, what each primitive controls, and what happens on the wire when a call fails. This guide gives the short answer first, then the message sequence and the failure you should name.

Updated 2026-11-05About 10 minutes to readReviewed against the LearningTo AI track

What is MCP in one answer?

The Model Context Protocol is a JSON-RPC 2.0 protocol between a host application and a server. The host starts one client per server. The client and server negotiate a protocol revision and a capability list during initialize, then use tools, resources, and prompts. The server can also send sampling, elicitation, and roots requests back to the client. The current pinned revision on this site is 2025-11-25.

MCP is not a REST API and not a wrapper around function calling. It standardizes discovery, execution, lifecycle, and authorization so one server works in many hosts. LearningTo owns one: a stdio server, tools only, ten tools. Five are bundled offline; five call learningto.co with a session token.

What happens before the first tool call?

A transport opens first, either a child process or one HTTP endpoint. The client sends initialize with a protocol version, its capabilities, and its identity. The server replies with its version, capabilities, and identity. Then the client sends notifications/initialized, which opens the operation phase.

The negotiation rules matter in interviews. If the server supports the requested version it must answer with that version; otherwise it must answer with one it supports, and the client disconnects if it cannot use it. The client should not send requests other than pings before the initialize response, and initialize itself must not be cancelled. A missing or wrong initialized notification is a common real bug.

What is the difference between tools, resources, and prompts?

The split is by control. Tools are model-controlled: the model chooses a tool, and the client sends tools/call. Resources are app-controlled: the host decides which URI-addressed context to attach, using resources/list and resources/read. Prompts are user-controlled: the user picks a template, and the client fetches it with prompts/get. The three names answer the question of who decides, not what the data looks like.

The result shapes differ too. A tools/call result is a list of content blocks, text, images, audio, resource links or embedded resources, plus an optional isError flag. A resources/read returns a contents array with text or a base64 blob. A prompts/get returns messages with roles and content. Resources also have a not-found error, -32002, which carries the URI in its data.

How do stdio and Streamable HTTP differ?

stdio runs the server as a child process and exchanges one JSON-RPC message per line on stdin and stdout. A message must not contain an embedded raw newline. stderr is free for logs, and nothing except protocol messages is allowed on stdout. This is the transport LearningTo uses, so no HTTP, no OAuth, and no session IDs appear on its wire.

Streamable HTTP uses one endpoint. Every client message is a POST with Accept set to both application/json and text/event-stream, because the server may reply with JSON or an event stream. Notifications and responses get 202 Accepted with no body. Later requests send MCP-Session-Id and MCP-Protocol-Version. GET returns an event stream or 405, an expired session returns 404 and the client starts a fresh initialize without the session ID, and an invalid Origin returns 403.

How does authorization work on the wire?

A remote MCP server is an OAuth 2.1 resource server. With no token it answers 401 with a WWW-Authenticate header that points at its protected resource metadata. The client reads that RFC 9728 document, finds the authorization server, fetches its metadata by RFC 8414 or OIDC discovery, and registers by preference: pre-registered credentials, a Client ID Metadata Document, or dynamic registration.

The client runs PKCE with the S256 challenge and includes the resource parameter from RFC 8707 in both the authorization and token requests, so the token is bound to this MCP server. It retries with Authorization: Bearer. If the token is valid but scoped too narrowly, the server returns 403 with insufficient_scope, and the client requests a token with the larger scope before retrying a limited number of times.

What questions come up in an MCP interview?

1. Explain MCP to a backend engineer in 60 seconds.

It is JSON-RPC 2.0 between a host and a server, with one client per server. initialize negotiates a version and capabilities, then the client can call tools, read resources, or fetch prompts, while the server can ask for a model call, a user answer, or its roots. The same messages run over stdio or Streamable HTTP; only the transport, session, and authorization layers change.

Whether you can name the roles and the handshake before listing features.

2. Why does every session start with initialize?

MCP is capability based, so neither side may use a feature before the other declares it. initialize carries the protocol version, client capabilities, and client identity; the response carries the negotiated version, server capabilities, and server identity. notifications/initialized closes the handshake, and skipping it leaves later requests in an undefined state.

That you understand negotiation, not just connection setup.

3. What happens if the client asks for a protocol version the server does not support?

The server must answer with a version it does support, and should pick its latest. The client should disconnect if it cannot speak that version. Some implementations instead return a -32602 Unsupported protocol version error, which the spec shows as an example, but the normative rule is the version reply. A good answer states the rule first and the implementation variant second.

Whether you can separate normative text from an example.

4. Walk me through one tools/call.

The client asks tools/list and the host puts names, descriptions, and input schemas into the model context. The model proposes a name and arguments, the host validates the arguments against the schema, and the client sends tools/call with that name and object. The server returns content blocks, normally text for LearningTo, and sets isError when the tool ran but failed. A protocol error is a separate, JSON-RPC-shaped response.

Whether you know discovery and execution are two round trips.

5. What are sampling, elicitation, and roots?

They are server-to-client requests. sampling/createMessage asks the client to run a model call, so the server never needs a provider key. elicitation/create asks the user a question through the client UI; form mode collects flat primitive fields, and URL mode sends the user to an HTTPS page and returns only whether they consented. roots/list returns the roots the client allows. All three need the client capability.

That you know the protocol direction runs both ways and is negotiated.

6. What is the difference between stdio and Streamable HTTP?

stdio is a child process with newline-delimited JSON, stderr for logs, and no network auth. Streamable HTTP is one endpoint with POST, an optional GET event stream, a session header, and a protocol version header. HTTP can use the OAuth 2.1 profile; stdio should read credentials from the environment instead.

That you can separate transport concerns from protocol messages.

7. What does an MCP client do when an HTTP server returns 401?

It reads WWW-Authenticate, follows resource_metadata or probes the well-known path, and fetches the protected resource metadata to find the authorization server. It reads that server metadata, registers a client, runs PKCE with the resource parameter, exchanges the code for a token, and retries with Bearer. A later 403 insufficient_scope starts a step-up request for the missing scope.

Whether you can narrate the discovery chain without inventing an API key step.

8. When should a server return a JSON-RPC error instead of isError?

Use a JSON-RPC error when the request cannot be dispatched: an unknown method, an unknown tool, or malformed params. Use isError on a normal result when the tool ran and failed in a way the model can read and correct. The spec example for an unknown tool is -32602; LearningTo instead returns isError true with the text Unknown tool, which is a deviation you can describe but should not present as the rule.

That you know the two error channels and can name an implementation choice honestly.

9. What is experimental in the 2025-11-25 revision?

Tasks are marked experimental: tasks/get, tasks/result, and tasks/cancel exist in the core schema but should not be presented as stable. URL mode elicitation, tool calling inside sampling, and discovering OAuth clients through a Client ID Metadata Document are also real additions here. Interviewers mostly care that you can separate core behavior from parts marked as moving.

That you track the revision instead of describing a generic protocol.

What mistakes show up in MCP interviews?

Confusing the host, the client, and the server

The host is the app the user runs. It starts one client per server. The server exposes features and can send requests back. Answers that blur these roles tend to break at the reverse-direction questions.

Saying resources are model-controlled

The model chooses tools. The app chooses resources. The user chooses prompts. That three-way split is the cleanest one-line answer in the whole interview, and reversing it is a quick way to fail the follow-up.

Giving a notification an id

Notifications carry no id and get no response. initialized, progress, and cancelled are notifications, and the HTTP transport answers a POSTed notification with 202. Adding an id turns them into requests and changes the whole lifecycle.

Treating every failure as a protocol error

Unknown tools and malformed requests are protocol errors. A tool that ran and failed uses isError on a normal result. The difference exists so the model can read the failure and correct its next call.

Assuming HTTP and OAuth apply everywhere

stdio has no HTTP endpoint, no 401, and no session header; it should take credentials from the environment. LearningTo is a stdio server, so its auth failure is a normal text result, not a WWW-Authenticate challenge.

What else do people ask about MCP?

Is MCP the same as function calling?

No. Function calling is the model API pattern for proposing a call. MCP standardizes how a host discovers and executes those tools across servers, including lifecycle, capabilities, transports, and authorization. A host still validates and executes the call.

Do I need HTTP to use MCP?

No. Many local integrations use stdio, where the host launches the server as a child process and speaks newline-delimited JSON-RPC over its pipes. HTTP matters for remote servers and for the OAuth profile.

Which specification version should I cite?

Cite the versioned revision you actually built against, such as 2025-11-25, and remember that the version is negotiated in initialize. The unversioned docs site can change after publication, so the versioned URL is the safer reference.

Does LearningTo's MCP server support resources or prompts?

No. Its initialize result declares tools only, with no listChanged flag and no resources, prompts, sampling, or logging. It runs over stdio and exposes ten tools, five bundled and five that call learningto.co with a session token.

Where should I go next?

Read the interactive explainer at /mcp for the messages in order, then practice the agent loop and guardrail topics. If you want to build a server, start with one tool and a test that calls it over stdio.

Written by the LearningTo team from the 2025-11-25 specification and a local capture of the LearningTo MCP server. Where the server differs from a spec example, the guide says which is which.