AI Coding Tools

What Is MCP? Connecting External Tools to Claude Code (2026)

Aug 14, 202612 min read

MCP (Model Context Protocol) is an open standard Anthropic announced in late 2024 that lets AI apps like Claude Code connect securely to outside tools and data - GitHub, databases, the filesystem, a browser, and more. Think of MCP as a "USB-C port for AI": instead of wiring up every tool pair by hand, you speak one shared protocol. That is what turns Claude Code from a chat window into an assistant that can read files, call APIs, and take real action on your system.

What is MCP? (Model Context Protocol)

MCP (Model Context Protocol) is an open standard that lets AI applications connect to external systems, tools, and data sources in one consistent way. Anthropic introduced the protocol in late 2024 and open-sourced it so anyone can build a compatible server (Anthropic, "Introducing the Model Context Protocol", Nov 25, 2024).

The easiest analogy: MCP is a USB-C port for AI. Before USB-C, every device needed its own cable. After USB-C, one port handles everything. MCP does the same thing for AI - a single connection standard in place of a pile of one-off integrations.

The problem MCP solves is the M x N problem. If you have M AI apps and N tools, the old way meant writing M x N separate integrations. With MCP, each tool needs just one MCP server, and each app only needs to "speak" MCP - so the math collapses to M + N. That is exactly why MCP spread so fast: write one MCP server for your database, and every MCP-capable app (Claude Code, Claude Desktop, and a growing list of IDEs) can use it right away.

In short, MCP is the standardized "connect AI to data" layer. In this guide we focus on how it works inside Claude Code - where you actually type commands and see results.

Which MCP? Model Context Protocol vs. the other meanings

A note on the acronym: "MCP" is overloaded. In this guide, MCP means Model Context Protocol - Anthropic's AI protocol from late 2024. It is NOT Microsoft Certified Professional (the certification), Master Control Program (the villain from Tron), or Multi-Chip Package (the chip-packaging term). If you came looking for one of those, this is not the article you want.

One more thing worth clarifying: a lot of MCP tutorials explain the protocol through Claude Desktop. This guide is specifically about MCP for Claude Code (the CLI) - where you connect servers from the command line and use them right inside your coding workflow.

Why does Claude Code need MCP?

By default, an AI model only knows what you paste into the chat window. It cannot read the files in your project on its own, it cannot reach your private GitHub repo, it cannot query a database, and it cannot open a browser. Everything outside the text you hand it is a blind spot.

MCP removes that blind spot. Once you attach an MCP server to Claude Code, the assistant can:

  • Read and write files outside your current working directory (Filesystem server).
  • Query a database so it answers with real data instead of guessing (Postgres/SQLite server).
  • Work with a repo: view issues, open PRs, read commit history (GitHub server).
  • Drive a browser: open pages, fill forms, take screenshots (Playwright server).
  • Look up current docs or search the web (Context7, Brave/Exa server).

This is the step that turns Claude Code from a chatbot that answers questions into an AI agent that takes real action: instead of just telling you "you should run a migration", it can query the schema itself, write the migration, and open a PR. MCP is the layer that lets that "connect to outside tools" behavior happen in a standardized, controlled way.

Here is an illustrative example (illustrative, not a logged benchmark) to show the difference. Without MCP: you ask "why is the /orders endpoint slow?", and Claude Code can only read the code you paste and guess from that. With MCP (Postgres server): Claude Code runs EXPLAIN ANALYZE on the real query, sees that the orders table is missing an index, proposes a concrete migration, and opens a PR through the GitHub server. Same question - but the answer moves from guesswork to evidence.

The key point: MCP does not add "intelligence" to the model - it adds senses and hands. The model reasons the same as before, but now it can see real data and act on real systems, within the permissions you grant.

How does MCP work? Host, Client, Server

The MCP architecture has three main roles. Understand these three and you understand the whole protocol.

  • Host - the AI app you use. Here that is Claude Code. The Host coordinates everything, decides which tool to call, and holds approval rights.
  • Client - lives inside the Host. Each client manages exactly one connection to one server. Attach 3 servers and the Host spins up 3 clients.
  • Server - an external program that provides capabilities. Each server exposes three kinds of things: tools (actions the AI can call, e.g. "create an issue"), resources (readable data, e.g. file contents), and prompts (ready-made prompt templates).

