> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Connect Claude Code to Metorial for your whole team
URL: https://metorial.com/docs/platform/clients/claude-code

Add one Magic MCP URL to Claude Code, sign in with company SSO, and roll the same config out to every developer with .mcp.json or managed settings.

---

{/* VERIFY: Claude Code steps come from the marketing client registry (metorial/src/app/(landing)/(integrations)/agents/lib/clientSetup.ts), checked against the Claude Code docs on 2026-10-16 and marked "pending engineering review". */}

To connect Claude Code to Metorial, add your portal's Magic MCP URL as an HTTP MCP server with `claude mcp add --transport http metorial <your-magic-mcp-url>`, then run `/mcp` and sign in with your company account. Each developer signs in as themselves, so Claude Code only reaches the integrations and tools that person's groups allow, and every call is logged under their name. To roll it out to the whole team, commit the same URL in a project `.mcp.json` or push it to every machine with Claude Code's managed settings.

<PageIntro>
  <Learn>
    * How to connect one developer's Claude Code to Metorial
    * How to roll the same server out to every developer
    * How to restrict Claude Code to approved MCP servers
  </Learn>

  <Reading title="Before you start">
    * A [portal](/docs/platform/workforce/portals) with SSO and the integrations your developers need
    * Groups that [grant access](/docs/platform/workforce/grant-access) to those integrations
    * The Claude Code CLI installed on each developer's machine
  </Reading>
</PageIntro>

## How the connection works [#how-the-connection-works]

Claude Code talks to one MCP server: Metorial. Behind that one URL, Metorial serves the integrations the signed-in person is allowed to use, runs each tool call with that person's own connected account, and records the call. Developers never paste API keys into a config file.

{/* VERIFY: the portal home page shows the portal-level Magic MCP URL (portal.portalMagicMcpUrl), so the same URL should work for every developer and identity comes from the OAuth sign-in. Confirm before recommending one URL in a shared .mcp.json or managed settings. */}

## Connect one developer [#connect-one-developer]

<Steps>
  <Step title="Copy the Magic MCP URL">
    Open your company's Metorial portal and sign in. Copy the URL from the **Magic MCP URL** card on the portal home page. The card also lists short setup steps for Claude Code.
  </Step>

  <Step title="Add the server over HTTP">
    Run this in a terminal. Add `--scope user` to make Metorial available in every project instead of only the current one.

    ```bash
    claude mcp add --transport http metorial <your-magic-mcp-url>
    ```
  </Step>

  <Step title="Sign in">
    Start Claude Code, run `/mcp`, select **metorial**, and sign in with your company account. Metorial then asks which integrations Claude Code may use and, for each one, whether to allow every tool or only the tools you pick.
  </Step>

  <Step title="Check the connection">
    Ask Claude Code to list the Metorial tools it can see. An admin can confirm the connection in Workforce under **Identity**, **Accounts**: open the developer's account and check **Connections** and **Operations**.
  </Step>
</Steps>

## Roll it out to every developer [#roll-it-out-to-every-developer]

Pick the option that matches how much control you need.

### Share a project `.mcp.json` [#share-a-project-mcpjson]

Commit this file to the root of a repository. Everyone who opens the project gets the server and signs in with their own account.

```json
{
  "mcpServers": {
    "metorial": {
      "type": "http",
      "url": "<your-magic-mcp-url>"
    }
  }
}
```

Claude Code asks each developer to approve project-scoped servers the first time they open the project.

### Provide the server through managed settings [#provide-the-server-through-managed-settings]

To give every developer Metorial without relying on a repository, list it under `managedMcpServers` in a managed settings source: server-managed settings, an MDM profile or registry policy, or `managed-settings.json`. This requires Claude Code v2.1.259 or later. The URL must use `https://`, and you should leave out `headers` so each developer signs in with OAuth.

```json
{
  "managedMcpServers": {
    "metorial": {
      "type": "http",
      "url": "<your-magic-mcp-url>"
    }
  }
}
```

Developers keep any servers they add themselves. To take exclusive control instead, deploy a `managed-mcp.json` file at `/Library/Application Support/ClaudeCode/managed-mcp.json` on macOS, `/etc/claude-code/managed-mcp.json` on Linux and WSL, or `C:\Program Files\ClaudeCode\managed-mcp.json` on Windows. See Anthropic's [managed MCP configuration](https://code.claude.com/docs/en/managed-mcp) guide for the full rules.

### Block servers that bypass Metorial [#block-servers-that-bypass-metorial]

Set `allowedMcpServers` with a `serverUrl` pattern for your Metorial host, and `allowManagedMcpServersOnly: true`, in a managed settings source. Claude Code then refuses remote servers that do not match. [How to control shadow MCP servers](/docs/platform/guides/control-shadow-mcp) covers this alongside the other clients.

