What Is MCP (Model Context Protocol)? The Standard Connecting AI to Tools
Engineering

MCP (Model Context Protocol): The Standard That Connects AI to Tools and Data

On its own, an AI model cannot check your calendar, query your database, or read a file. MCP standardises that connection, a kind of USB-C for AI. Here is when it makes more sense than a direct API, and what to check before going to production.

Short answer

MCP (Model Context Protocol) is an open protocol, open-sourced by Anthropic in 2024, for connecting AI applications to tools and data sources. The application (the host) connects to each MCP server through its own client, and servers offer tools, resources and prompt templates. MCP standardises the connection but does not provide authorization: check user permissions in the server, start with read-only tools and require approval for sensitive actions.

What is MCP (Model Context Protocol)?

MCP is an open protocol for connecting AI applications to tools and data sources. Anthropic open-sourced it on 25 November 2024; the announcement describes the problem it addresses as every new data source requiring its own custom implementation, which makes connected systems hard to scale. With MCP, a data source or tool is written once as a “server”, and different applications that support the protocol can connect to it the same way.

Model Context Protocol (MCP) defines how an AI application can discover and use capabilities exposed by another program. An MCP host is the application the user runs. It creates a client connection for each server. A server can expose tools that perform actions, resources that provide data, and prompts that offer reusable templates. The model itself is not an MCP client: the host decides what to show the model and whether a requested call is allowed. This distinction matters when you design permissions. The MCP architecture specification defines these roles and boundaries.

How does MCP work?

The host creates a client for each server it connects to, and each client holds a one-to-one session with a single server. Messages are carried over JSON-RPC. At the start of a session, client and server declare which features they support; for example, the server declares tool support and the client declares support for sampling, that is, requesting completions from the model. Only the declared features can be used in that session. Sampling reverses the usual direction: a server without its own model access asks the host's model for a response through the client. Whether to allow that request is again the host's decision; under the architecture specification, user consent and security policies are enforced by the host.

One of the specification's design principles matters especially for security: servers should not be able to read the whole conversation, nor see into other servers. The conversation history stays with the host, each server receives only the context it needs, and the host controls any interaction between servers. In practice, a file server does not automatically see the data returned by a CRM server connected to the same application.

A server can run as a local process on the user's computer or as a remote service reached over the network. Local servers are connected over standard input and output (stdio), remote servers over HTTP. This choice also determines how authorization works, as the security section below explains. A local server runs with the permissions of the user's machine, so its installation needs care; a remote server is reached over the network, so its authentication does.

What can an MCP server offer?

A server offers three building blocks, each controlled by a different party. The MCP server specification summarises the control split like this:

Building blockWhat it doesWho controls itExample
ToolAn executable function that lets the model take an action or retrieve informationThe model (the host allows the call)Document search, creating a record, an API request
ResourceStructured data or content supplied to the model as extra contextThe applicationFile contents, version history, the text of a regulation
PromptA ready-made template the user runs by choiceThe userA menu option, a slash command

This split makes design easier. Anything the model can call on its own is a tool, and tools need the tightest control. Offering read-only content as a resource rather than a tool is a simple way to avoid handing the model an action it does not need.

Hypothetical example: an assistant that finds the right version of a regulation

Suppose a legal research assistant needs to answer, “Which version of this regulation applied on the contract date?” A read-only MCP server could offer a search tool that accepts the regulation name and date, then returns matching document IDs. A resource could return the text and publication metadata for a selected version. The host would ask the user to authorize access, call only the permitted server, and pass the returned passages to the model. The final answer should name the source and effective date and say when the available records are insufficient. This is a hypothetical design example.

MCP describes the exchange between components; it does not guarantee that the retrieved regulation is current, that the model will cite it correctly, or that the user has permission to see it. Those checks belong in the application and data service. RAG may select relevant passages; MCP is one possible way to expose a retrieval capability to the host. They solve different parts of the system.

How is MCP different from a direct API integration?

A direct integration connects one application to one system; MCP opens the same server to several applications that support the protocol. MCP helps when the same data service or tool must be available to several compatible AI applications. A team can maintain one server interface and connect it to multiple hosts, subject to each host's supported features and authorization. If one application calls one internal API, a direct integration may be simpler. The familiar “N × M becomes N + M” description is an architectural goal, not a guaranteed saving: authentication, schemas, error handling, version compatibility, and user experience still need work.

SituationSuitable approachWhy
One application, one internal API, the same team owns bothDirect integration or an in-app tool definitionAn extra protocol layer adds maintenance without benefit
The same data source will be used by several AI applicationsAn MCP serverThe integration is written once and different hosts use the same interface
A desktop or developer tool with MCP support is already in useAn MCP serverUsers can call the tool from the applications they already have
High-risk write operations, strict audit requirementsA narrow direct integration firstPermission, approval and logging rules are easier to mature in one place

Is MCP secure?

