MCP (Model Context Protocol) Lesson 6 of 6 ⏱️ 4 min read

MCP Interview Questions

Model Context Protocol interview questions on architecture, transports, primitives and security, with concise answers.

Updated Oct 30, 2026

MCP interview questions

MCP has quickly become a standard skill for AI engineering and backend roles that touch AI. These are the questions you're most likely to meet.

1. What is the Model Context Protocol?

An open standard for connecting AI applications to external tools and data. A service exposes capabilities through an MCP server; any MCP-compatible host (AI app) can discover and use them through an MCP client, without a custom integration for every pair.

2. What problem does MCP solve?

The M × N integration problem: M AI apps × N services would need M × N custom connectors. With MCP, each service builds one server and each app implements one client — roughly M + N pieces.

3. Explain host, client and server.

  • Host — the AI application (desktop assistant, IDE, your app) that the user interacts with.
  • Client — a connector inside the host, one per server, that speaks the protocol.
  • Server — a program exposing tools, resources and prompts.

4. What are the three MCP primitives?

Primitive Controlled by Purpose
Tools Model Actions and computations
Resources Application Read-only data identified by a URI
Prompts User Reusable message templates

5. When would you use a resource instead of a tool?

When the capability is read-only data the application loads into context — a document, schema or config. Use a tool when the model must act or fetch something dynamically based on its own reasoning.

6. What transports does MCP support?

stdio for local servers launched as subprocesses, and Streamable HTTP for remote servers that many clients reach over the network. Messages are JSON-RPC 2.0 in both cases.

7. Why must a stdio server never print to stdout?

Standard output carries the JSON-RPC protocol. Any stray print() corrupts the message stream. Log to stderr instead.

8. Walk through the lifecycle of an MCP connection.

  1. Initialize — exchange protocol version and capabilities.
  2. Discover — list tools, resources and prompts.
  3. Use — call tools, read resources, get prompts.
  4. Shutdown — close the connection.

9. How do you build an MCP server in Python?

Use the official SDK's high-level MCPServer class (called FastMCP before version 2.0). Decorate functions with @mcp.tool(), @mcp.resource("uri") and @mcp.prompt(); type hints become the JSON Schema and docstrings become descriptions. Call mcp.run() for stdio or mcp.run(transport="streamable-http") for HTTP.

10. How should an MCP tool report an error?

Raise ToolError with a clear, safe message for expected failures — the client receives a result with is_error set and the model can read the message and retry. Other exceptions are treated as crashes: the model sees only a generic error and the server logs the traceback.

11. How does MCP relate to LLM tool calling?

MCP standardises how tools are described and executed; the LLM still uses its normal tool-calling mechanism. An MCP client maps each MCP tool's name, description and input schema onto the LLM's tool definitions, and forwards the model's tool calls to call_tool.

12. What are the main security risks with MCP?

  • Prompt injection via content the model reads.
  • Over-privileged servers that can do far more than needed.
  • Unvalidated input such as path traversal or SQL injection.
  • Unauthenticated remote servers exposed on the network.
  • Malicious third-party servers or tool shadowing.

13. How do you secure a remote MCP server?

HTTPS, authentication on every request (OAuth 2.1 in the MCP spec), least-privilege credentials, input validation, rate limiting, Origin validation, and logging of every tool call.

14. What is tool shadowing?

A malicious server names or describes its tools so the model chooses them over a trusted server's tools — for example a fake send_email that exfiltrates data. Defend by vetting servers, prefixing tool names per server and limiting which servers are connected at once.

15. Can MCP replace a REST API?

No. MCP is an AI-facing layer. A typical MCP server calls your existing REST API or database internally and presents a small, model-friendly set of tools on top of it.

Practice tip

Build the to-do server from this tutorial, add SQLite persistence and one resource, then write a client that lists and calls its tools. Being able to explain your own server's design choices is the best preparation for MCP interview questions.

Finished this lesson?
Tick it off to track your MCP (Model Context Protocol) progress.