Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

39.1 KB
Raw Blame
<!doctype html>
<html lang="en">
<head>
<!-- Google tag (gtag.js), Google Ads AW-18388216863. Loaded only when Do Not Track is
     off, so it follows the same rule as the PostHog block on this site. -->
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){ dataLayer.push(arguments); }
  if (navigator.doNotTrack !== '1') {
    var gtagScript = document.createElement('script');
    gtagScript.async = true;
    gtagScript.src = 'https://www.googletagmanager.com/gtag/js?id=AW-18388216863';
    document.head.appendChild(gtagScript);
    gtag('js', new Date());
    gtag('config', 'AW-18388216863');
  }
</script>

<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Claude Code MCP Servers: How to Add One, Scopes and .mcp.json — Munder Difflin Blog</title>
<meta name="description" content="Add Claude Code MCP servers with claude mcp add: transports, scopes, --env and --header, .mcp.json, OAuth sign in and output limits. Checked 29 Sep 2026." />
<link rel="canonical" href="https://munderdiffl.in/blog/how-to-add-an-mcp-server-to-claude-code/" />

<link rel="icon" type="image/png" href="https://munderdiffl.in/logo.png" />
<link rel="apple-touch-icon" href="https://munderdiffl.in/logo.png" />
<meta name="theme-color" content="#F5F2E8" />

<!-- Open Graph -->
<meta property="og:site_name" content="Munder Difflin Blog" />
<meta property="og:type" content="article" />
<meta property="og:title" content="Claude Code MCP Servers: How to Add One, Scopes and .mcp.json — Munder Difflin Blog" />
<meta property="og:description" content="Add Claude Code MCP servers with claude mcp add: transports, scopes, --env and --header, .mcp.json, OAuth sign in and output limits. Checked 29 Sep 2026." />
<meta property="og:url" content="https://munderdiffl.in/blog/how-to-add-an-mcp-server-to-claude-code/" />
<meta property="og:image" content="https://munderdiffl.in/blog/assets/media/how-to-add-an-mcp-server-to-claude-code/hero.png" />
<meta property="og:image:width" content="1600" />
<meta property="og:image:height" content="900" />
<meta property="og:image:alt" content="Illustration: How to Add an MCP Server to Claude Code" />
<meta property="og:locale" content="en_US" />
<meta property="article:published_time" content="2026-09-10T00:00:00.000Z" />
<meta property="article:author" content="Chaitanya Giri" />
<meta property="article:tag" content="Guides" />
<meta property="article:tag" content="MCP" />
<meta property="article:tag" content="Claude Code" />
<meta property="article:tag" content="Getting Started" />


<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Claude Code MCP Servers: How to Add One, Scopes and .mcp.json — Munder Difflin Blog" />
<meta name="twitter:description" content="Add Claude Code MCP servers with claude mcp add: transports, scopes, --env and --header, .mcp.json, OAuth sign in and output limits. Checked 29 Sep 2026." />
<meta name="twitter:image" content="https://munderdiffl.in/blog/assets/media/how-to-add-an-mcp-server-to-claude-code/hero.png" />
<meta name="twitter:image:alt" content="Illustration: How to Add an MCP Server to Claude Code" />

