SpunkArt
Long reads and site policies

The Model Context Protocol explained in plain terms

The Model Context Protocol, usually shortened to MCP, is an open standard for connecting AI applications to outside data and actions. Instead of each app writing its own connector for each service, both sides speak one protocol. This guide explains the pieces in general terms.

The problem it solves

An AI assistant becomes more useful when it can reach your files, your issue tracker or your database. Before a shared standard, every assistant needed a custom integration for every service. With five assistants and twenty services, that is up to a hundred separate pieces of glue code. A common protocol lets a service write one connector that any compatible assistant can use, much as a USB port lets one cable fit many devices.

The three roles

RoleWhat it isExample
HostThe application the person uses, which contains the AI model.A desktop chat app or a code editor with an assistant.
ClientA component inside the host that keeps one connection to one server.The host opens one client per connected server.
ServerA program that exposes some capability through the protocol.A server that can read a folder, or query a ticket system.

A server can run locally on your machine, talking over standard input and output, or remotely over HTTP. The messages themselves use JSON-RPC, a simple format where each request has a method name, parameters and an id, and each response returns a result or an error.

What a server can offer

Tools

Tools are actions the model can ask to run, such as “create an issue” or “search documents”. Each tool has a name, a description written for the model, and a JSON Schema describing its inputs. The host shows the tool list to the model; when the model wants one, the client sends a call and returns the result.

Resources

Resources are pieces of data the host can read and give to the model as context: a file, a database row, a log. They are identified by a URI. Typically the application or the user decides which resources to include, rather than the model.

Prompts

Prompts are reusable templates a server offers, such as “summarise this pull request”. The user usually picks them, for example from a menu or a slash command.

What a session looks like

  1. The host starts or connects to the server.
  2. Client and server exchange an initialisation message that says which protocol version and features each supports.
  3. The client asks for the list of tools, resources or prompts.
  4. During the conversation, the model requests a tool call; the client sends it; the server runs it and replies.
  5. The host passes the result back to the model, which continues.

A simplified tool call request looks like this:

{"jsonrpc": "2.0", "id": 7, "method": "tools/call",
 "params": {"name": "search_notes", "arguments": {"query": "invoice"}}}

Security points to check

Connecting a server gives the model new powers, so treat it like installing software.

  • Trust the source. A local server runs with your user permissions. Install only servers you trust or have read.
  • Limit scope. Point a file server at one project folder, not your whole home directory. Use tokens with the fewest permissions that work.
  • Watch for injected instructions. Data returned by a server, such as the text of a web page or an email, may contain instructions aimed at the model. The host should treat it as data.
  • Keep approval on risky tools. Writing, deleting and sending should ask the user first.
  • Check tool descriptions. Descriptions are read by the model, so a malicious server could use them to mislead it.

Building a simple server

Official software development kits exist for several languages. A minimal server defines one or two tools with clear names and input schemas, handles errors with useful messages, and returns results as compact text. Keep each tool focused on one job; a model chooses better between a few precise tools than among many vague ones.

Questions

Is MCP an AI model?

No. It is a communication standard. The model lives in the host application; MCP only defines how the host talks to outside programs.

How is it different from a normal API?

A normal API is specific to one service. MCP is a common wrapper that describes capabilities in a way any compatible AI host can discover and use. A server often calls a normal API behind the scenes.

Do I need to code to use it?

Not always. Many hosts let you add an existing server through settings. Building your own server does require programming.