Mapped straight onto Claude Code: Claude Code is the Host, and each MCP server you add is an independent "connector". Want to work with GitHub? Attach the GitHub server. Need to query a database? Attach the Postgres server. The connectors do not know about each other; the Host is where it all comes together.

On the wire: MCP uses JSON-RPC for the Host and Server to talk. There are two main transports you will run into:

  • Local (stdio) - the server runs as a process on your machine and communicates over standard input/output. Good for the filesystem, a local database, tools that run on your personal machine.
  • Remote (HTTP/SSE) - the server runs at a remote endpoint. Good for cloud services and servers shared across a team.

A typical request flow: you give a command in Claude Code, the Host decides which tool is needed, the matching Client sends a JSON-RPC request to the Server, the Server executes and returns a result (plus resources if any), and the Host hands that result back to the model to compose an answer. Before a tool actually runs, the Host inserts your approval step - that is where you stay in control of every write or delete.

Connect your first MCP server to Claude Code (a real example)

Enough theory. This is the part you can type right now. Claude Code manages MCP servers with the claude mcp command. The syntax to add a server:

claude mcp add <name> <command to run the server> [args...]

Example 1 - add the Filesystem server so Claude Code can read and write a specific directory:

claude mcp add filesystem npx -y @modelcontextprotocol/server-filesystem /path/to/your-project

Example 2 - add the GitHub server (it needs a personal token via an environment variable, never hard-coded into the command):

claude mcp add github --env GITHUB_TOKEN=$GITHUB_TOKEN -- npx -y @modelcontextprotocol/server-github

After adding one, open a Claude Code session and type /mcp to see the connected servers and their status:

/mcp

One important point about being safe by design: the first time Claude Code wants to call a tool from an MCP server, it asks for your approval (human-in-the-loop). You see exactly which tool is about to run and with what arguments before you say yes. Do not click "approve" on autopilot.

On scope (where the config is saved), Claude Code lets you attach a server at the local level (your machine only), project level (shared in the repo through a config file), or user level (all of your projects) - pick the scope based on whether that server should be private or shared.

Once /mcp reports a server as connected, you can ask Claude Code to do work in plain language and it will pick the right tool - for example, "list the 5 most recently opened issues" gets it to call a tool from the GitHub server. If a server reports a connection error, the usual culprits are a wrong package path, a missing token environment variable, or a runtime that is not installed. Removing the server with claude mcp remove <name> and adding it again is the fast fix when the config went wrong.

If you want to go deep on one specific server, see the walkthrough on connecting the GitHub MCP server to Claude Code with an end-to-end PR example.

The MCP ecosystem is already huge. Here are the servers worth knowing first, with a hint on when to use each:

ServerWhat it doesWhen to use it
FilesystemRead/write files outside the current working directoryGive Claude Code access to docs or config in another folder
GitHubView/create issues and PRs, read repo history (official server ~28k stars, 04/2026)Automate review flows, open PRs, look up issues
Postgres / DatabaseQuery a database to answer with real dataDebug with actual data, inspect the schema, quick stats
PlaywrightDrive a browser: open pages, fill forms, take screenshotsE2E tests, UI checks, web automation
Context7Pull current library/framework docs into contextPrevent wrong answers from stale model knowledge
Brave / ExaWeb search directly in the sessionWhen you need info newer than the training cutoff
SlackRead/send messages in Slack channelsStatus reports, notifying the team

This list is just a starting point. To find more, directories like Glama or the awesome-mcp-servers repo on GitHub catalog hundreds of servers by category. For setup detail on a specific one, see the guide on connecting the GitHub MCP server to Claude Code.

How is MCP different from Skills, Subagents, and Hooks?

Newcomers mix up these four constantly because they all "extend" Claude Code. The quick distinction:

  • MCP = the layer that connects to external tools and data (GitHub, DB, browser).
  • Skills = packaged capabilities (instructions + scripts) that make Claude better at a class of task.
  • Subagents = specialized sub-agents that run their own task with their own context.
  • Hooks = event-triggered automation (for example, run the linter after a file is edited).

