MCP: connecting models to tools and data

The Model Context Protocol (MCP) is an open standard that lets any AI application connect to tools and data through MCP servers. Each integration is built once, and works with every MCP-compatible app.

Why it matters

Without a standard, every AI app needs its own custom integration with every tool — a separate connector for files, GitHub, databases and calendars in each app. MCP turns that many-to-many mess into one plug: write a server for your system once, and any MCP client can use it.

The idea

The Model Context Protocol (MCP) is an open standard, introduced by Anthropic in 2024, for connecting AI apps to tools and data. You write an MCP server once, for example one that searches your documents, and any app that speaks MCP can use it. A server can offer tools (actions), resources (data) and prompts (templates).

A USB port for AI tools. Before USB, every device needed its own special cable. With one standard plug, any device works with any computer.

A USB stick is usually harmless to plug in. An MCP server can read data and take actions, so connecting one is a security decision: only trust servers you understand, and watch for prompt injection in the data they return.

How it works

  1. The host is the AI application (a chat app, an IDE, an agent). It contains an MCP client.
  2. An MCP server wraps a system — your notes, GitHub, a database — and exposes tools (actions), resources (data to read) and prompts (templates).
  3. On connection, the client asks the server what it offers; tool names, descriptions and schemas go into the model's context.
  4. When the model decides to use a tool, the client sends the call to the server, which runs it and returns the result.
  5. The result goes back into the model's context, and it continues the conversation.
  6. Servers can run locally (talking over standard input and output) or remotely over HTTP, with authentication.

Key points

Common mistakes

Not true: Text returned by an MCP tool can be trusted as instructions for the model.
In fact: A tool's result is data, and data can carry hidden instructions (prompt injection). Treat it as untrusted, and give each server only the permissions it needs.

Not true: With MCP, each tool has to be rebuilt for every AI app that uses it.
In fact: MCP is a shared standard: a server is written once and works with any compatible app. That is the point of it.

Part of Unit 5: AI engineering in the free ML Foundations course.