Skip to main content
guidesSource-backed

Claude Code Subagent MCP Scope Guide

Source-backed guide for scoping MCP servers, tools, permissions, hooks, and memory when building Claude Code subagents for focused review, research, and implementation workflows.

by JSONbored·added 2026-06-05·
Review first review before installing

Open the source and read safety notes before installing.

Citation facts

Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.

Safety notes
Subagents can inherit tool access from the main session unless their tools and disallowed tools are set deliberately., MCP servers can expose external APIs, local files, browser sessions, or write actions, so bind each server to the subagent that actually needs it., Worktree isolation reduces accidental cross-branch edits but does not replace review of generated patches.
Privacy notes
MCP tool results, hook input, logs, and persistent subagent memory can contain repository paths, issue text, secrets, or customer data., Avoid attaching production accounts or private datasets to broad research subagents., Do not preload skills or memory that contain private policy unless the subagent is intended to see it.
Author
JSONbored
Submitted by
JSONbored
Claim status
unclaimed
Last verified
2026-06-05

Decision playbook

Review trust signals before you adopt

Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.

Compare context
Selected

0

Current score

63

Baseline

Delta

No baseline selected

No major trust-signal divergence detected in the current selection.

Source and provenance checks

Needs review

Confirm ownership and provenance before trusting install instructions.

  • Source link availableRequired

    Open the canonical repository and verify ownership.

    Done
  • Source provenance statusRequired

    Marked as source-backed.

    Done
  • Metadata reviewed

    No reviewed flag detected in metadata.

    Pending

Safety and privacy checks

Complete

Validate risk disclosures before installation or API wiring.

  • Safety notes presentRequired

    Review the listed safety guidance before running commands.

    Done
  • Privacy notes presentRequired

    Review data handling notes before connecting accounts or secrets.

    Done
  • Trust level risk gateRequired

    Trust level does not block evaluation.

    Done

Package and install checks

Needs review

Check package metadata and artifact integrity signals.

  • Install payload available

    Install or copy payload is available for review.

    Done
  • Package verification flag

    No package verification flag provided.

    Pending
  • Checksum metadata

    No checksum provided for downloaded artifact.

    Pending

Compare-driven decision checks

Needs review

Use compare context to validate trade-offs before adoption.

  • Compare tray has multiple entries

    Add at least one more entry to compare trust differences.

    Pending
  • Baseline comparison available

    No baseline peer selected yet.

    Pending
  • Diverging trust signals identified

    No major trust-signal divergence found.

    Pending

Setup at a glance

Copy & paste

Copy-ready — paste the snippet to get started.

Adoption plan

Balanced adoption plan

Current risk score 24/100. Use staged verification before broader rollout.

Risk 24

Pre-adoption checks

Validate source and review signals before any execution.

  • Confirm source provenanceRequired

    Source URL/provenance metadata is present.

    Done
  • Confirm metadata review state

    No review metadata found; increase manual validation.

    Pending
  • Verify install payload

    Install/config payload exists and can be inspected.

    Done

Security checks

Confirm safety, privacy, and package integrity signals.

  • Review safety notesRequired

    Safety notes are present.

    Done
  • Review privacy notesRequired

    Privacy notes are present.

    Done
  • Verify package integrity metadata

    No package verification/checksum metadata.

    Pending

Rollout

Adopt in controlled steps based on the selected plan.

  • Run in isolated sandbox firstRequired

    Use a constrained sandbox and observe behavior across multiple tasks.

    Pending
  • Roll out graduallyRequired

    Roll out to a small cohort before wider usage.

    Pending
  • Set monitoring and fallback

    Define rollback path and monitor errors after adoption.

    Pending

Evidence readiness

Evidence readiness matrix · balanced

Missing required evidence: Metadata review. Risk score 31.

Risk 31

Source provenance

Present

Source repository/provenance is listed.

Required in this preset

Metadata review

Missing

Review metadata is missing.

Required in this preset

Safety notes

Present

Safety notes are present.

Required in this preset

Privacy notes

Present

Privacy notes are present.

Optional in this preset

Package integrity

Missing

Package integrity metadata is missing.

Optional in this preset

Install payload

Present

Install payload is available.

Required in this preset

Required gaps: Metadata review

Decision timeline

Decision timeline · balanced

Blocking gaps: Check metadata review status. Risk 28.

Risk 28

triage

Confirm source provenanceRequired

Source/provenance metadata is available.

Done

triage

Check metadata review statusRequired

Review metadata is missing.

Pending

verify

Review safety notesRequired

Safety notes are available.

Done

verify