The protocol provides building blocks for security, but your deployment decides how secure it is. Under the authorization specification, authorization is optional. Implementations that run over HTTP should conform to that specification, which is based on the OAuth 2.1 draft; local implementations using stdio should instead retrieve credentials from the environment. The specification requires servers to accept only access tokens issued for them, and forbids them from passing a received token through to another service.

MCP's security best practices page lists concrete attacks: the “confused deputy” problem, in which user consent is bypassed on servers that proxy third-party APIs; passing tokens through without validation; session hijacking; and compromise of local servers running on the user's machine. Its advice for local servers is clear: the client should show the exact command it will run without truncation, get explicit approval, and start the server with minimal privileges, ideally in a sandbox. The same page recommends starting with a minimal set of scopes and requesting more only when needed, rather than asking for broad scopes up front.

Tool annotations may describe a server's intent, but they are not a security guarantee. The MCP maintainers' explanation of tool annotations makes clear that markers such as read-only or destructive are hints, and that an untrusted server can mislabel a dangerous action. Its advice to client developers is to use these hints for the user interface but keep the actual safety guarantees in deterministic controls.

Security checklist before production

  • Start with read-only operations. Separate searches from writes such as sending an email or editing a record. Require explicit approval for sensitive actions.
  • Enforce access at the server. Check the user's identity and document permissions on every request. A model prompt or a tool description is not access control.
  • Validate tokens. The server should accept only tokens issued for it, and connect to downstream APIs with its own token.
  • Limit returned data. Return the relevant passage and source metadata, not an entire private database row or unrestricted file content.
  • Treat results as untrusted. A retrieved document may contain instructions aimed at the assistant. The host must keep source text separate from its own rules and permissions.
  • Log and test. Record tool identity, authorized user, result status, and source IDs without leaking sensitive document contents into logs. Test denied access, stale data, malformed responses, and prompt-injection attempts.

How do you roll out an internal MCP server step by step?

  1. Narrow the use case: Which applications, which users and which questions? Two or three read-only tools are enough for a first version.
  2. Decide local or remote: A local server for a single-user developer tool, an authenticated remote server for team-wide use.
  3. Write the tool contracts: Define each tool's input schema, returned fields, error cases and a limit on results per page.
  4. Wire in permissions: Enforce the user's source-system permissions in the server; the service account's broad access must not pass to the user.
  5. Build a test set: Automate scenarios for correct results, unauthorised requests, missing records, oversized responses and documents containing instructions.
  6. Version and monitor: Version tool names and schemas, try changes on connected hosts, and track error and denied-request rates.

Common mistakes

  • Treating MCP as a security layer in itself; the protocol defines the connection, your deployment enforces permissions.
  • Building an MCP server for a single application and a single API, adding one more layer to maintain.
  • Requesting every scope on first connection and confronting users with broad consent screens.
  • Effectively giving every user the broad access of the server's service account.
  • Trusting a “read-only” annotation and removing the approval step.
  • Installing a local server from an unclear source without reviewing the command it will run.

Our AI agent development page explains how we define the tools agents use to reach internal systems narrowly and with clear permissions, and use MCP for those connections where it fits.

Key takeaways

  • MCP standardizes connections among an AI application, its clients, and tool or data servers; the host controls permissions.
  • Tools, resources, and prompts are distinct server capabilities. MCP does not verify the accuracy or access rights of returned data.
  • Use MCP when reusable integration across compatible hosts is valuable; a direct API call can be simpler for one application.
  • A server should accept only tokens issued for it and never pass a received token through to a downstream API.
  • Enforce authorization in the server, begin with read-only access, and test untrusted tool results before production.

Frequently asked questions

What is MCP used for?

It lets you write a data source or tool once as an MCP server and use it the same way from different AI applications that support the protocol. That reduces the need for a separate integration per application, although authentication, schemas and error handling are still your work.

What is the difference between an MCP server and an MCP client?

The server is the program that offers tools, resources and prompt templates. The client is the connection component the host application creates for each server, holding a one-to-one session with it. The model is not the client; the host decides what the model sees.

Is MCP the same as function calling?

No. Function calling is the model proposing a call to a function defined inside an application. MCP standardises defining such tools in a separate server and opening them to different applications that support the protocol; the model still calls the tool through the host.

Is MCP secure?

The protocol defines rules for authorization and security, but your deployment determines how secure it is. Servers running over HTTP need OAuth 2.1-based authorization, acceptance only of tokens issued for them, and user permission checks in the server. Tool annotations are not a security guarantee.

Should an MCP server run locally or remotely?

Local servers connected over stdio are common for single-user developer tools, with credentials taken from the environment. For team-wide use, an authenticated remote server reached over HTTP is a better fit. Before installing a local server, review the command it will run and start it with minimal privileges.

Do you need MCP for every integration?

No. If one application calls one internal API, a direct integration is simpler. MCP adds value when the same tool or data source will be used by several AI applications.

All articles