## Control what Claude Code can do [#control-what-claude-code-can-do]

Set limits in Metorial first, because they apply in every client. Use [tool filters](/docs/platform/guides/tool-permissions) to reject write or destructive tools for a team, and use groups to decide which integrations a team sees at all.

Claude Code adds its own layer. Metorial tools appear as `mcp__metorial__<tool>`, and you can use those names in Claude Code permission rules to allow or deny a tool, or to pre-approve trusted tools so developers are not asked each time.

{/* VERIFY: Agent Session Capture exists in the Oct 30 platform code (Organization settings > Agent Sessions; levels Off, Usage only, Full; hook installed with `metorial agent-hooks install`). Confirm it has shipped before keeping this paragraph. */}

Organizations can also choose what Metorial stores when members report Claude Code sessions with the Metorial CLI. In organization settings, open **Agent Sessions** and pick a capture level of **Off**, **Usage only**, or **Full**. Members install the hook with `metorial agent-hooks install`.

## Troubleshooting [#troubleshooting]

### `claude mcp list` shows "Needs authentication" [#claude-mcp-list-shows-needs-authentication]

Run `/mcp`, select **metorial**, and sign in. If sign-in keeps failing, choose **Clear authentication** in the same menu and sign in again.

### The browser sign-in fails to return to Claude Code [#the-browser-sign-in-fails-to-return-to-claude-code]

{/* VERIFY: Claude Code completes MCP OAuth through a localhost callback, so it needs the "Localhost apps" redirect pattern. */}

The portal only accepts OAuth redirects that match its allowed patterns. In the portal's **Settings**, open **Client Settings** and check that **Allowed OAuth Redirects** includes **Localhost apps** (`http://localhost:*/*`).

### A teammate sees "Pending approval" [#a-teammate-sees-pending-approval]

Servers shared through a project `.mcp.json` need approval. Run `claude` in the project and approve **metorial** when asked.

### Large tool results are cut off [#large-tool-results-are-cut-off]

Claude Code warns when a tool result passes 10,000 tokens and caps it at 25,000 by default. Raise the cap with the `MAX_MCP_OUTPUT_TOKENS` environment variable.

### Signed in, but an integration is missing [#signed-in-but-an-integration-is-missing]

Metorial only serves integrations that the person's groups allow and that they selected on the consent screen. Check the account's groups under **Access**, then sign in again from `/mcp` and select the integration.

## FAQ [#faq]

### Do developers need API keys or tokens in their Claude Code config? [#do-developers-need-api-keys-or-tokens-in-their-claude-code-config]

No. The config only holds the Magic MCP URL. Each developer signs in with your identity provider, and Metorial uses the account they connected for each integration.

### Can we stop developers from adding MCP servers that don't go through Metorial? [#can-we-stop-developers-from-adding-mcp-servers-that-dont-go-through-metorial]

Metorial does not manage Claude Code's local config. Claude Code's managed settings can, with `allowedMcpServers` plus `allowManagedMcpServersOnly`, or with an exclusive `managed-mcp.json`.

### What happens to a developer's access when they leave? [#what-happens-to-a-developers-access-when-they-leave]

With [SCIM](/docs/platform/guides/sso-and-scim) connected, deactivating the person in your identity provider marks them deprovisioned in Metorial and removes their groups. The URL in their Claude Code config then has nothing left to grant.

### Can we keep Claude Code read-only for some teams? [#can-we-keep-claude-code-read-only-for-some-teams]

Yes. Give those teams integrations whose tool filters allow only **Read-Only Tools**. The filter applies on the Metorial side, so it holds no matter how Claude Code is configured.

### Where do we see what Claude Code did? [#where-do-we-see-what-claude-code-did]

Every call appears in the person's **Operations** in Workforce and in **Tool Calls** under connection logs. See [Audit MCP tool calls](/docs/platform/guides/audit-logs) for exports.

## Related pages [#related-pages]

<Cards columns="2">
  <Card title="Supported clients" icon="computer" href="/docs/platform/clients">
    Setup guides for Cursor, ChatGPT, Claude, Codex, and other MCP clients.
  </Card>

  <Card title="Set up SSO and SCIM" icon="shield-check" href="/docs/platform/guides/sso-and-scim">
    Connect Microsoft Entra ID or Okta and map groups to tool access.
  </Card>

  <Card title="Control shadow MCP" icon="eye-off" href="/docs/platform/guides/control-shadow-mcp">
    Route approved MCP through one gateway URL.
  </Card>

  <Card title="Claude Code on metorial.com" icon="external-link" href="https://metorial.com/agents/claude-code">
    How Metorial works with Claude Code.
  </Card>
</Cards>