<link rel="alternate" type="application/atom+xml" title="Munder Difflin Blog" href="https://munderdiffl.in/blog/feed.xml" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,[email protected],500;9..144,600;9..144,700;9..144,900&amp;family=Source+Serif+4:opsz,[email protected],400;8..60,600;8..60,700&amp;family=Space+Grotesk:wght@500;600;700&amp;family=JetBrains+Mono:wght@400;600&amp;display=swap" rel="stylesheet" />
<link rel="stylesheet" href="/blog/assets/blog-press.css" />

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "Claude Code MCP Servers: How to Add One, Scopes and .mcp.json",
  "description": "Add Claude Code MCP servers with claude mcp add: transports, scopes, --env and --header, .mcp.json, OAuth sign in and output limits. Checked 29 Sep 2026.",
  "image": ["https://munderdiffl.in/blog/assets/media/how-to-add-an-mcp-server-to-claude-code/hero.png"],
  "datePublished": "2026-09-10T00:00:00.000Z",
  "dateModified": "2026-09-29T00:00:00.000Z",
  "author": { "@type": "Person", "name": "Chaitanya Giri" },
  "publisher": {
    "@type": "Organization",
    "name": "Munder Difflin",
    "logo": { "@type": "ImageObject", "url": "https://munderdiffl.in/logo.png" }
  },
  "mainEntityOfPage": { "@type": "WebPage", "@id": "https://munderdiffl.in/blog/how-to-add-an-mcp-server-to-claude-code/" },
  "keywords": "claude code mcp servers, claude code mcp, claude code mcp add, claude code mcp json, claude code mcp config file, claude mcp add transport, claude code mcp servers global",
  "articleSection": "Guides",
  "inLanguage": "en-US",
  "url": "https://munderdiffl.in/blog/how-to-add-an-mcp-server-to-claude-code/"
}
</script>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    { "@type": "ListItem", "position": 1, "name": "Home", "item": "https://munderdiffl.in/" },
    { "@type": "ListItem", "position": 2, "name": "Blog", "item": "https://munderdiffl.in/blog/" },
    { "@type": "ListItem", "position": 3, "name": "Claude Code MCP Servers: How to Add One, Scopes and .mcp.json", "item": "https://munderdiffl.in/blog/how-to-add-an-mcp-server-to-claude-code/" }
  ]
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    { "@type": "Question", "name": "How do I add an MCP server to Claude Code?", "acceptedAnswer": { "@type": "Answer", "text": "Run claude mcp add from your terminal, not inside a session. For a hosted server use --transport http, a name and the URL. For a local server give a name, then the double dash separator, then the command that starts it. Check the result with claude mcp list." } },
    { "@type": "Question", "name": "Where is the Claude Code MCP config file?", "acceptedAnswer": { "@type": "Answer", "text": "Local and user scoped servers live in ~/.claude.json: local ones under the entry for the project, user ones under the top level mcpServers key. Project scoped servers live in .mcp.json at the project root, which you commit. Claude Code does not read ~/.claude/mcp.json or ~/.claude/.mcp.json." } },
    { "@type": "Question", "name": "How do I add an MCP server to Claude Code globally?", "acceptedAnswer": { "@type": "Answer", "text": "Add it with --scope user. It is then active in every project you open and stays private to you. A server's scope is fixed when you add it, so to move one you remove it and add it again at the new scope." } },
    { "@type": "Question", "name": "Is the SSE transport still supported in Claude Code?", "acceptedAnswer": { "@type": "Answer", "text": "It still works but is deprecated. The MCP specification replaced HTTP+SSE with Streamable HTTP in its 2025-03-26 revision, and Claude Code's docs say to use --transport http. Since Claude Code 2.1.265, an http entry falls back to SSE on its own when a server only speaks the old transport." } },
    { "@type": "Question", "name": "Why does my MCP server show Pending approval?", "acceptedAnswer": { "@type": "Answer", "text": "It comes from a project's .mcp.json and you have not approved it yet. Claude Code asks before it starts a server a cloned repository defines, so run claude in that folder and accept the prompt, or approve it later from /mcp." } }
    
  ]
}
</script>


<script>
  // Anonymous blog analytics (PostHog) — same posture as the main site and the
  // app's TELEMETRY.md: public write-only token ('' = inert), anonymous-only
  // (person_profiles 'never'), no autocapture/recording, DNT respected.
  (function () {
    var PH_KEY = 'phc_qJzsokwcbtTGHemnvywR3nSqivNNgMjHeNVEWkZNydFB';
    if (!PH_KEY || navigator.doNotTrack === '1') return;
    var s = document.createElement('script');
    s.async = true;
    s.src = 'https://us-assets.i.posthog.com/static/array.js';
    s.onload = function () {
      if (!window.posthog) return;
      window.posthog.init(PH_KEY, {
        api_host: 'https://us.i.posthog.com',
        person_profiles: 'never',
        autocapture: false,
        before_send: function (event) {
          // PostHog fills $ip from the connection unless the event carries one.
          // Null it here and disable the GeoIP lookup so no IP, city, postal
          // code or lat/long is ever derived or stored for this page view.
          if (event && event.properties) {
            event.properties.$ip = null;
            event.properties.$geoip_disable = true;
          }
          return event;
        },
        disable_session_recording: true,
        respect_dnt: true
      });
    };
    document.head.appendChild(s);
  })();
</script>
</head>
<body class="theme-press">
<a class="skip-link" href="#main">Skip to content</a>
<nav id="nav">
  <a class="brand" href="https://munderdiffl.in" aria-label="Munder Difflin home">
    <img class="brand-logo" src="https://munderdiffl.in/logo.png" width="1318" height="840" alt="Munder Difflin, Inc. — Multi-Agent Harness" />
  </a>
  <span class="spacer"></span>
  <div class="links">
    <a href="/blog/">Latest</a>
    <a href="/blog/topics/">Topics</a>
    <a href="/blog/about/">About</a>
    <a href="https://munderdiffl.in">↗ Product</a>
  </div>
  <div class="nav-actions">
    <a class="btn sm" href="https://munderdiffl.in/blog/feed.xml" aria-label="RSS feed">⤵ RSS</a>
    <a class="btn sm primary" href="https://munderdiffl.in/#install">⤓ Download</a>
  </div>
</nav>

<main id="main">