The simple line: MCP handles connecting outward, the other three handle how Claude works internally. See the full breakdown in how Skills, Subagents, Hooks, and MCP differ.

Risks and safety notes when using MCP

This is the part most tutorials skip, yet it matters most once you use MCP for real. MCP is powerful, and "powerful" means "handle with care".

  • Prompt injection through tools/resources: the content an MCP server returns (an issue, a web page, a file) can contain malicious instructions that push the AI to act against your intent. Do not assume everything a server hands back is safe.
  • Trusting third-party servers: an MCP server is code running on your machine or with access to your data. Only install from reputable sources (official, or open source you can verify), and read it before you attach it.
  • Keep the human in the loop: do not turn off the tool-approval step just for convenience. For any write or delete (writing a file, running a query, pushing a commit), review it first, then approve.
  • Do not hard-code secrets: pass tokens and API keys through environment variables, never inline in the command or committed to the repo.

A good habit: start with as few servers as possible, and give each server only the minimum scope it needs (for example, point Filesystem at the exact project folder, not your whole drive). For sensitive data, prefer a read-only account or token when all you need is to read.

To be blunt: MCP is not perfectly safe - safety depends on which servers you pick and how you grant permissions. Treat every server as software you are installing, not a harmless feature that is on by default.

Shortcut: MCP servers bundled in a kit

Configuring each MCP server by hand - finding the package, handling the token, choosing the scope, checking the connection - eats time if you need several. Some Claude Code kits ship a set of MCP integrations pre-built so you can skip the manual wiring. For instance, the Marketing Kit ships 12+ pre-built MCP integrations aimed at flows like lead gen and email/SEO. If you are curious, you can check AgentKit pricing (20% off via link) - the Marketing Kit is listed at $99, and the page does not mention a recurring fee.

Frequently asked questions (FAQ)

Is MCP free?

The MCP protocol itself is an open standard and free. Most popular MCP servers (Filesystem, GitHub, Postgres, and so on) are open source and free to use. Your only cost is on the service a server connects to (for example, the API plan of a cloud service).

How is MCP different from a regular API?

A regular API is a one-off integration for each app-to-service pair. MCP is a shared standard: write one MCP server and every MCP-capable app can use it, with no re-integration. Under the hood, an MCP server often still calls those APIs - MCP is the standardizing layer on top.

Where do MCP servers run - local or remote?

Both. A local server (stdio) runs as a process on your machine, good for the filesystem and a personal database. A remote server (HTTP/SSE) runs at a remote endpoint, good for cloud services and servers shared across a team.

Do I need to know how to code to install an MCP server?

Not to use one. For ready-made servers, you just run a single claude mcp add command and you are done. You only need to code if you want to build a new MCP server yourself.

Is MCP safe?

Safety depends on which servers you pick and the permissions you grant. The main risks are prompt injection and untrustworthy third-party servers. Only install from reputable sources, keep the tool-approval step on, and do not hard-code secrets. MCP is not perfectly safe.

How many MCP servers does Claude Code support?

There is no publicly stated hard limit - you can attach many servers at once, each as its own client. In practice, keep the count to what you need so the session stays lean and permissions stay easy to control.

Conclusion and next steps

MCP is the open standard that turns Claude Code from a chat assistant into an AI agent that connects to the real world: files, databases, GitHub, the browser. You now know the definition, the Host-Client-Server architecture, how to run claude mcp add, and the risks to watch for. The most natural next step is to practice: open a terminal and try claude mcp add with one server. Then read connecting the GitHub MCP server to Claude Code to build an end-to-end flow, and how Skills, Subagents, Hooks, and MCP differ to pick the right tool for each job.

· Reference sources: modelcontextprotocol.io (docs, 2026-07-28 build) and Anthropic - Introducing MCP (Nov 25, 2024).

J

Jasmine

Author · Jasmine Daily

The writer behind Jasmine Daily - jotting down thoughts, experiences, and everyday moments. Honest, unhurried, imperfect.

Jasmine Daily

There's more waiting to be read.

If this piece spoke to you, browse a few more pages from the journal.

Read next

Related posts