---
title: "Claude Code MCP servers for a team · Selan"
description: "How to share Claude Code MCP servers with a team: .mcp.json, managed-mcp.json, managedMcpServers, allowlists, sign-in, and what a gateway changes."
url: https://selan.ai/guides/claude-code-mcp-servers
updated: 2026-11-28T09:58:52+02:00
---

Guide · Claude Code for a team

# How do you share MCP servers with a team in Claude Code?

Commit a `.mcp.json` for one repository, or use managed configuration for every machine: `managed-mcp.json` for a fixed set, `managedMcpServers` for servers beside each developer's own. Each developer still signs in to a server as themselves. Behind a gateway, claude.ai's connectors and server-managed settings do not reach Claude Code, so those two routes drop out.

## Which MCP scope does a team share?

Project scope. Claude Code keeps an MCP server at one of three scopes, and only one of them travels with the code:

| Scope | Loads in | Shared with the team | Stored in |
| --- | --- | --- | --- |
| Local, the default | The current project | No | `~/.claude.json` |
| Project | The current project | Yes, through version control | `.mcp.json` at the project root |
| User | All your projects | No | `~/.claude.json` |

When one name is defined in more than one place, Claude Code connects once, using local over project over user, then plugin servers, then claude.ai connectors. A server provided through managed settings ranks above all of them.

## How does a repository's .mcp.json share a server?

Add the server with `--scope project`, which writes `.mcp.json`, and commit the file:

```bash
claude mcp add --transport http sentry --scope project https://mcp.sentry.dev/mcp
```

-   **Each developer approves it once.** An interactive session asks before it uses a project server. A cloned repository cannot approve its own servers: `enableAllProjectMcpServers` in its committed settings is ignored until the folder is trusted.
-   **Headless runs do not ask.** `claude -p` and Agent SDK sessions load project servers without the prompt. `disabledMcpjsonServers` or `--strict-mcp-config` keeps one out.
-   **Secrets stay out of the file.** `${VAR}` and `${VAR:-default}` expand in a server's command, args, env, URL and headers, so each developer exports their own token.
-   **Claude Code's own credentials never expand toward a remote server.** `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` in a URL or header reads as empty, and the server usually answers `401`.

This covers one repository's contributors. A developer in another repository does not get the server.

## How do you put MCP servers on every developer's machine?

Anthropic's managed MCP configuration has three tools:

-   **`managed-mcp.json`** deploys a fixed set with exclusive control. Developers cannot add or use any other server, and `claude mcp add` fails. It is a file at a system path (`/Library/Application Support/ClaudeCode/`, `/etc/claude-code/` or `C:\Program Files\ClaudeCode\`), delivered by MDM, Group Policy or fleet tooling.
-   **`managedMcpServers`** in managed settings provides remote servers beside each developer's own, from Claude Code v2.1.259. An entry is `http` or `sse` on an `https://` URL, with no `command` and no `${VAR}`. Developers cannot remove one, and can turn it off for themselves in `/mcp`.
-   **`allowedMcpServers` and `deniedMcpServers`** filter what developers add, by name, command or URL. An allowlist is enforced only with `allowManagedMcpServersOnly: true`; without it, a developer's own settings can broaden it.

**Developers can read what you deploy.** Any user on the machine can read `managed-mcp.json`, so Anthropic says to keep API keys out of it. A header in `managedMcpServers` is readable too: use one credential issued for everyone, or let each person sign in with OAuth. Anthropic reviews directory connectors but does not security-audit any MCP server.

## What changes for MCP servers behind a gateway?

Two of claude.ai's routes stop reaching Claude Code. A gateway sets `ANTHROPIC_BASE_URL` and usually a credential such as `ANTHROPIC_AUTH_TOKEN`, and Anthropic's docs state what each does:

-   **claude.ai's connectors are not fetched** when `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, an `apiKeyHelper` or a `claude setup-token` token supplies the credential. On a Team or Enterprise plan, only admins add those connectors.
-   **Server-managed settings need a direct connection to `api.anthropic.com`**, so `managedMcpServers` set in claude.ai's admin console never arrives.

What still works is a repository's `.mcp.json`, an MDM policy, a `managed-settings.json` or `managed-mcp.json` file, or a gateway that hands Claude Code the servers itself.

Behind a gateway, claude.ai's connectors never reach Claude Code.

## How does Selan share MCP servers with a team?

Selan is a hosted gateway that runs Claude Code and Codex on the accounts your company already pays for. An owner adds a connector once for the whole company, on the [Connections](https://selan.ai/docs/mcp-connections) page under Company. Each developer then turns on the ones they use, and `selan claude` brings them into `/mcp`.

-   **Passed at launch.** `selan claude` hands the company's connectors to Claude Code for that launch. One on your company's own OAuth client is added to the developer's user scope in `~/.claude.json` and removed when it leaves their list. A server the developer added by hand is left alone.
-   **Everyone signs in as themselves**, so their own permissions apply. GitHub connects through Selan, and its token stays sealed in Selan, off the laptop.
-   **A switch per app.** Each connector has a Claude Desktop and a Claude CLI switch. Desktop starts on; the CLI starts on only for Selan and Brave Search. A change reaches the app the next time it starts.
-   **Only what the owner added.** A developer chooses among the company's connectors and cannot widen the list. The X on a company row removes that connector from everyone.
-   **Your own server.** An owner adds an `https://` address with OAuth or no sign-in, up to 50. Selan never fetches it, and developers' apps connect from their own machines, so an address only your network reaches works.
-   **One URL for all of them.** `https://mcp.selan.ai/mcp`, added once as a custom connector, serves the tools of every connector you turn on.

`selan codex` carries the same connectors into [Codex](https://selan.ai/docs/codex#connectors). A developer who passes their own `--mcp-config` gets theirs and not the company's list. [How it works](https://selan.ai/how-it-works) shows the whole launch, and [Selan MCP](https://selan.ai/docs/mcp) is the connector for your company's own Selan data.

[Start for free](https://auth.selan.ai/r)

Free for up to three seats, and the Free plan needs no card.

## When are Claude Code's own settings the better answer?

-   **A fixed set and nothing else.** `managed-mcp.json` stops developers adding any other server. Selan adds the company's connectors; it does not block a developer's own.
-   **An enforced allowlist.** `allowedMcpServers` with `allowManagedMcpServersOnly` decides what developers may add. Selan sets neither.
-   **One repository.** A committed `.mcp.json` needs nothing else.
-   **No gateway.** A Claude Team or Enterprise organization signed in on claude.ai adds connectors once for chat and Claude Code.

The two work together, with one exception. Selan's connectors arrive on every `selan claude` launch, and a `deniedMcpServers` entry in an MDM policy still blocks a server on the same machines. A deployed `managed-mcp.json` does not mix: Claude Code exits at startup when a session also gets servers through `--mcp-config`, which is how `selan claude` passes them. [Sharing a plugin marketplace](https://selan.ai/guides/claude-code-plugin-marketplace) covers the plugins that bundle MCP servers, and [the Claude Code gateway guide](https://selan.ai/guides/claude-code-gateway) covers what else a gateway changes.

### The short version

-   A committed `.mcp.json` shares a server with one repository's contributors, each of whom approves it once.
-   Keep secrets out of the file with `${VAR}`; Claude Code's own credentials never expand toward a remote server.
-   `managed-mcp.json` fixes the set, `managedMcpServers` adds servers beside a developer's own, and an allowlist binds only with `allowManagedMcpServersOnly`.
-   Behind a gateway, claude.ai's connectors and server-managed settings do not reach Claude Code.
-   Through Selan, an owner adds a connector once, each developer turns on the ones they use, and every `selan claude` launch carries them, signed in as that developer.

How MCP scopes, project approvals, variable expansion, managed MCP configuration, claude.ai connectors and server-managed settings work is as Anthropic's pages on connecting Claude Code to tools, controlling MCP server access and server-managed settings (code.claude.com/docs/en/mcp, /managed-mcp and /server-managed-settings) stated it on 28 November 2026. These change: check the date before relying on them. What Selan does is as its command line, control app and docs stated it then.