<article class="t-guides">
  <header class="post-head wrap">
    <nav class="crumbs" aria-label="Breadcrumb">
      <a href="/blog/">Blog</a>
      <span>/</span>
      <a href="/blog/topics/guides/">Guides</a>
    </nav>
    <h1>Claude Code MCP Servers: How to Add One, Scopes and .mcp.json</h1>
    <p class="dek">Add Claude Code MCP servers with claude mcp add: transports, scopes, --env and --header, .mcp.json, OAuth sign in and output limits. Checked 29 Sep 2026.</p>
    <div class="byline">
      <span class="av" aria-hidden="true">MD</span>
      <strong>Chaitanya Giri</strong>
      <span class="dot" aria-hidden="true">·</span>
      <time datetime="2026-09-10">Sep 10, 2026</time>
      <span class="dot" aria-hidden="true">·</span>
      <span>8 min read</span>
      <span class="tag kind">Guides</span>
    </div>
  </header>

  <div class="hero-wrap wrap"><figure class="fig fig-hero"><img src="/blog/assets/media/how-to-add-an-mcp-server-to-claude-code/hero.png" alt="Illustration: How to Add an MCP Server to Claude Code" loading="lazy" decoding="async" /></figure></div>

  <div class="post-wrap wrap">
    <div class="prose">
      <div class="callout tldr"><span class="ic">TL;DR</span><p>Hosted server: <code>claude mcp add --transport http &lt;name&gt; &lt;url&gt;</code>. Local server: <code>claude mcp add &lt;name&gt;</code>, the double dash separator, then the launch command. Add <code>--scope user</code> for every project or <code>--scope project</code> to share through <code>.mcp.json</code>. SSE is deprecated; use <code>http</code>. Check with <code>claude mcp list</code>, sign in with <code>/mcp</code>. Checked on Claude Code 2.1.284, 29 Sep 2026.</p></div>
<p>You add Claude Code MCP servers with <code>claude mcp add</code>: a name, then a URL for a hosted server or a launch command for a local one. The server lands in one of three scopes, and <code>claude mcp list</code> tells you whether it connected.</p>
<p>You can do all of this by hand, or use <a href="https://harnessmd.com/download">Munder Difflin</a>, free and open source, which writes a default set of MCP servers into every Claude Code agent it starts (<a href="/blog/how-to-install-and-use-munder-difflin/">install guide</a>). The rest of this guide is the by hand route, checked against <a href="https://code.claude.com/docs/en/mcp">Anthropic’s MCP docs</a> on 29 Sep 2026. If you want the concept first, read <a href="/blog/what-is-an-mcp-server/">what an MCP server is</a>.</p>
<h2 id="claude-code-mcp-commands-at-a-glance" tabindex="-1">Claude Code MCP commands at a glance <a class="anchor" href="#claude-code-mcp-commands-at-a-glance" aria-hidden="true">#</a></h2>
<p>These are the commands you will actually use on Claude Code 2.1.284, checked on 29 Sep 2026 against <code>claude mcp --help</code> and the docs.</p>
<div class="table-scroll">
<table>
<thead>
<tr>
<th>Task</th>
<th>Command</th>
</tr>
</thead>
<tbody>
<tr>
<td>Add a hosted server</td>
<td><code>claude mcp add --transport http &lt;name&gt; &lt;url&gt;</code></td>
</tr>
<tr>
<td>Add a local server</td>
<td><code>claude mcp add &lt;name&gt; -- &lt;command&gt; [args...]</code></td>
</tr>
<tr>
<td>Pass an environment variable</td>
<td><code>--env KEY=value</code> or <code>-e</code>, before the <code>--</code></td>
</tr>
<tr>
<td>Pass a header</td>
<td><code>--header &quot;Authorization: Bearer &lt;token&gt;&quot;</code> or <code>-H</code></td>
</tr>
<tr>
<td>Pick a scope</td>
<td><code>--scope local</code> (default), <code>project</code> or <code>user</code>, or <code>-s</code></td>
</tr>
<tr>
<td>Add from a JSON blob</td>
<td><code>claude mcp add-json &lt;name&gt; '&lt;json&gt;'</code></td>
</tr>
<tr>
<td>Copy servers from Claude Desktop</td>
<td><code>claude mcp add-from-claude-desktop</code> (macOS and WSL)</td>
</tr>
<tr>
<td>Check status</td>
<td><code>claude mcp list</code>, <code>claude mcp get &lt;name&gt;</code></td>
</tr>
<tr>
<td>Remove</td>
<td><code>claude mcp remove &lt;name&gt; --scope &lt;scope&gt;</code></td>
</tr>
<tr>
<td>Sign in from the shell</td>
<td><code>claude mcp login &lt;name&gt;</code>, <code>claude mcp logout &lt;name&gt;</code></td>
</tr>
<tr>
<td>Manage inside a session</td>
<td><code>/mcp</code>, <code>/mcp reconnect all</code></td>
</tr>
<tr>
<td>Forget project approvals</td>
<td><code>claude mcp reset-project-choices</code></td>
</tr>
</tbody>
</table>
</div>
<h2 id="how-do-you-add-an-mcp-server-to-claude-code" tabindex="-1">How do you add an MCP server to Claude Code? <a class="anchor" href="#how-do-you-add-an-mcp-server-to-claude-code" aria-hidden="true">#</a></h2>
<p>Run <code>claude mcp add</code> in your terminal, outside a session, and everything Claude Code needs to know goes before the <code>--</code>. Everything after it is passed to the server untouched. Here is a real run from a throwaway folder on 29 Sep 2026, using the MCP project’s reference test server:</p>
<pre class="language-bash"><code class="language-bash">$ claude <span class="token parameter variable">--version</span>
<span class="token number">2.1</span>.284 <span class="token punctuation">(</span>Claude Code<span class="token punctuation">)</span>