Review privacy notes

Privacy notes are available.

Done

verify

Validate package integrity metadata

Package integrity metadata is missing.

Pending

rollout

Verify install payload and commandsRequired

Install payload is available.

Done

Blockers: Check metadata review status

Prerequisite readiness

Prerequisite readiness

3 prerequisites to line up before setup.

0/3 ready
Configuration1General2

Safety & privacy surface

Safety & privacy surface

3 safety and 3 privacy notes across 2 risk areas. Review closely: credentials & tokens.

2 areas
  • SafetyCredentials & tokensSubagents can inherit tool access from the main session unless their tools and disallowed tools are set deliberately.
  • SafetyCredentials & tokensMCP servers can expose external APIs, local files, browser sessions, or write actions, so bind each server to the subagent that actually needs it.
  • SafetyGeneralWorktree isolation reduces accidental cross-branch edits but does not replace review of generated patches.
  • PrivacyCredentials & tokensMCP tool results, hook input, logs, and persistent subagent memory can contain repository paths, issue text, secrets, or customer data.
  • PrivacyGeneralAvoid attaching production accounts or private datasets to broad research subagents.
  • PrivacyGeneralDo not preload skills or memory that contain private policy unless the subagent is intended to see it.

Safety notes

  • Subagents can inherit tool access from the main session unless their tools and disallowed tools are set deliberately.
  • MCP servers can expose external APIs, local files, browser sessions, or write actions, so bind each server to the subagent that actually needs it.
  • Worktree isolation reduces accidental cross-branch edits but does not replace review of generated patches.

Privacy notes

  • MCP tool results, hook input, logs, and persistent subagent memory can contain repository paths, issue text, secrets, or customer data.
  • Avoid attaching production accounts or private datasets to broad research subagents.
  • Do not preload skills or memory that contain private policy unless the subagent is intended to see it.

Prerequisites

  • Claude Code with subagents enabled.
  • At least one MCP server configured or planned for the workflow.
  • A project where subagent tool access can be tested without exposing secrets.

Schema details

Install type
copy
Reading time
7 min
Difficulty score
58
Troubleshooting
Yes
Breaking changes
No
Full copyable content
## Why This Matters

Subagents are useful when a side task would fill the main conversation with logs,
search output, or temporary context. The risk is that a broad subagent can inherit
more authority than the task needs. The better pattern is to design each subagent
as a small operating surface: one job, a clear model choice, explicit tool access,
and only the MCP servers it needs.

Claude Code supports subagent files with frontmatter, explicit tool lists,
disallowed tools, permission modes, scoped MCP servers, hooks, persistent memory,
and optional worktree isolation. MCP itself has different transport and auth
models, so local stdio servers and remote HTTP servers need different handling.
This guide turns those pieces into a practical setup checklist.

## Recommended Design Flow

1. **Name the job before naming the agent.** A good description tells Claude when
   to delegate. Write the description around the trigger condition, not the
   personified role. "Use after dependency changes to check lockfile and license
   risk" is easier to route than "dependency expert".

2. **Start read-only.** For review, research, source lookup, and duplicate
   detection, give the subagent read-only tools first. Add write or shell access
   only when the subagent has a specific implementation duty.

3. **Scope MCP servers to the task.** If the subagent only researches docs, give
   it a documentation MCP server. If it checks GitHub metadata, give it GitHub
   access. Do not attach Slack, browser, database, and issue-tracker servers to a
   generic worker just because they are configured globally.

4. **Choose transport deliberately.** Stdio MCP servers run as local child
   processes and usually receive secrets through environment variables. Remote
   HTTP servers may require OAuth, bearer tokens, and resource-bound access. Keep
   those risks separate in your setup notes.

5. **Use worktree isolation for patching workers.** If a subagent may edit files,
   worktree isolation prevents it from writing directly into the parent session's
   current checkout. Review the patch before merging it back.

6. **Treat memory as a data store.** Persistent memory is useful for recurring
   project patterns, but it should not collect secrets, customer names, private
   tickets, or one-off incident data.

## Example Subagent Shape

```yaml
---
name: docs-mcp-reviewer
description: Review source-backed docs claims and cite official URLs before content changes are merged.
tools: Read, Glob, Grep
mcpServers:
  docs-search:
    command: <reviewed-docs-mcp-command>
    args: ["<reviewed-docs-mcp-arg>"]
model: sonnet
isolation: worktree
---
Review the proposed content for source support, stale claims, duplicate risk,
and privacy notes. Return only findings with source URLs and suggested edits.
```

## MCP Boundary Checklist

