Get the free coreGet core

What is an MCP server? A plain explanation for developers

Updated 5 min readSection 05 / Threats
SHORT ANSWER

An MCP server is a program that gives an AI agent extra abilities, such as database servers for data queries or calendar servers for scheduling. MCP stands for Model Context Protocol, an open-source standard for connecting AI applications to external systems. A local one is code downloaded and run on your own machine, so check who wrote it before you add it. The checklist is on MCP security, and the commands for Claude Code are on Claude Code MCP.

You  ->  Agent (Claude Code, Cursor, Codex)
              |
              |  speaks MCP
              v
         MCP server  (a program that exposes capabilities)
              |
              v
         Tools  (actions the agent can call: query a database, send a message)

01What is an MCP server, in plain words

An AI agent such as Claude Code, Cursor or Codex can write code, but to reach your calendar, your database or your ticket tracker it needs a connection to them. MCP is the shared plug for that: with it, agents can access your Google Calendar and Notion, and the official introduction compares it to a USB-C port: one connector shape, many devices.

The device on the other end of the plug is the MCP server. It is a program that exposes specific capabilities to AI applications through a standard interface. Servers offer three kinds of building blocks, and the one that matters most here is the tool: a function the model can call when it decides it helps with your request, such as "create a ticket". Every tool comes with a written description, and the model sees all of it, while you usually see a simplified version.

02How a request travels

A normal call goes through four steps:

  1. You add the tool to your agent with a line of configuration. For a local one that line is a command the agent will run.
  2. The agent starts it or contacts it and asks for the list of available tools with their descriptions.
  3. While working on your task, the model decides that one of the tools helps and asks to call it.
  4. The agent asks you for approval, depending on its settings. In Cursor, every MCP connection needs your approval, and each tool call needs its own approval before it runs. Claude Code asks before it uses a server defined in a project's .mcp.json file, but only in interactive sessions: in non-interactive runs and Agent SDK sessions it loads project servers without asking.

The description of each tool is plain text, and the model reads even the parts you never see on screen. The result of a call goes back to the model, which continues the task. That returned text is new input for the model, and servers that fetch outside content can expose you to prompt injection: text an attacker plants so the model treats it as an order. The basics are on prompt injection.

03Local and remote servers

They come in two kinds, and the difference decides what can go wrong.

LocalRemote
Where it runsOn your Mac, as a program started next to the agentAt a web address (a URL) you connect to
What you addA launch command the agent runsA URL
Main riskThe program runs with the same privileges as your agent, and an attacker can run any command with themA tool that fetches outside content can expose you to a planted instruction

For a local one, "adding a server" means "agreeing to run a program". The MCP specification names the attack where someone slips a malicious start command into the agent's configuration. It also advises authors of local servers to use stdio, a plain connection between two programs on the same machine, which limits access to just your agent. The exact add commands are on Claude Code MCP.

04Where the settings live

The configuration is a list of servers plus the command or address for each. Claude Code keeps it in one of three places, called scopes:

ScopeCoversShared with othersStored in
Local (the default)The current projectNo~/.claude.json
ProjectThe current projectYes, through version control.mcp.json in the project root
UserAll your projectsNo~/.claude.json

In Claude Code these are the three scopes. The add commands write to the local scope unless you add --scope project or --scope user, so a server you add without thinking about it stays private to you and to that one project. A project server is the one that travels with the repository, and a cloned repository cannot approve its own servers. In a Cursor workspace the MCP file is .cursor/mcp.json. Reading .mcp.json alone does not show every server a session can load.

05Why a server is code you run, not a plugin you browse

It is easy to think of servers as browser extensions with a review process. For Claude Code that picture is wrong in one way: Anthropic reviews connectors against listing criteria before adding them to its directory, but does not security-audit or manage any MCP server. The docs ask you to verify that you trust each one before connecting it.

The sandbox, which is Claude Code's fence around shell commands, does not change this: MCP servers run outside it. Details are on Claude Code sandbox.

06Before you add your first server

Three questions are enough to start, and they take a minute per server:

Add one at a time and try it on a throwaway project first. A longer list, with what to do for each answer, is on MCP security. A real case of a server changed after people trusted it is on MCP tool poisoning. If you want to know when a new MCP server or agent session appears on your Mac, the free, open-source core of Artificial Immunity watches them and reports what it finds.

07The short version

An MCP server is a program that gives your agent tools. The plug is standard, but what sits on the other end is code you chose to run. Add them one at a time, read the launch command, and go through the MCP security checklist before the next one.

FAQ

What does MCP stand for?

MCP stands for Model Context Protocol, an open-source standard for connecting AI applications to external systems.

Can you explain MCP for dummies?

Think of it as a USB-C port for AI applications: just as USB-C is a standard way to connect devices, MCP is a standard way to connect AI applications to external systems, and what a server offers is a set of capabilities, mainly tools the model can call.

What is the difference between a local and a remote MCP server?

A local one runs on your machine and a remote one sits at a web address. In Claude Code, a URL in the command means the server is remote, and a launch command means it runs on your machine.

Is a local MCP server safe to run?

Treat it like any program you download. A local server is a program downloaded and executed on the same machine as your agent, and it can run arbitrary code with your agent's privileges.

Where does Claude Code store MCP server settings?

By default in ~/.claude.json, for the current project only. Servers shared with a team live in a .mcp.json file in the project root, and servers for all your projects go in ~/.claude.json as well.

Sources

  1. MCP: getting started
  2. MCP: server concepts
  3. MCP specification: security best practices
  4. Claude Code docs: MCP
  5. Claude Code docs: security
  6. Claude Code docs: sandboxing
  7. Cursor docs: agent security
  8. NVD: CVE-2025-54135
  9. Invariant Labs: tool poisoning attacks
  10. Artificial Immunity
Agents load MCP servers you may never have read. Artificial Immunity watches the Mac where your agents work.Get the free core