$ claude mcp <span class="token function">add</span> <span class="token parameter variable">--scope</span> project everything -- npx <span class="token parameter variable">-y</span> @modelcontextprotocol/server-everything
Added stdio MCP server everything with command: npx <span class="token parameter variable">-y</span> @modelcontextprotocol/server-everything to project config
File modified: <span class="token operator">&lt;</span>your folder<span class="token operator">></span>/mcp-demo/.mcp.json

$ claude mcp get everything
everything:
  Scope: Project config <span class="token punctuation">(</span>shared via .mcp.json<span class="token punctuation">)</span>
  Status: ⏸ Pending approval <span class="token punctuation">(</span>run <span class="token variable"><span class="token variable">`</span>claude<span class="token variable">`</span></span> to approve<span class="token punctuation">)</span>
  Type: stdio
  Command: npx
  Args: <span class="token parameter variable">-y</span> @modelcontextprotocol/server-everything
  Environment:

To remove this server, run: claude mcp remove everything <span class="token parameter variable">-s</span> project</code></pre>
<p>Forget the <code>--</code> and the add fails at once with <code>error: unknown option '-y'</code>. The <code>Pending approval</code> status is correct for a project scoped server: Claude Code will not start a process a repository defines until you say yes in an interactive session.</p>
<p>For a hosted server the shape is the same without the separator: <code>claude mcp add --transport http sentry https://mcp.sentry.dev/mcp</code>, the example <code>claude mcp --help</code> prints.</p>
<figure class="fig fig-inline"><img src="/blog/assets/media/how-to-add-an-mcp-server-to-claude-code/note-1.png" alt="Hand-drawn sketch from “How to Add an MCP Server to Claude Code”" loading="lazy" decoding="async" /></figure>
<h2 id="which-transport-should-you-use-stdio-http-or-sse" tabindex="-1">Which transport should you use: stdio, HTTP or SSE? <a class="anchor" href="#which-transport-should-you-use-stdio-http-or-sse" aria-hidden="true">#</a></h2>
<p>Use <code>stdio</code> for a program on your machine and <code>http</code> for anything at a URL. The current MCP specification, revision 2026-07-28, defines exactly two standard transports: stdio and Streamable HTTP (<a href="https://modelcontextprotocol.io/specification/latest/basic/transports">MCP transports</a>, checked 29 Sep 2026).</p>
<p>The old HTTP+SSE transport is deprecated. The spec’s <a href="https://modelcontextprotocol.io/specification/2026-07-28/deprecated">deprecated features registry</a> lists it as deprecated since 2025-03-26 and names Streamable HTTP as the replacement. Claude Code still accepts <code>--transport sse</code>, but its docs mark it deprecated, and since 2.1.265 (8 Sep 2026) an <code>http</code> entry falls back to SSE by itself when a server only speaks the old transport.</p>
<p>Two details trip people up. In <code>.mcp.json</code>, <code>&quot;type&quot;: &quot;streamable-http&quot;</code> is accepted as an alias for <code>&quot;http&quot;</code>, so JSON copied from a server’s README works. And WebSocket (<code>&quot;type&quot;: &quot;ws&quot;</code>) can only be added through <code>.mcp.json</code> or <code>claude mcp add-json</code>, because <code>--transport</code> does not accept <code>ws</code>.</p>
<h2 id="where-does-claude-code-store-mcp-servers" tabindex="-1">Where does Claude Code store MCP servers? <a class="anchor" href="#where-does-claude-code-store-mcp-servers" aria-hidden="true">#</a></h2>
<p>In two files, split three ways by the <code>--scope</code> flag. The default is local.</p>
<div class="table-scroll">
<table>
<thead>
<tr>
<th>Scope</th>
<th>File</th>
<th>Who gets it</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>local</code> (default)</td>
<td><code>~/.claude.json</code>, under this project’s path</td>
<td>You, this project only</td>
</tr>
<tr>
<td><code>project</code></td>
<td><code>.mcp.json</code> in the project root</td>
<td>Everyone who clones the repo</td>
</tr>
<tr>
<td><code>user</code></td>
<td><code>~/.claude.json</code>, top level <code>mcpServers</code> key</td>
<td>You, every project</td>
</tr>
</tbody>
</table>
</div>
<p>That table is the answer to “how do I add an MCP server globally”: use <code>--scope user</code>. When the same name exists in more than one place, local wins over project, project over user, and the whole entry comes from the winner; fields are not merged. Scope is fixed at add time, so moving a server means <code>claude mcp remove &lt;name&gt; --scope local</code> and adding it again. Claude Code does not read <code>~/.claude/mcp.json</code>, <code>~/.claude/.mcp.json</code> or <code>~/.claude/config/mcp.json</code>, so a server written there never appears.</p>
<h2 id="how-do-you-pass-an-api-key-or-a-header" tabindex="-1">How do you pass an API key or a header? <a class="anchor" href="#how-do-you-pass-an-api-key-or-a-header" aria-hidden="true">#</a></h2>
<p>Use <code>--env KEY=value</code> for a local server and <code>--header &quot;Name: value&quot;</code> for a hosted one. Both accept several values. The catch with <code>--env</code> is order: it swallows every <code>KEY=value</code> that follows, so if the server name comes straight after it, the name gets read as a malformed pair. We hit exactly that on 29 Sep 2026:</p>
<pre class="language-bash"><code class="language-bash">$ claude mcp <span class="token function">add</span> <span class="token parameter variable">--scope</span> project <span class="token parameter variable">--env</span> <span class="token assign-left variable">DEMO_KEY</span><span class="token operator">=</span>abc123 demo-env -- npx <span class="token parameter variable">-y</span> @modelcontextprotocol/server-everything
Invalid environment variable format: demo-env, environment variables should be added as: <span class="token parameter variable">-e</span> <span class="token assign-left variable">KEY1</span><span class="token operator">=</span>value1 <span class="token parameter variable">-e</span> <span class="token assign-left variable">KEY2</span><span class="token operator">=</span>value2

