# Roll Out Dtwo in Claude Code

Roll out your Dtwo gateway to everyone in your organization in Claude Code.

## Overview

This guide walks you through rolling out Dtwo to your whole organization in Claude Code and turning off direct connections to MCP servers. If you only want to set it up for yourself, see [Connect Claude Code for yourself](/docs/connect-yourself-claude-code).

## Roll out Dtwo to your organization in Claude Code

Select how your gateway signs people in.

<div class="doc-tabs" data-tabs>

<div class="doc-tablist doc-tablist-cards" role="tablist" aria-label="Sign-in type">
<button type="button" role="tab" class="doc-tab" data-tab="dtwo" aria-selected="true"><img src="/favicon.svg" alt="" width="36" height="36" data-no-lightbox>Dtwo authentication</button>
<button type="button" role="tab" class="doc-tab" data-tab="entra"><img src="/logos/azure.svg" alt="" width="36" height="36" data-no-lightbox>Microsoft Entra ID</button>
<button type="button" role="tab" class="doc-tab" data-tab="okta"><img src="/logos/okta.png" alt="" width="36" height="36" data-no-lightbox>Okta</button>
</div>

<div class="doc-tabpanel" data-panel="dtwo" role="tabpanel">

<p class="doc-step">Step 1: Add the gateway and turn off direct connections to MCP servers</p>

This step adds the gateway to your Claude Code managed settings and turns off direct connections to MCP servers. Everyone gets the gateway automatically, can't remove it, and only has to sign in with their Dtwo account.

In the Claude admin console, go to **Organization settings → Claude Code → Managed settings** and add the config below.

```json
{
  "managedMcpServers": {
    "<GatewayName>": {
      "type": "http",
      "url": "<GatewayURL>"
    }
  },
  "allowManagedMcpServersOnly": true,
  "allowedMcpServers": [],
  "disableClaudeAiConnectors": true
}
```

Replace the placeholders:

- `<GatewayURL>`: your gateway's MCP URL. Copy it from your gateway's **Overview** tab in the Dtwo UI. It must start with `https://`.
- `<GatewayName>`: your gateway's name. This is the name people see for the server in Claude Code.

What each setting does:

- `managedMcpServers` adds the gateway for everyone. Requires Claude Code v2.1.259 or later.
- `allowedMcpServers: []` blocks every server users, plugins, or claude.ai add. The gateway still loads because servers in `managedMcpServers` skip the allowlist.
- `allowManagedMcpServersOnly` stops people from widening the allowlist in their own settings. Requires Claude Code v2.1.273 or later.
- `disableClaudeAiConnectors` stops Claude Code from loading the connectors people set up on claude.ai.

