Claude Code MCP: How to Add and Use MCP Servers

Claude Code MCP is the Model Context Protocol support built into the Claude Code CLI. It lets the agent discover and call external tools through one standard interface instead of a bespoke integration per tool.
You add a server with claude mcp add, point it at an executable, and the agent lists that server's tools at startup. It then calls them by name when it needs them.
Most MCP writeups stay abstract. The useful version is concrete: a server advertises named tools, Claude Code discovers them, and the model decides when to use one.
What is Claude Code MCP and why should you care?
Claude Code is an agent that already reads files, runs commands, and edits your repo. MCP is how you extend that reach to things outside the working directory without writing model-specific code.
Before MCP, every integration was a one-off. If you wanted the agent to query Postgres, read Linear, or see your screen, someone wrote a Claude-specific adapter for each.
Claude Code MCP removes that N-by-M glue problem by standardizing the contract between the agent and any tool.
A server exposes three kinds of capability.
Tools
Functions the model calls, with typed arguments. In practice this is what you reach for most.
Resources
Readable data pulled in as context.
Prompts
Reusable templates the client can surface.
MCP standardizes the contract, not the intelligence. The server says "here are my tools and their argument schemas"; the model decides which to call and with what values. That split is why one server works across Claude Code, Cursor, and other clients.
The payoff is compounding. Every well-built server you add is a new capability the agent can use forever.
The same server works in any MCP client, so nothing is wasted if you switch tools later.
How do you add an MCP server to Claude Code?
The core command is short. From your project you run:
claude mcp add --scope user pinvari -- "$HOME/.pinvari/mcp/pinvari-mcp"
Never write the bare claude mcp add pinvari. It errors.
The scope and the path to the connector are required.
That registers the server and its startup command. Servers can be scoped to a project or made available across all your projects.
Claude Code reads both at launch.
Once added, verify it. Inside Claude Code, ask what tools are available or run the MCP status view.
The server should appear with its tools listed.
The lifecycle under the hood is plain JSON-RPC. Claude Code launches the server, sends initialize, the server returns its capabilities, and the client calls tools/list.
During a session the model chooses a tool, the client sends tools/call, and the server does the work and returns a structured result.
Run a new server by hand once before wiring it into Claude Code. If it starts and prints its capabilities in your terminal, any later failure is almost always the config path, not the code.
You are not teaching the model a new API. You are giving it a menu it discovers automatically.
You can also connect with one click inside PinVari (PinVari → Connect → Claude Code). The app must be installed and running; the connector talks to it on 127.0.0.1:3402.
What can a local MCP server actually do on a Mac?
Here is the concrete example the docs skip. A local MCP server runs on 127.0.0.1, so it can reach things a hosted tool never could, like the live state of your screen.
It can do it without uploading anything.
PinVari is a native macOS server of exactly this kind. You hold ⌥⌘A, circle or point at a UI element, and speak.
It screenshots, transcribes on-device, and resolves the exact accessibility element you circled — role, label, and frame — with a confidence score. Then it exposes that to Claude Code as a tool.
The agent-facing tool is pinvari_next_instruction. It returns the resolved element path, the spoken instruction, the region you circled, and a screenshot cropped to that region.
pinvari_mark_done closes it out. The agent receives a named element it can act on, not a screenshot it has to decode.
Mid-task the agent can also call pinvari_request_capture. The notch island lights up asking you to point; the capture flows back automatically.
That is the general lesson for any good MCP server. It should not just relay raw data; it should resolve meaning on your side and hand the agent something already structured.
A screenshot server ships pixels. A context server ships a named element the agent can trust.
The fuller argument is in how a local MCP server gives an agent screen context and why screenshots are the wrong primitive for telling an agent what you mean.
The resolution is honest about hard cases. When a point lands on a bare AXGroup, it descends to the deepest labeled child.
On Chromium and Electron surfaces that build their accessibility tree lazily, it sets AXManualAccessibility and retries until a labeled node appears. On a canvas with no AX tree, it falls back to on-device Vision OCR.
Below a confidence bar, it asks rather than guessing silently.
Everything in that flow stays on-device. Transcription and OCR use Apple frameworks, there are no API keys, and nothing is uploaded by default.
You bring your own agent and model.
Claude Code MCP vs Cursor MCP: what is different?
Both support MCP, and a server you build works in either. The differences are in the client, not the protocol.
Claude Code
Form factor: terminal CLI.
Add a server: claude mcp add --scope user ….
Best fit: terminal-first work and scripting.
Cursor
Form factor: AI-native editor.
Add a server: JSON config in settings.
Best fit: editor-first workflow.
Transport is stdio or HTTP in both. Scope is project or global in both.
Because the protocol is shared, the choice is about how you like to work, not about which servers you can run. The same PinVari server, the same git server, the same database server all plug into either.
If you are weighing the two more broadly, the Claude Code vs Cursor trade-offs come down to terminal versus editor more than raw capability.
The practical upshot: pick your client for ergonomics, and treat your MCP servers as portable infrastructure that follows you across tools.
If your team standardizes on a shared set of servers, everyone gets the same capabilities whether they run Claude Code in a terminal or Cursor in an editor.
Onboarding a new machine is one config file rather than a day of setup.
Why is my MCP server not showing up in Claude Code?
Nine times out of ten it is the config, not the code. The server points at the wrong executable, the command does not actually start, or the JSON has a typo that silently drops the entry.
Work through it in order.
Confirm the server runs standalone in your terminal. Confirm the path in your config is absolute and correct.
Restart Claude Code so it re-reads the config.
Then check the MCP status view to see whether the server connected and whether it errored on initialize.
A server that appears but lists zero tools usually failed after initialize but before advertising its tools. Read its stderr. On lazy surfaces or slow startups, a timeout can cut the handshake short before tools register.
Most fixes are a corrected path or a restart, not a code change.
If a screen-context server is the piece you are missing on a Mac, PinVari is a one-time purchase rather than a subscription. Setup and details are on the pricing page.
Public MCP docs live at pinvari.com/mcp. Connect instructions for every agent sit at pinvari.com/connect.
FAQ
What does MCP stand for in Claude Code?
MCP stands for Model Context Protocol, an open standard for connecting an AI agent to external tools and data through one uniform interface. Claude Code acts as the MCP client, discovering and calling tools that MCP servers expose.
How do I add an MCP server to Claude Code?
Run claude mcp add --scope user <name> -- <command> and point it at the server's startup command. Restart Claude Code, then confirm the server and its tools appear in the MCP status view before using it.
Is Claude Code MCP the same as Cursor MCP?
The protocol is identical, so a server built for one works in the other. The difference is the client: Claude Code is a terminal CLI configured with claude mcp add, while Cursor is an editor configured through its settings JSON.
Can an MCP server run locally without an internet connection?
Yes. A local MCP server runs on 127.0.0.1 as a child process over stdio, so it never needs the network.
On a Mac, a local server can gather screen context, transcription, and OCR entirely on-device.
Why does Claude Code say my MCP server failed to connect?
Usually the config points at the wrong executable, the server crashes on startup, or the handshake times out. Run the server by hand first, use an absolute path in the config, restart Claude Code, and read the server's stderr to see where initialize stopped.
Do I need an API key to use Claude Code MCP?
Not for the protocol itself. Some servers wrap paid APIs and need their own keys, but a local server like a filesystem or screen-context server runs entirely on your machine with no key and no upload.
Hand your agent the exact element
PinVari resolves what you point at into a named, executable instruction — on-device, no keys, your own agent. One click inside PinVari connects Claude Code, Cursor, VS Code or Codex — or paste one CLI line from pinvari.com/connect.
PinVari → Connect → your agent (one click)Get PinVari — $39 →


