Skip to content
PrepMint

Claude Code

MCP Integration in Claude Code

MCP servers and tool integration in Claude Code

50 questions
Easy· 20Medium· 20Hard· 10

Last reviewed

Recommended

MCP Integration in Claude Code — Timed Test 5 (10 questions)

TimedEasy10 questions · 10 min
Start test

No account needed. Answers and explanations arrive when you submit.

What this topic tests

The mix every MCP Integration in Claude Code set is built to, and the questions published against it so far. Nothing here is hidden before you start.

MCP Integration in Claude Code — target difficulty mix and published question count per level
LevelTarget sharePublished
Easy40%20
Medium40%20
Hard20%10
Total50

MCP Integration in Claude Code — the theory

What Connecting A Server Actually Changes

Connect a server when you keep pasting data into chat from a system Claude cannot see. What MCP is as a standard is a separate subject.

The transport is mostly chosen for you. HTTP servers are the recommended option for connecting to remote MCP servers, stdio servers run as local processes on your machine and are what local access needs, and the SSE (Server-Sent Events) transport is deprecated.

Two details cost people an afternoon each. A JSON entry that has a url but no type is a configuration error, because Claude Code reads an entry with no type as a stdio server — so a config copied from another client's documentation fails complaining about a missing command. On the command line the trap is the separator, because everything after -- is passed to the server untouched; leave it out and Claude Code reads the server's own flags as its own.

Three Scopes, Two Files, One Winner

Local scope is the default. A local-scoped server loads only in the project where you added it and stays private to you. User scope is the same privacy with a wider reach, across every project on the machine. Project scope is the shared one: project-scoped servers enable team collaboration by storing configurations in a .mcp.json file at your project's root directorycheck .mcp.json into version control so everyone on your team gets the same MCP tools and services.

Scope is not editable: a server's scope is fixed when you add it, so changing scope means removing the entry and re-adding it at the new one. On a collision, when the same server is defined in more than one place, Claude Code connects to it once, using the definition from the highest-precedence source — local, then project, then user. Crucially, the entire server entry from that source is used; fields are not merged across scopes. You do not get your local URL with the project's headers. You get one entry, whole.

A missing-server report is usually a scope report. Local-scoped servers are tied to the project where you added them: the repository root, or the exact directory if you weren't in a git repository.

The Approval Is A Security Boundary, Not A Formality

For security reasons, Claude Code prompts for approval in interactive sessions before using project-scoped servers from .mcp.json files. The reason is worth stating plainly, because it changes how you read a pull request: the prompt exists so a repository you clone can't launch processes on your machine without your consent.

The boundary is interactive-only, though. claude -p runs, Agent SDK sessions, and cloud sessions can't show that prompt: Claude Code loads project-scoped servers there without asking. The blunt instrument still works everywhere: a disabledMcpjsonServers entry in any settings file still rejects the server.

What The Tool Surface Costs

Each connected server takes some space in Claude's context window because its tool names and server instructions load into every session. That is no longer the whole story: tool search keeps MCP context usage low by deferring tool definitions until Claude needs them, and only tool names and server instructions load at session start, so adding more MCP servers has minimal impact on your context window. Tool search is enabled by default.

You can opt a server out of deferral, but pay knowingly: use this for a small number of tools that Claude needs on every turn, since each upfront tool consumes context that would otherwise be available for your conversation.

Output is capped separately: Claude Code displays a warning when any MCP tool output exceeds 10,000 tokens and the default maximum is 25,000 tokens. Sometimes the answer is not MCP at all — tools like gh, aws, gcloud, and sentry-cli are still more context-efficient than MCP servers because they don't add any per-tool listing.

Signing In, And What Happens When A Server Wobbles

Claude Code marks a remote server as needing authentication when the server responds with 401 Unauthorized or 403 Forbidden. After that, a stale token is handled for you: when a request to an OAuth server you already signed in to returns 401 Unauthorized, Claude Code refreshes the stored token, reconnects, and retries the request once. Two limits matter before you script anything. Automation cannot sign in — in non-interactive mode there's no /mcp panel, so Claude Code can't run the OAuth flow for you — and a hand-supplied header has no fallback: if you configured headers.Authorization for the server and the server rejects that header, Claude Code reports the connection as failed instead of falling back to OAuth.