$ claude mcp <span class="token function">add</span> <span class="token parameter variable">--scope</span> project <span class="token parameter variable">--env</span> <span class="token assign-left variable">DEMO_KEY</span><span class="token operator">=</span>abc123 <span class="token parameter variable">--transport</span> stdio demo-env -- npx <span class="token parameter variable">-y</span> @modelcontextprotocol/server-everything
Added stdio MCP server demo-env with command: npx <span class="token parameter variable">-y</span> @modelcontextprotocol/server-everything to project config
File modified: <span class="token operator">&lt;</span>your folder<span class="token operator">></span>/mcp-demo/.mcp.json</code></pre>
<p>Any other option between <code>--env</code> and the name fixes it, as the docs recommend. One more rule: in a remote server’s <code>url</code> and <code>headers</code>, Claude Code reads its own credential variables such as <code>ANTHROPIC_API_KEY</code> as empty, so a shared <code>.mcp.json</code> cannot ship your key to a stranger’s server.</p>
<h2 id="how-do-you-edit-mcpjson-by-hand" tabindex="-1">How do you edit .mcp.json by hand? <a class="anchor" href="#how-do-you-edit-mcpjson-by-hand" aria-hidden="true">#</a></h2>
<p>Write an <code>mcpServers</code> object where each key is a server name. This is the <code>demo-env</code> entry the second add wrote, and it is the format for all three scopes:</p>
<pre class="language-json"><code class="language-json"><span class="token punctuation">{</span>
  <span class="token property">"mcpServers"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
    <span class="token property">"demo-env"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
      <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"stdio"</span><span class="token punctuation">,</span>
      <span class="token property">"command"</span><span class="token operator">:</span> <span class="token string">"npx"</span><span class="token punctuation">,</span>
      <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">"-y"</span><span class="token punctuation">,</span> <span class="token string">"@modelcontextprotocol/server-everything"</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
      <span class="token property">"env"</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">"DEMO_KEY"</span><span class="token operator">:</span> <span class="token string">"abc123"</span> <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span></code></pre>
<p>For a hosted server use <code>&quot;type&quot;: &quot;http&quot;</code> and a <code>url</code>. Always set <code>type</code> on a URL entry: without it Claude Code treats the entry as stdio, skips it and says so. For secrets, commit <code>${API_KEY}</code> or <code>${API_KEY:-fallback}</code> rather than the key; expansion works in <code>command</code>, <code>args</code>, <code>env</code>, <code>url</code> and <code>headers</code>. Claude Code reads <code>.mcp.json</code> when a session starts, so restart after editing. Approve servers because you read what they do: tool descriptions are text Claude trusts, which is how <a href="/blog/mcp-security-tool-poisoning/">tool poisoning</a> works.</p>
<figure class="fig fig-inline"><img src="/blog/assets/media/how-to-add-an-mcp-server-to-claude-code/note-2.png" alt="Hand-drawn sketch from “How to Add an MCP Server to Claude Code”" loading="lazy" decoding="async" /></figure>
<h2 id="how-do-you-sign-in-to-a-remote-mcp-server-with-oauth" tabindex="-1">How do you sign in to a remote MCP server with OAuth? <a class="anchor" href="#how-do-you-sign-in-to-a-remote-mcp-server-with-oauth" aria-hidden="true">#</a></h2>
<p>Add the URL with no credentials, then authenticate from <code>/mcp</code> inside a session or <code>claude mcp login &lt;name&gt;</code> from the shell. Until then <code>claude mcp list</code> shows <code>! Needs authentication</code>, which is expected. <code>claude mcp login</code> arrived in 2.1.186 (22 Jun 2026) and has <code>--no-browser</code> for SSH sessions, where you paste the redirect URL back by hand.</p>
<p>Servers without dynamic client registration take <code>--client-id</code>, <code>--client-secret</code> (it prompts with masked input, or reads <code>MCP_CLIENT_SECRET</code>) and <code>--callback-port</code>, which fixes the redirect to <code>http://localhost:PORT/callback</code>. These flags only apply to HTTP and SSE servers.</p>
<h2 id="how-much-output-can-an-mcp-tool-return" tabindex="-1">How much output can an MCP tool return? <a class="anchor" href="#how-much-output-can-an-mcp-tool-return" aria-hidden="true">#</a></h2>
<p>Claude Code warns when one tool result passes 10,000 tokens and cuts it at 25,000 by default. Raise the cap with <code>MAX_MCP_OUTPUT_TOKENS=50000 claude</code>; the warning threshold stays fixed. A server author can instead set <code>_meta[&quot;anthropic/maxResultSizeChars&quot;]</code> on a tool, up to 500,000 characters, for text results. Other variables worth knowing, all from the docs on 29 Sep 2026:</p>
<ul>
<li><code>MCP_TIMEOUT</code>: server startup timeout in milliseconds, default 30 seconds. Useful when <code>npx</code> is still downloading.</li>
<li><code>ENABLE_TOOL_SEARCH</code>: tool search is on by default, so only tool names and server instructions load at start. <code>false</code> loads everything upfront.</li>
<li><code>CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH</code>: tool descriptions and server instructions are cut at 2,048 characters unless you change this.</li>
<li><code>&quot;alwaysLoad&quot;: true</code> on a server entry skips tool search for that server’s tools.</li>
</ul>
<h2 id="what-changed-for-mcp-in-claude-code-in-the-last-six-months" tabindex="-1">What changed for MCP in Claude Code in the last six months? <a class="anchor" href="#what-changed-for-mcp-in-claude-code-in-the-last-six-months" aria-hidden="true">#</a></h2>
<p>Mostly connection status and sign in. From the <a href="https://code.claude.com/docs/en/changelog">Claude Code changelog</a>, checked 29 Sep 2026:</p>
<div class="table-scroll">
<table>
<thead>
<tr>
<th>Version (date)</th>
<th>Change</th>
</tr>
</thead>
<tbody>
<tr>
<td>2.1.284 (28 Sep 2026)</td>
<td><code>/mcp reconnect all</code> retries every failed or unauthenticated server</td>
</tr>
<tr>
<td>2.1.280 (22 Sep 2026)</td>
<td><code>CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH</code></td>
</tr>
<tr>
<td>2.1.274 (17 Sep 2026)</td>
<td>v2 MCP client and 2026-07-28 protocol negotiation on Bedrock, Vertex and Foundry too</td>
</tr>
<tr>
<td>2.1.265 (8 Sep 2026)</td>
<td><code>http</code> servers that only speak HTTP+SSE now fall back to SSE</td>
</tr>
<tr>
<td>2.1.259 (2 Sep 2026)</td>
<td><code>managedMcpServers</code> lets an organisation provide servers to every user</td>
</tr>
<tr>
<td>2.1.219 (24 Jul 2026)</td>
<td><code>claude mcp list</code> shows the HTTP status and error text on a failure</td>
</tr>
<tr>
<td>2.1.186 (22 Jun 2026)</td>
<td><code>claude mcp login</code> and <code>claude mcp logout</code></td>
</tr>
<tr>
<td>2.1.121 (28 Apr 2026)</td>
<td><code>alwaysLoad</code> server option</td>
</tr>
<tr>
<td>2.1.91 (2 Apr 2026)</td>
<td><code>anthropic/maxResultSizeChars</code> per tool override</td>
</tr>
</tbody>
</table>
</div>
<h2 id="can-munder-difflin-set-up-mcp-servers-for-every-agent" tabindex="-1">Can Munder Difflin set up MCP servers for every agent? <a class="anchor" href="#can-munder-difflin-set-up-mcp-servers-for-every-agent" aria-hidden="true">#</a></h2>
<p>Yes, for a default set. In the v0.5.3 release, Settings, Connections has a Default MCP servers list (<code>src/renderer/src/components/McpDefaultsSettings.tsx</code>). Six servers from the safe tier are on by default: Sequential Thinking, Time, Fetch, Context7, and Filesystem and Git limited to the agent’s own folder. GitHub, Database, Email &amp; Calendar and Web Search need a key and stay off until you turn them on (<code>src/shared/mcpCatalog.ts</code>).</p>
<p>When an agent starts, <code>buildDefaultMcpServers</code> in <code>src/main/hive.ts</code> writes the enabled ones into that agent’s own session settings file as <code>munder-&lt;id&gt;</code> and passes it with <code>--settings</code>. It never edits your <code>~/.claude.json</code> or <code>.mcp.json</code>, and changes apply at the next spawn, not to running agents. The honest limit: in v0.5.3 that list is one switchboard for all agents, not a per-agent grant. Each agent is still a normal <code>claude</code> session, so your user and project servers load as usual. <a href="/blog/manage-multiple-claude-code-sessions/">Running several sessions at once</a> covers why the per session file matters.</p>


      
      <section class="faq" aria-label="Frequently asked questions">
        <h2 id="faq">FAQ</h2>
        
        <div class="qa">
          <p class="q">How do I add an MCP server to Claude Code?</p>
          <p class="a">Run claude mcp add from your terminal, not inside a session. For a hosted server use --transport http, a name and the URL. For a local server give a name, then the double dash separator, then the command that starts it. Check the result with claude mcp list.</p>
        </div>
        
        <div class="qa">
          <p class="q">Where is the Claude Code MCP config file?</p>
          <p class="a">Local and user scoped servers live in ~/.claude.json: local ones under the entry for the project, user ones under the top level mcpServers key. Project scoped servers live in .mcp.json at the project root, which you commit. Claude Code does not read ~/.claude/mcp.json or ~/.claude/.mcp.json.</p>
        </div>
        
        <div class="qa">
          <p class="q">How do I add an MCP server to Claude Code globally?</p>
          <p class="a">Add it with --scope user. It is then active in every project you open and stays private to you. A server&#39;s scope is fixed when you add it, so to move one you remove it and add it again at the new scope.</p>
        </div>
        
        <div class="qa">
          <p class="q">Is the SSE transport still supported in Claude Code?</p>
          <p class="a">It still works but is deprecated. The MCP specification replaced HTTP+SSE with Streamable HTTP in its 2025-03-26 revision, and Claude Code&#39;s docs say to use --transport http. Since Claude Code 2.1.265, an http entry falls back to SSE on its own when a server only speaks the old transport.</p>
        </div>
        
        <div class="qa">
          <p class="q">Why does my MCP server show Pending approval?</p>
          <p class="a">It comes from a project&#39;s .mcp.json and you have not approved it yet. Claude Code asks before it starts a server a cloned repository defines, so run claude in that folder and accept the prompt, or approve it later from /mcp.</p>
        </div>
        
      </section>
      

      
      <hr />
      <div class="share">
        <span class="lbl">Tags</span>
        <a class="tag" href="/blog/tags/guides/">Guides</a><a class="tag" href="/blog/tags/mcp/">MCP</a><a class="tag" href="/blog/tags/claude-code/">Claude Code</a><a class="tag" href="/blog/tags/getting-started/">Getting Started</a>
      </div>
      
    </div>

    
    <aside class="toc-rail" aria-label="Table of contents">
      <div class="tt">On this page</div>
      <ol>
        <li class="lvl-2"><a href="#claude-code-mcp-commands-at-a-glance">Claude Code MCP commands at a glance</a></li><li class="lvl-2"><a href="#how-do-you-add-an-mcp-server-to-claude-code">How do you add an MCP server to Claude Code?</a></li><li class="lvl-2"><a href="#which-transport-should-you-use-stdio-http-or-sse">Which transport should you use: stdio, HTTP or SSE?</a></li><li class="lvl-2"><a href="#where-does-claude-code-store-mcp-servers">Where does Claude Code store MCP servers?</a></li><li class="lvl-2"><a href="#how-do-you-pass-an-api-key-or-a-header">How do you pass an API key or a header?</a></li><li class="lvl-2"><a href="#how-do-you-edit-mcpjson-by-hand">How do you edit .mcp.json by hand?</a></li><li class="lvl-2"><a href="#how-do-you-sign-in-to-a-remote-mcp-server-with-oauth">How do you sign in to a remote MCP server with OAuth?</a></li><li class="lvl-2"><a href="#how-much-output-can-an-mcp-tool-return">How much output can an MCP tool return?</a></li><li class="lvl-2"><a href="#what-changed-for-mcp-in-claude-code-in-the-last-six-months">What changed for MCP in Claude Code in the last six months?</a></li><li class="lvl-2"><a href="#can-munder-difflin-set-up-mcp-servers-for-every-agent">Can Munder Difflin set up MCP servers for every agent?</a></li>
      </ol>
    </aside>
    
  </div>

  <footer class="post-foot wrap"><div class="prevnext">
      <a class="pn prev" href="/blog/launching-munder-difflin-v0-5-2/"><span class="k">← Older</span><span class="t">Munder Difflin 0.5.2: Pro, the Stapler and Everything Since 0.4.6</span></a>
      <a class="pn next" href="/blog/how-much-does-claude-code-cost/"><span class="k">Newer →</span><span class="t">Claude Code Pricing (Oct 2026): US and India Plans, Is It Free?</span></a>
    </div>
    <section class="related">
      <h2>Related in Guides</h2>
      <div class="post-grid">
        <article class="card t-guides">
  <a class="thumb t-guides" href="/blog/claude-md-best-practices/" aria-hidden="true" tabindex="-1"><img src="/blog/assets/media/claude-md-best-practices/hero.png" alt="" loading="lazy" decoding="async" /></a>
  <div class="body">
    <div class="meta">
      <time datetime="2026-10-26">Oct 26, 2026</time>
      <span class="dot" aria-hidden="true"></span>
      <span>4 min</span>
    </div>
    <h3><a href="/blog/claude-md-best-practices/">CLAUDE.md Best Practices: What to Write, Where It Lives, How Long (Oct 2026)</a></h3>
    <p class="dek">CLAUDE.md best practices from Anthropic&#39;s docs, checked 26 Oct 2026: what to put in it, where each file lives, the 200 line target and how AGENTS.md loads.</p>
    <div class="foot">
      <span class="tag kind">Guides</span>
      <a class="more" href="/blog/claude-md-best-practices/" aria-label="Read: CLAUDE.md Best Practices: What to Write, Where It Lives, How Long (Oct 2026)">Read →</a>
    </div>
  </div>
</article>
<article class="card t-guides">
  <a class="thumb t-guides" href="/blog/codex-computer-use/" aria-hidden="true" tabindex="-1"><img src="/blog/assets/media/codex-computer-use/hero.png" alt="" loading="lazy" decoding="async" /></a>
  <div class="body">
    <div class="meta">
      <time datetime="2026-10-26">Oct 26, 2026</time>
      <span class="dot" aria-hidden="true"></span>
      <span>4 min</span>
    </div>
    <h3><a href="/blog/codex-computer-use/">Codex Computer Use: How to Turn It On, Plans and Limits (Oct 2026)</a></h3>
    <p class="dek">Codex computer use lets the ChatGPT desktop app see and click apps on macOS and Windows. Setup, which plans get it, locked use and how Claude&#39;s compares.</p>
    <div class="foot">
      <span class="tag kind">Guides</span>
      <a class="more" href="/blog/codex-computer-use/" aria-label="Read: Codex Computer Use: How to Turn It On, Plans and Limits (Oct 2026)">Read →</a>
    </div>
  </div>
</article>
<article class="card t-guides">
  <a class="thumb t-guides" href="/blog/cursor-pricing/" aria-hidden="true" tabindex="-1"><img src="/blog/assets/media/cursor-pricing/hero.png" alt="" loading="lazy" decoding="async" /></a>
  <div class="body">
    <div class="meta">
      <time datetime="2026-10-26">Oct 26, 2026</time>
      <span class="dot" aria-hidden="true"></span>
      <span>5 min</span>
    </div>
    <h3><a href="/blog/cursor-pricing/">Cursor Pricing (Oct 2026): Every Plan After the 12 Oct Change</a></h3>
    <p class="dek">Cursor pricing as of 26 Oct 2026: Free, Plus $8, Premium $30, Super $100, Ultra $200, Teams seats, what changed on 12 Oct and what old plans keep.</p>
    <div class="foot">
      <span class="tag kind">Guides</span>
      <a class="more" href="/blog/cursor-pricing/" aria-label="Read: Cursor Pricing (Oct 2026): Every Plan After the 12 Oct Change">Read →</a>
    </div>
  </div>
</article>

      </div>
    </section>
    
  </footer>
</article>

</main>
<footer class="site-foot">
  <div class="wrap">
    <div class="foot-top">
      <a class="foot-brand brand" href="https://munderdiffl.in" aria-label="Munder Difflin home">
        <img class="brand-logo" src="https://munderdiffl.in/logo.png" width="1318" height="840" alt="Munder Difflin, Inc. — Multi-Agent Harness" />
      </a>
      <div class="foot-links">
        <a href="/blog/">Latest</a>
        <a href="/blog/topics/">Topics</a>
        <a href="/blog/about/">About</a>
        <a href="https://munderdiffl.in/blog/feed.xml">RSS</a>
        <a href="https://github.com/chaitanyagiri/munder-difflin">GitHub</a>
        <a href="https://munderdiffl.in">munderdiffl.in ↗</a>
      </div>
    </div>
    <div class="foot-meta">
      © 2026 Munder Difflin · Local-first · MIT-licensed ·
      Built on <a href="https://munderdiffl.in">Electron, React, Pixi.js, xterm.js &amp; node-pty</a>.
      Run an office of agents while you sleep.
    </div>
  </div>
</footer>

<script>
  // sticky-nav border on scroll
  (function () {
    var nav = document.getElementById('nav');
    if (!nav) return;
    var onScroll = function () { nav.classList.toggle('scrolled', window.scrollY > 8); };
    onScroll(); window.addEventListener('scroll', onScroll, { passive: true });
  })();
  // YouTube click-to-load: thumbnail button → youtube-nocookie iframe
  (function () {
    document.addEventListener('click', function (e) {
      var btn = e.target.closest('.yt-load');
      if (!btn) return;
      var box = btn.closest('.yt');
      var id = box && box.getAttribute('data-yt');
      // Only an 11 character YouTube video id may reach the iframe URL.
      if (!id || !/^[A-Za-z0-9_-]{11}$/.test(id)) return;
      var frame = document.createElement('iframe');
      frame.src = 'https://www.youtube-nocookie.com/embed/' + encodeURIComponent(id) + '?autoplay=1';
      frame.title = box.getAttribute('data-title') || 'YouTube video';
      frame.allow = 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share';
      frame.setAttribute('allowfullscreen', '');
      box.replaceChildren(frame);
    });
  })();
</script>

</body>
</html>