How Claude Code worksPart 4
MCP servers and plugins
On this page
In short: Your colleague often needs things from other departments: the ticket from the planning team, the numbers from the database, a look at the live website. An MCP server is a phone line to one of those departments. Use what they say to find things, then check for yourself. A plugin is a ready-packed toolbox: your recipe cards, alarms, specialists and phone lines in one box, so any new project can be set up the same way in one go.
Part 3 covered steering your colleague inside a project. This part is about reaching outside it, and packing up what works so you can take it anywhere.
This series is building towards one thing: a setup that works the way you work, on any project. Each part adds a piece, and ends with a checklist of what you have so far. The project in the examples, the Acme storefront, is made up.
MCP: phone lines to other departments
Think of it like this: Each phone line reaches one department, and each department can do a few things for you. The ticket desk can read out a ticket. The records room can look something up. You only install the lines you actually call.
MCP is a common standard for these lines. An MCP server offers Claude a few tools in another system, such as “get this ticket” or “run this read-only query”. Claude calls them when a task needs them.
Some lines are remote: the department is a service on the internet, and you often sign in once. Some are local: a small program on your own computer.
- File
.mcp.jsonat the project root- Who
- Everyone on the repo
- Note
- Claude Code asks before using these the first time
- File
~/.claude.json- Who
- Only you, in this project
- Note
- For a server you are trying out
- File
~/.claude.json- Who
- Only you, everywhere
- Note
- For tools you use in every repo
Important: Only connect lines you trust. A line that reads things anyone can write, like public web pages or tickets, can carry hidden instructions aimed at Claude. This is called prompt injection. Give lines read-only access where you can, and make Claude ask before anything that writes.
Under the hood: adding and limiting servers
- Remote servers use HTTP, the recommended kind for hosted services. Local ones use stdio and run as a process on your machine.
- Add one with
claude mcp add. The scope decides who gets it: local (just you, this project, the default), project (shared in.mcp.json) or user (just you, every project). - Claude Code asks before it uses a project’s servers for the first time. Run
/mcpto see status, sign in or sign out. - In
.mcp.json, write secrets as${VAR}so each person’s own environment fills them in. - In permission rules, a server’s tool is named
mcp__<server>__<tool>. Put write tools underask. - Claude Code warns when one tool result passes 10,000 tokens and cuts results off at 25,000 by default. With tool search, which is on by default, Claude looks up the tools it needs instead of keeping every server’s full list in mind.
Use it, but check the street sign
Think of it like this: A colleague gives you directions from memory. Helpful, but the shop may have moved. You follow the directions, then check the street sign before you walk in.
A tool’s answer can be a guess or out of date. A map of your code may name the file a function lived in last month. So let the tool narrow the search, then have Claude read the real file before it changes anything.
- Claude needs live data from another system: a ticket, an error report, a query result.
- A tool answers a question far faster than reading files, such as "what calls this?"
- Claude has to act somewhere else, such as open a page in a browser.
- You do not know who runs it. A server that fetches outside content can carry prompt injection.
- It can write to something important. Start read-only, and put write tools under "ask".
- You will rarely use it. Every server adds to setup and to what Claude has to choose from.
Plugins: a ready-packed toolbox
Think of it like this: Instead of handing each new colleague the fridge rules, the recipe cards, the alarms and the phone list one by one, you hand them one packed toolbox.
A plugin bundles skills, subagents, hooks and MCP servers into one folder that installs as one unit. Its skills carry its name, like /acme-kit:plan-ticket, so two toolboxes never mix up their tools.
Plugins come from marketplaces, which work like an app store: a list of toolboxes and where to get each one. Anthropic’s official one is added for you. Others you add yourself, and you can pin a version so it does not change under you.
Remember: A toolbox you switch on comes to every session, not just the ones where you use it. Its tools take up a little attention every time, and its scripts run as you. Pack it with care, and switch off what you stop using.
- Read the source, not the install count: its skills, hooks and servers run as you.
- Prefer narrow plugins that fill one gap over whole methods that compete with yours.
- Pin the marketplace to a tag, and update on purpose.
- Check its cost:
claude plugin details <name>shows what it adds to every turn.
- Hooks that also steer your own reviewers or subagents.
- Plugins that install more plugins in the middle of a task.
- Plugins you no longer use. The Not used recently list in
/pluginshows them; turn them off.
Under the hood: plugin files and commands
- A plugin is a folder with a manifest at
.claude-plugin/plugin.json, plus any ofskills/,agents/,hooks/hooks.jsonand.mcp.json. - Add a marketplace with
/plugin marketplace add owner/repo; a#tagon the end pins a version. Install with/plugin install name@marketplace. - Scopes: user (
~/.claude/settings.json), project (.claude/settings.json, committed; each teammate still installs once) and local (.claude/settings.local.json). - Third-party marketplaces do not auto-update by default.
claude plugin details <name>shows what a plugin adds to every session. The Not used recently list in/pluginhelps you find ones to switch off.
The spec-driven thread
Think of it like this: A good colleague works from the written brief, not from what someone half-remembers from a meeting.
This series is heading towards a way of working where a written spec is the source of truth. This part adds two pieces of it:
- The brief comes in through a phone line. Claude reads the ticket and its acceptance criteria from your tracker before it plans.
- The method goes out as a toolbox. Once your planning steps, reviewers and alarms work in one project, a plugin gives every project the same ones.
From Part 7, the spec moves to the centre: how to write one, plan from it, build against it and prove the result.
One project, set up step by step
- 1 · Connect the tracker for the whole team
One command writes the server into
.mcp.json. The token comes from each person's environment, never from the file.claude mcp add --transport http --scope project tracker https://tracker.example.com/mcp
{ "mcpServers": { "tracker": { "type": "http", "url": "https://tracker.example.com/mcp", "headers": { "Authorization": "Bearer ${TRACKER_TOKEN}" } } } } - 2 · Approve it, sign in, and limit it
The first time, Claude Code asks before using a project's servers.
/mcpshows status and handles sign-in. Writes to the tracker ask first."permissions": { "allow": ["mcp__tracker__get_issue", "mcp__tracker__list_comments"], "ask": ["mcp__tracker__create_issue", "mcp__tracker__update_issue"] } - 3 · Start from the ticket, not from memory
The spec comes in through the server, so the plan is built on the real acceptance criteria.
Read ticket ACME-142 and its comments. List the acceptance criteria, then plan. Don't write code yet.
- 4 · Add a code graph, and verify what it says
A local server answers "what does this change touch?" Claude uses it to find files, then reads them before editing.
claude mcp add --transport stdio --scope project codegraph -- npx -y example-codegraph-mcp ./graph.json
- 5 · Package the setup as a plugin
The team's skills, reviewer, hooks and servers go into one folder with a manifest.
// acme-kit/.claude-plugin/plugin.json { "name": "acme-kit", "version": "1.0.0", "description": "Acme storefront: plan from tickets, review against the spec" } - 6 · Share it through a team marketplace
Add the marketplace pinned to a tag, install at project scope, and commit the settings change. Each teammate runs the install once.
/plugin marketplace add acme/claude-plugins#v1.0.0 /plugin install acme-kit@acme-plugins
- 7 · Any repo, the same way of working
A new project gets the kit in one install: the same planning skill, the same reviewer, the same guards. That is the start of the twin this series is building.
Which one fits?
- Claude needs data from another system: An MCP serverTickets, errors, a database, a browser. Add it with
claude mcp add; share it in.mcp.json. Start read-only. - We repeat the same procedure: A skillSteps Claude follows when a request matches. No new system involved, so no server needed (Part 3).
- The whole team should get our setup: A pluginBundle the skills, subagents, hooks and servers, publish it in a marketplace, pin a version, install at project scope.
- A server's tool must never write: A permission ruleName the tool as
mcp__server__toolindenyorask. Better still, give the server read-only credentials. - A plugin looks useful but unknown: Read it firstOpen its details in
/plugin, read its hooks and servers, check its context cost, and try it at local scope before the team gets it. - It is just for me: Local or user scopeAdd the server or install the plugin for yourself only. Nothing goes into the shared files until it has earned its place.
Under the hood: the full comparison
| MCP server | Skill | Plugin | |
|---|---|---|---|
| Everyday picture | A phone line to a department | A recipe card | A packed toolbox |
| What it adds | Tools in another system | Steps Claude follows | A bundle of skills, subagents, hooks and servers |
| Where it lives | .mcp.json or ~/.claude.json | .claude/skills/ | A marketplace, installed into your settings |
| Costs context | Tools are looked up when needed | Description every turn, steps when used | What its parts cost, every session it is on |
| Runs code on your machine | Local servers do | Only through the tools it uses | Yes: hooks and servers run as you |
Your setup so far
- Part 1 · where it runsYou know which machine does what, and which folders Claude can reach.
- Part 2 · what it remembersOne task per session; forks in their own worktree; subagents for noisy side jobs.
- Part 3 · how it behavesCLAUDE.md for what is always true, skills for procedures, hooks for musts, subagents for checks.
- Part 4 · what it can reachMCP servers for your tracker and tools, verified before trusted; your setup packaged as one plugin.
- Next · Part 5Permissions and safety: what the twin may do without asking, and what it must never do.
Three rules of thumb
An MCP server opens one door to one system. Open the ones you use, and start them read-only.
A tool's answer narrows the search. The file Claude reads is the truth it edits against.
When a setup proves itself in one repo, make it a plugin, pin it, and give every repo the same way of working.
QuizA code map tells Claude that applyDiscount() is in billing/discount.ts. What should Claude do before editing?
Show the answer
Answer: Search for the function and read the file it is really in
The map gives directions; the file is the street sign. Reading the actual file is what makes the edit safe.
Words in this post:
- MCP: a common standard for connecting AI tools to other software.
- MCP server: one connection that gives Claude a few tools in another system.
- Prompt injection: hidden instructions in content Claude reads, trying to steer it.
- Plugin: a folder of skills, subagents, hooks and servers installed as one unit.
- Marketplace: a list of plugins and where to get each one.
Facts here were checked against the Claude Code documentation on MCP, plugins and installing plugins in November 2026. These features change often, so the docs are the final word for your version.
Next, Part 5: Permissions and safety covers which keys your colleague gets, and which doors stay locked.
Setting up Claude Code or AI agents for your team?
I help teams build this: agents, RAG search and Claude Code setups that hold up in production.
Series
How Claude Code works
- How Claude Code worksWhere Claude runs
- How Claude Code worksSessions and forks
- How Claude Code worksSkills, hooks and subagents
- How Claude Code worksMCP servers and pluginsyou are here
- How Claude Code worksPermissions and safety
- How Claude Code worksContext and cost
- How Claude Code worksSpecs as the source of truth
- How Claude Code worksContract first
- How Claude Code worksVerify against the spec
- How Claude Code worksHandoffs and memory
- How Claude Code worksYour setup as a kit
- How Claude Code worksRolling it out