Drops are handled unevenly, deliberately. If an HTTP or SSE server disconnects mid-session, Claude Code automatically reconnects with exponential backoff: up to five attempts, starting at a one-second delay and doubling each time. Local ones are not — stdio servers are local processes and are not reconnected automatically. And a slow call does not freeze the session: an MCP tool call in the main conversation that is still running after two minutes moves to a background task instead of blocking the session.

Permissions, And The Two Rules You Cannot Override

MCP tools obey the same permission system as everything else, named by server and optionally by tool: mcp__puppeteer matches any tool provided by the puppeteer server. Allow rules are stricter than deny rules about wildcards: the server segment must be glob-free so the rule names a specific server you configured. A blanket allow across every server is refused by design.

Two things beat your rules. A server author can mark a tool as always needing a person, and then Claude Code shows that tool's permission prompt on every call, even in acceptEdits, auto, and bypassPermissions permission modes, and doesn't offer a "don't ask again" option for it. Your organisation can do the same to a connector tool: Claude Code prompts on every call with the reason Your organization requires approval for this tool, or, one step further, Claude Code filters the tool out before Claude sees it, so it never appears in the tool list.

When It Breaks, Read The Status Before Anything Else

Start by disbelieving the confirmation. The Added confirmation means the entry was saved, not that the command runs. Then read claude mcp list, remembering that a failure status means Claude Code couldn't connect to that server, not that the list command failed.

Four symptoms cover most reports. Connected with no tools: if the list is empty, the server started but didn't register any tools, which usually means it's missing a required environment variable such as an API key. A stdio server that will not start: relative file paths in command or args are a frequent cause, since they resolve against the directory you launched Claude Code from rather than the location of .mcp.json. And an authentication failure right after pasting a token, where Claude Code flags config values with hidden leading or trailing whitespace but doesn't trim the whitespace and uses the values exactly as written.

One more, because it wastes whole mornings: Claude Code reads .mcp.json at session start, so an edit without a restart changes nothing.

The Trust You Extend

Verify you trust each server before connecting it. The publisher's own boundary is explicit: Anthropic reviews connectors against its listing criteria before adding them to the Anthropic Directory, but does not security-audit or manage any MCP server. A directory listing is a review of the submission, not of the code.

For teams the default is permissive — by default, anyone running Claude Code can connect any MCP server they choose — and the fix is administrative. Two rules matter most. Nothing overrides a denylist match. And the obvious lever is the weak one: a serverName entry, in either list, is not a security control, because the name is whatever the user typed.

Where to Go Next

MCP Fundamentals covers the protocol this page configures — what a server is, what it exposes, and why the standard exists — rather than Claude Code's particular way of loading one. Claude Code Basics is the permission system, the agentic loop and the session model that MCP tools plug into. And Cursor Basics shows the same protocol wired into a different client, which is the fastest way to see which parts of this page are MCP and which are Claude Code.

Sample questions

Three questions from this topic, with the answer and the reasoning shown.

Q1EasyA connector appears in Anthropic's Directory. What does that listing tell you about the server behind it?
  • That the server's code has been audited, since that is what a review before listing normally involves.
  • That no further trust decision is needed from you, because the review has already made that judgement.
  • That Anthropic operates the server, so the usual questions about a third party do not really apply.
  • That it met listing criteria on review, not that its code has been audited for security.Correct

Explanation

The principle — A listing tells you that something passed the check that was actually performed, which is rarely the check you were hoping for.

Why the key is correct — Anthropic reviews connectors against its listing criteria before adding them to the Directory, but does not security-audit or manage any MCP server. The instruction to the user is unchanged: verify you trust each server before connecting it.

Why the others are wrong — No code audit is implied. The trust decision remains yours, because only you know what is at stake. And Anthropic lists these servers rather than operating them.

Remember this — Listed means reviewed for listing, not audited for safety.

Sources — Anthropic's Claude Code security page and MCP reference.

Open this question on its own page

Q2EasyA permission rule names an MCP server and nothing after it. Which of that server's tools does the rule cover?
  • None of them, because a rule has to name each tool individually before it covers anything.
  • All of them, because naming the server alone matches every tool it provides.Correct
  • None of them, because naming a server on its own denies its tools rather than matching them.
  • Only the ones whose names match the vendor's own naming, rather than the label you gave the server.

Explanation

The principle — An MCP permission rule is built from two parts, the server and optionally a tool, and leaving the second part off widens the rule rather than breaking it.

Why the key is correct — MCP rules use the server name as configured in Claude Code, optionally followed by the name of a tool from that server. A rule naming only the server matches any tool that server provides.

