,

MCP explained: the Model Context Protocol in plain English

MCP is a shared plug for connecting AI apps to tools and data. This guide covers the architecture, the building blocks, a request end to end, and the security traps.

0

Every AI app wants to read your files, query your database and call your APIs. Without a standard, each app wires up each tool by hand. The Model Context Protocol (MCP) is the standard.

Details here follow the protocol revision dated 2026-07-28. Check the current spec before you build.

1. One protocol instead of every app wiring every tool

Without MCP, N apps and M tools mean N x M custom integrations. With MCP each side speaks the protocol once, so the work becomes N + M.

N times M

2. Host, clients and servers

The host is the AI application. Inside it, one MCP client per server holds a dedicated connection. A server exposes capabilities, either locally over stdio or remotely over Streamable HTTP. Messages are JSON-RPC 2.0.

Architecture

3. What a server can offer, and what a client can offer back

Servers offer three primitives.

  • Tools: actions the model can call, such as search_orders(query).
  • Resources: context data to read, such as file contents or a schema.
  • Prompts: reusable templates.

Clients can offer elicitation, which lets a server ask the user for input or confirmation. Sampling and logging are deprecated from the 2026-07-28 revision; prefer your own LLM API calls, plus OpenTelemetry or stderr for logs.

Primitives

4. A request, end to end

  1. server/discover: the client learns versions, capabilities and identity, which can be cached.
  2. tools/list: the client gets tool names, schemas and descriptions.
  3. tools/call: the client sends a name and arguments and receives result content.
  4. subscriptions/listen: the client opts in to notifications such as a changed tool list.
Request flow

5. From idea to a server your host can use

Write the server with an official SDK, starting with one small tool. Run it in the MCP Inspector and call it by hand. Add it to a host’s config, reviewing the exact command. Try real prompts and check the model picks the right tool. Then review scopes, errors and who called what.

Build and test

Tool names and descriptions matter as much as the code. They are what the model reads to decide when to call.

6. Six ways it goes wrong, and the fix for each

Threats
Risk What happens Fix
Confused deputy A proxy reuses one OAuth client ID and a consent cookie Store per-client consent server-side, match redirect URIs exactly
Token passthrough A server forwards tokens it never validated Accept only tokens issued for this server
SSRF A malicious server points discovery at internal URLs HTTPS only, block private and link-local ranges, use an egress proxy
Local server compromise One-click setup runs an unknown command Show the exact command, ask first, sandbox with minimal rights
Over-broad scopes A stolen token can do everything Start with read, step up on demand, log elevations
State handle hijacking A guessed ID opens another user’s state Random handles bound to the verified user

Takeaways

  • MCP turns N x M integrations into N + M.
  • Host, client, server; stdio locally, Streamable HTTP remotely.
  • Tools act, resources inform, prompts template.
  • Treat every server as untrusted code with access to your data.

Sources

  • Model Context Protocol specification and security best practices (modelcontextprotocol.io).
  • OWASP Top 10 for LLM Applications (2025).

Leave a Reply