- The subagent has one primary task and a narrow routing description.
- Tool access is explicit; read-only workers do not inherit write tools.
- Each MCP server is justified by the task and omitted when not required.
- Stdio servers receive credentials from environment variables, not hardcoded config.
- Remote HTTP servers use HTTPS and resource-bound tokens where the server supports OAuth.
- Hooks are documented so maintainers know what runs before or after subagent work.
- Persistent memory is disabled unless the workflow needs cross-session learning.
- The first run uses a small non-sensitive test case.

## Troubleshooting

### The subagent does not get selected

Tighten the description around the exact task and use an explicit invocation once
or twice. If two subagents claim the same task, make one description narrower.

### The subagent sees too much data

Remove inherited tools, omit unrelated MCP servers, and turn off persistent
memory. For repository work, prefer worktree isolation and read-only tooling.

### The MCP server works in the main session but not the subagent

Check whether the server is configured at a scope the subagent can see. Inline
server definitions in subagent frontmatter are useful for project-specific
servers, but plugin subagents may ignore some security-sensitive fields.

## Duplicate Check

Existing guides cover MCP setup, least privilege, safe hooks, and code review
workflows. This entry focuses on the narrower Claude Code pattern of scoping MCP
servers and permissions inside custom subagents.

## References

- Claude Code subagents - https://code.claude.com/docs/en/sub-agents
- Claude Code hooks - https://code.claude.com/docs/en/hooks
- MCP transports - https://modelcontextprotocol.io/specification/2025-06-18/basic/transports
- MCP authorization - https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization

About this resource

Why This Matters

Subagents are useful when a side task would fill the main conversation with logs, search output, or temporary context. The risk is that a broad subagent can inherit more authority than the task needs. The better pattern is to design each subagent as a small operating surface: one job, a clear model choice, explicit tool access, and only the MCP servers it needs.

Claude Code supports subagent files with frontmatter, explicit tool lists, disallowed tools, permission modes, scoped MCP servers, hooks, persistent memory, and optional worktree isolation. MCP itself has different transport and auth models, so local stdio servers and remote HTTP servers need different handling. This guide turns those pieces into a practical setup checklist.

Recommended Design Flow

  1. Name the job before naming the agent. A good description tells Claude when to delegate. Write the description around the trigger condition, not the personified role. "Use after dependency changes to check lockfile and license risk" is easier to route than "dependency expert".

  2. Start read-only. For review, research, source lookup, and duplicate detection, give the subagent read-only tools first. Add write or shell access only when the subagent has a specific implementation duty.

  3. Scope MCP servers to the task. If the subagent only researches docs, give it a documentation MCP server. If it checks GitHub metadata, give it GitHub access. Do not attach Slack, browser, database, and issue-tracker servers to a generic worker just because they are configured globally.

  4. Choose transport deliberately. Stdio MCP servers run as local child processes and usually receive secrets through environment variables. Remote HTTP servers may require OAuth, bearer tokens, and resource-bound access. Keep those risks separate in your setup notes.

  5. Use worktree isolation for patching workers. If a subagent may edit files, worktree isolation prevents it from writing directly into the parent session's current checkout. Review the patch before merging it back.

  6. Treat memory as a data store. Persistent memory is useful for recurring project patterns, but it should not collect secrets, customer names, private tickets, or one-off incident data.

Example Subagent Shape

---
name: docs-mcp-reviewer
description: Review source-backed docs claims and cite official URLs before content changes are merged.
tools: Read, Glob, Grep
mcpServers:
  docs-search:
    command: <reviewed-docs-mcp-command>
    args: ["<reviewed-docs-mcp-arg>"]
model: sonnet
isolation: worktree
---
Review the proposed content for source support, stale claims, duplicate risk,
and privacy notes. Return only findings with source URLs and suggested edits.

MCP Boundary Checklist

  • The subagent has one primary task and a narrow routing description.
  • Tool access is explicit; read-only workers do not inherit write tools.
  • Each MCP server is justified by the task and omitted when not required.
  • Stdio servers receive credentials from environment variables, not hardcoded config.
  • Remote HTTP servers use HTTPS and resource-bound tokens where the server supports OAuth.
  • Hooks are documented so maintainers know what runs before or after subagent work.
  • Persistent memory is disabled unless the workflow needs cross-session learning.
  • The first run uses a small non-sensitive test case.

Troubleshooting

The subagent does not get selected

Tighten the description around the exact task and use an explicit invocation once or twice. If two subagents claim the same task, make one description narrower.

The subagent sees too much data