Why the others are wrong — Individual tools do not have to be listed. A bare server name matches rather than denies; the list the rule sits in decides that. And the name used is your own label, not the vendor's.

Remember this — Server alone means every tool from that server.

Sources — Anthropic's Claude Code permissions reference.

Open this question on its own page

Q3EasyA remote MCP server drops in the middle of a session. What does Claude Code do about it?
  • It leaves the server down and waits for you to reconnect it yourself from the MCP panel.
  • It reconnects on its own, up to five attempts, with the delay doubling each time.Correct
  • It keeps trying indefinitely, on the reasoning that the connection should be restored whenever it can be.
  • It retries at a steady interval, because a fixed gap between attempts is simpler and more predictable.

Explanation

The principle — Transient drops should heal themselves, but not forever, and not at a pace that makes a struggling server worse.

Why the key is correct — If an HTTP or SSE server disconnects mid-session, Claude Code automatically reconnects with exponential backoff: up to five attempts, starting at a one-second delay and doubling each time. After that the server is marked failed and you can retry it yourself.

Why the others are wrong — Manual reconnection is the fallback rather than the first response. The attempts are bounded rather than endless. And the delay widens instead of staying fixed.

Remember this — Five attempts, each waiting twice as long as the last.

Sources — Anthropic's Claude Code MCP reference.

Open this question on its own page

Practise all 50 questions

Every published question in MCP Integration in Claude Code, with its answer and explanation.

Frequently asked

What people ask about mcp integration in claude code.

I added a server and claude mcp list says it failed. What do I check first?
Read the status, not the add confirmation — the confirmation only means the entry was written to disk. For an HTTP server, check the URL is reachable from your machine; a 404 or 405 still proves it is up, because many MCP endpoints answer only POST. For a stdio server, run the configured command yourself in a terminal. If it starts and waits for input, the server is fine and the problem is in your entry, most often a missing -- separator or a relative path.
Why does my teammate see the MCP server and I do not?
Almost certainly scope. The default is local scope, which ties the server to the project you were in when you added it, and stores it in ~/.claude.json rather than in the repository. To share one, add it at project scope so it lands in .mcp.json at the project root, then commit that file. Scope is fixed at add time, so switching means removing the entry and re-adding it.
Claude Code keeps asking me to approve a server that is committed to our repository. Why?
That prompt is the point. It exists so cloning a repository cannot launch processes on your machine without your consent, and a repository is not allowed to approve its own servers — an approval committed to the project's settings is ignored until you trust the workspace. Note that the prompt is interactive-only: claude -p, Agent SDK and cloud sessions load project-scoped servers without asking, so use disabledMcpjsonServers if you need a server excluded everywhere.
Does adding more MCP servers eat my context window?
Far less than it used to. Tool search is on by default, so only tool names and server instructions load at session start and full schemas are fetched on demand. The cost is not zero — every connected server contributes its names and instructions to every session — and it rises sharply if you set a server to load always, because each upfront tool takes space your conversation would have used. When a plain CLI exists, it is still cheaper than an MCP server.
I have an allow rule for an MCP tool, so why am I still being prompted?
Two things outrank an allow rule. A server author can mark a tool as requiring user interaction, and that tool then prompts on every call in every permission mode, with no "don't ask again" option. Your organisation can set a connector tool to ask, which behaves the same way, or to blocked, in which case the tool never reaches Claude at all. Neither is something a local rule can override.
Is a server in the Anthropic Directory safe to connect?
Not on that basis alone. Anthropic reviews connectors against listing criteria before adding them to the Directory, but it does not security-audit or manage any MCP server. Treat a listing as a review of the submission rather than of the code, and remember that a server you connect can act on your behalf against the systems it reaches.

More Claude Code topics

All of Claude Code

Related guides

  • Troubleshooting · 9 min read

    Your MCP server connects and the tools still do not run

    The server is green, the tool count is right, and the model answers without touching any of it. That is a selection problem, not a connection problem: ten causes with distinct fingerprints, from a six-word description to the thirtieth tool that pushed the right one out of reach.

  • Troubleshooting · 9 min read

    Why your MCP server isn't showing up in Claude Code

    An MCP server that adds cleanly and then shows no tools has about ten possible causes, and each leaves a different fingerprint. A symptom-first triage guide: what the /mcp statuses actually mean, why scope cannot be changed in place, and the config error that makes Claude run your URL as a local process.