Claude Code picks up the config the next time people start it, as long as they're signed in with their work Claude account. See Anthropic's [server-managed settings guide](https://code.claude.com/docs/en/server-managed-settings) for details.

> **Warning:** MCP servers people already had stop loading the next time they start Claude Code, and nothing tells them why. Let your team know before you roll it out.

<p class="doc-step">Step 2: Check the rollout</p>

1. Restart Claude Code. It only picks up the new managed settings when it starts, so quit any open sessions and start it again.
2. Run `/mcp` in Claude Code. Your gateway shows as connected, with its tools listed. When you pushed it to your organization, it's listed under **Managed MCPs**.
3. Run `claude mcp list`. If you turned off other servers, your gateway is the only one.
4. Try adding another server:

   ```bash
   claude mcp add --transport http test https://example.com/mcp
   ```

   With other servers turned off, Claude Code refuses with an enterprise policy error.

To see which managed settings reached a machine, run `/status` and check the **Setting sources** line.

</div>

<div class="doc-tabpanel" data-panel="entra" role="tabpanel">

<p class="doc-step">Step 1: Get Claude Code's client ID from Microsoft Entra ID</p>

If you've already registered Claude Code as an app in Microsoft Entra ID, go to **App registrations**, open the Claude Code app, and copy the **Application (client) ID** from its **Overview** page. This is your `<ClientId>`.

If you haven't registered Claude Code in Microsoft Entra ID yet, follow [Register Claude Code in Microsoft Entra ID](/docs/register-claude-code-entra), then come back here.

<p class="doc-step">Step 2: Add the gateway and turn off direct connections to MCP servers</p>

This step adds the gateway to your Claude Code managed settings and turns off direct connections to MCP servers. Everyone gets the gateway automatically, can't remove it, and only has to sign in.

In the Claude admin console, go to **Organization settings → Claude Code → Managed settings** and add the config below.

```json
{
  "managedMcpServers": {
    "<GatewayName>": {
      "type": "http",
      "url": "<GatewayURL>",
      "oauth": {
        "clientId": "<ClientId>",
        "callbackPort": 33418
      }
    }
  },
  "allowManagedMcpServersOnly": true,
  "allowedMcpServers": [],
  "disableClaudeAiConnectors": true
}
```

Replace the placeholders:

- `<GatewayURL>`: your gateway's MCP URL. Copy it from your gateway's **Overview** tab in the Dtwo UI. It must start with `https://`.
- `<ClientId>`: the client ID from Step 1.
- `<GatewayName>`: your gateway's name. This is the name people see for the server in Claude Code.

What each setting does:

- `managedMcpServers` adds the gateway for everyone. Requires Claude Code v2.1.259 or later.
- `allowedMcpServers: []` blocks every server users, plugins, or claude.ai add. The gateway still loads because servers in `managedMcpServers` skip the allowlist.
- `allowManagedMcpServersOnly` stops people from widening the allowlist in their own settings. Requires Claude Code v2.1.273 or later.
- `disableClaudeAiConnectors` stops Claude Code from loading the connectors people set up on claude.ai.

Claude Code picks up the config the next time people start it, as long as they're signed in with their work Claude account. See Anthropic's [server-managed settings guide](https://code.claude.com/docs/en/server-managed-settings) for details.

> **Warning:** MCP servers people already had stop loading the next time they start Claude Code, and nothing tells them why. Let your team know before you roll it out.

<p class="doc-step">Step 3: Check the rollout</p>

1. Restart Claude Code. It only picks up the new managed settings when it starts, so quit any open sessions and start it again.
2. Run `/mcp` in Claude Code. Your gateway shows as connected, with its tools listed. When you pushed it to your organization, it's listed under **Managed MCPs**.
3. Run `claude mcp list`. If you turned off other servers, your gateway is the only one.
4. Try adding another server:

   ```bash
   claude mcp add --transport http test https://example.com/mcp
   ```

   With other servers turned off, Claude Code refuses with an enterprise policy error.

To see which managed settings reached a machine, run `/status` and check the **Setting sources** line.

</div>

<div class="doc-tabpanel" data-panel="okta" role="tabpanel">

<p class="doc-step">Step 1: Get Claude Code's client ID from Okta</p>

If you've already registered Claude Code as an app in Okta, go to **Applications and Resources → Applications**, open the Claude Code app integration, and copy the **Client ID** from its **General** tab. This is your `<ClientId>`.

If you haven't registered Claude Code in Okta yet, follow [Register Claude Code in Okta](/docs/register-claude-code-okta), then come back here.

<p class="doc-step">Step 2: Add the gateway and turn off direct connections to MCP servers</p>

This step adds the gateway to your Claude Code managed settings and turns off direct connections to MCP servers. Everyone gets the gateway automatically, can't remove it, and only has to sign in.

In the Claude admin console, go to **Organization settings → Claude Code → Managed settings** and add the config below.

```json
{
  "managedMcpServers": {
    "<GatewayName>": {
      "type": "http",
      "url": "<GatewayURL>",
      "oauth": {
        "clientId": "<ClientId>",
        "callbackPort": 33418
      }
    }
  },
  "allowManagedMcpServersOnly": true,
  "allowedMcpServers": [],
  "disableClaudeAiConnectors": true
}
```

Replace the placeholders:

- `<GatewayURL>`: your gateway's MCP URL. Copy it from your gateway's **Overview** tab in the Dtwo UI. It must start with `https://`.
- `<ClientId>`: the client ID from Step 1.
- `<GatewayName>`: your gateway's name. This is the name people see for the server in Claude Code.

What each setting does:

- `managedMcpServers` adds the gateway for everyone. Requires Claude Code v2.1.259 or later.
- `allowedMcpServers: []` blocks every server users, plugins, or claude.ai add. The gateway still loads because servers in `managedMcpServers` skip the allowlist.
- `allowManagedMcpServersOnly` stops people from widening the allowlist in their own settings. Requires Claude Code v2.1.273 or later.
- `disableClaudeAiConnectors` stops Claude Code from loading the connectors people set up on claude.ai.

Claude Code picks up the config the next time people start it, as long as they're signed in with their work Claude account. See Anthropic's [server-managed settings guide](https://code.claude.com/docs/en/server-managed-settings) for details.

> **Warning:** MCP servers people already had stop loading the next time they start Claude Code, and nothing tells them why. Let your team know before you roll it out.

<p class="doc-step">Step 3: Check the rollout</p>

1. Restart Claude Code. It only picks up the new managed settings when it starts, so quit any open sessions and start it again.
2. Run `/mcp` in Claude Code. Your gateway shows as connected, with its tools listed. When you pushed it to your organization, it's listed under **Managed MCPs**.
3. Run `claude mcp list`. If you turned off other servers, your gateway is the only one.
4. Try adding another server:

   ```bash
   claude mcp add --transport http test https://example.com/mcp
   ```

   With other servers turned off, Claude Code refuses with an enterprise policy error.

To see which managed settings reached a machine, run `/status` and check the **Setting sources** line.

</div>

</div>

---

Having trouble? Email [support@dtwo.ai](mailto:support@dtwo.ai).