Day 17 of 52 · about 15 min · MCP
Share MCP servers with your team, safely
Your MCP setup only helps the team once it lives in the repo. Commit it with care, though: nobody should get a server they never approved, or a token someone pasted into a shared file.
You’ll finish with
- The right scope for each server: local, project or user.
- A committed
.mcp.json, and the approval prompt a teammate sees. - A remote server signed in from
/mcp, with no token in the repo.
You’ll need
- The
claude-code-docsserver from Day 16, or the Day 17 kit with its.mcp.json. - The project in a git repository, so you can commit the file.
Before you start
Tell us about your setup and the steps change to fit it. Your answers stay in this browser, and you can change them at any time.
Which system are you on?
Commands differ between systems. Pick the one you’ll run Claude Code on.
The steps
One step at a time. When a step’s check matches, tick it and the next one opens.
Step 1 of 4: Pick a scope
The scope decides who gets a server and where it is stored.Local (the default)
- You, in this project only
- Stored in
~/.claude.json - For servers that carry your own credentials
Project
- Everyone who clones the repo
- Stored in
.mcp.jsonat the project root - Committed with the code
User
- You, in every project
- Stored in
~/.claude.json
Share a server through project scope only when every teammate needs it. Check it worked
Run
claude mcp get claude-code-docs. It names the server’s scope: local, from Day 16.Step 2 of 4: Move the server to project scope
A scope is fixed when you add a server, so remove it, then add it again.TerminalRun: claude mcp remove claude-code-docs --scope local
Run: claude mcp add --scope project --transport http claude-code-docs https://code.claude.com/docs/mcp
What happens: The second command writes
.mcp.jsonin the project root.Run: git add .mcp.json
Run: git commit -m "Share the docs MCP server"
These commands work the same in PowerShell. .mcp.jsonJSON{ "mcpServers": { "claude-code-docs": { "type": "http", "url": "https://code.claude.com/docs/mcp" } } }Check it worked
.mcp.jsonat the project root matches the file above, and git shows it committed.Step 3 of 4: See what a teammate sees
A cloned repo can’t switch on its own servers; each person approves them once.In order:
You
A teammate runs claude in the repo
File
Claude Code reads .mcp.json
Claude
It asks them to approve the server
Until then the status is
⏸ Pending approval.
If they approve
The server connects for them
If they reject it
Their `.claude/settings.local.json` records the rejection
claude -pand cloud sessions can’t ask, so they load project servers without a prompt.Check it worked
Run
claude mcp reset-project-choices, then startclaude. The approval prompt forclaude-code-docsappears.If it didn’t work
A teammate’s server stays at `⏸ Pending approval`.
They need to start
claudein the repo and accept the prompt.claude mcp listalone never approves a server.Step 4 of 4: Keep tokens out and sign in from /mcp
Commit where a server lives, never the credential that opens it..mcp.json- mcpServers.sentry.type: "http"
- Without it, Claude Code skips the server.
- mcpServers.sentry.url: "https://mcp.sentry.dev/mcp"
- An OAuth server needs only
typeandurl; each person signs in. - mcpServers.<name>.headers.Authorization: "Bearer ${API_KEY}"
- For a token server, reference a variable each person sets, never the token itself.
Claude Code expands ${VAR}references inurlandheadersfrom each person’s environment.Check it worked
Optional, with a Sentry account: run
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp, then in/mcpchoose it, Authenticate and sign in. It shows as connected.
Finish · 4 of 4 steps to go
Your team shares one setup
What you’ll have checked
.mcp.jsonis committed at the project root.- A fresh start asks before connecting
claude-code-docs.
Lesson updates by email
Get lesson updates by email
Leave your email and we’ll tell you when we add or update a lesson.
Claude Code for your team
Want Claude Code set up across your team?
HorizonLux sets up and repairs Claude Code for teams: CLAUDE.md rules, hooks that enforce them and reviewed MCP servers. Book a free call to talk it through.
Related
Questions
Questions about Day 17
Is a repo with `.mcp.json` safe to clone?
Interactive sessions ask first. `claude -p` runs and cloud sessions connect project servers without asking, so read the file before running those.
Sources
Checked against the official Claude Code docs on .
Independent resource, not affiliated with Anthropic. HorizonLux wrote this lesson; Claude Code is made by Anthropic.