Remove inherited tools, omit unrelated MCP servers, and turn off persistent memory. For repository work, prefer worktree isolation and read-only tooling.

The MCP server works in the main session but not the subagent

Check whether the server is configured at a scope the subagent can see. Inline server definitions in subagent frontmatter are useful for project-specific servers, but plugin subagents may ignore some security-sensitive fields.

Duplicate Check

Existing guides cover MCP setup, least privilege, safe hooks, and code review workflows. This entry focuses on the narrower Claude Code pattern of scoping MCP servers and permissions inside custom subagents.

References

Source citations

Add this badge to your README

Show that Claude Code Subagent MCP Scope Guide is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/guides/claude-code-subagent-mcp-scope-guide.svg)](https://heyclau.de/entry/guides/claude-code-subagent-mcp-scope-guide)

How it compares

Claude Code Subagent MCP Scope Guide side by side with 2 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

1 trust signal differ across this comparison (Submitter).

Field

Source-backed guide for scoping MCP servers, tools, permissions, hooks, and memory when building Claude Code subagents for focused review, research, and implementation workflows.

Open dossier

A practical decision guide for choosing between Claude Code subagents, skills, slash commands, hooks, settings, and MCP servers. Pick the smallest extension surface that matches the workflow, risk, and sharing model.

Open dossier

Practical checklist for reviewing remote MCP server authorization, resource indicators, bearer-token handling, HTTPS transport, PKCE, and token passthrough risks before connecting an AI client.

Open dossier
Next steps
Trust
Review statusNot reviewedNot reviewedNot reviewed
Package trustPackage not verifiedPackage not verifiedPackage not verified
Source provenanceSource-backedSource-backedSource-backed
SubmitterDiffersJSONboredMkDev11JSONbored
Install riskReview firstReview firstReview first
Notes Safety ✓ Privacy ✓ Safety ✓ Privacy ✓ Safety ✓ Privacy ✓
Brand
Categoryguidesguidesguides
SourceSource-backedSource-backedSource-backed
AuthorJSONboredMkDev11JSONbored
Added2026-06-052026-06-042026-06-05
Platforms
Harness
Source repo
Safety notesSubagents can inherit tool access from the main session unless their tools and disallowed tools are set deliberately. MCP servers can expose external APIs, local files, browser sessions, or write actions, so bind each server to the subagent that actually needs it. Worktree isolation reduces accidental cross-branch edits but does not replace review of generated patches.Choose the smallest surface that solves the workflow; avoid giving a workflow live tools or lifecycle automation when a prompt template is enough. Review hooks and MCP servers more carefully than static prompts because they can interact with local commands, files, tools, or external services. Keep project-shared extensions documented so teammates know what runs automatically and what Claude can access.A remote MCP server can act as a bridge to privileged downstream APIs, so bad token audience checks can turn one integration into access to another. Do not accept setup instructions that place access tokens in URLs or screenshots. Treat every remote MCP server as a distributed system dependency with auth, rate-limit, logging, and outage behavior.
Privacy notesMCP tool results, hook input, logs, and persistent subagent memory can contain repository paths, issue text, secrets, or customer data. Avoid attaching production accounts or private datasets to broad research subagents. Do not preload skills or memory that contain private policy unless the subagent is intended to see it.Skills, slash commands, settings, hooks, subagents, and MCP configuration can contain project names, file paths, prompts, tool descriptions, and workflow policy. MCP tools and hooks may process local files, command output, API responses, logs, or other repository context depending on configuration. Keep personal credentials out of shared project extensions and prefer environment-specific configuration for sensitive access.OAuth tokens, refresh tokens, authorization codes, and MCP request logs can reveal account identity and downstream resource access. Remote servers may receive user prompts, tool arguments, and retrieved data; review retention and logging language before connecting sensitive workspaces.
Prerequisites
  • Claude Code with subagents enabled.
  • At least one MCP server configured or planned for the workflow.
  • A project where subagent tool access can be tested without exposing secrets.
  • A Claude Code workflow you want to make repeatable, safer, or more capable.
  • Agreement on whether the extension is personal, project-level, team-shared, or environment-specific.
  • A list of data, tools, commands, or external systems the workflow may touch.
  • Permission to add project files or configure Claude Code for the target repository.
  • A remote MCP server endpoint that uses Streamable HTTP or another HTTP-based transport.
  • Access to the server's documentation or metadata endpoints.
  • Ability to inspect how the client stores credentials and sends bearer tokens.
Install
Config
Citations
ClaimUnclaimedUnclaimedUnclaimed
Open 3 picks in the interactive comparison tool

Related guides

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.