Skip to content

[FEATURE] Disabling MCP tool context in default, but enabling for subagents #7289

Description

@sorryhyun

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Feature Request: Disabling MCP tool context in default, but enabling for subagents

Problem Statement

Currently, MCP tools configured in .mcp.json are globally available throughout the entire Claude Code session. This creates unnecessary context overhead and potential confusion when tools are only needed for specific sub-agents or workflows.

Current Behavior:

  • MCP tools are either fully enabled (connected) or fully disabled (not connected) for the entire session
  • No way to conditionally enable tools based on execution context
  • Sub-agents inherit all available MCP tools regardless of need

Proposed Solution

Option 1: add default agent config in /agents

Project agents (/home...)
default (default one when I run claude code in IDE)
...sub-agents

Option 2: Agent-level MCP configuration

{
  "mcpServers": {
    "playwright": {
      "command": "...",
      "enabledFor": ["chatgpt-project-manager", "web-automation-agent"]
    }
  }
}

Option 3: Context flags in configuration

{
  "mcpServers": {
    "playwright": {
      "command": "...",
      "contexts": {
        "default": false,
        "subagents": ["chatgpt-project-manager"]
      }
    }
  }
}

Benefits

  • Reduced context overhead: Only load relevant tools when needed
  • Improved safety: Prevent accidental use of powerful tools in default context
  • Better agent specialization: Each agent gets exactly the tools it needs
  • Cleaner user experience: Less tool clutter in autocomplete/suggestions

Alternative Solutions

No response

Priority

Medium - Would be very helpful

Feature Category

Configuration and settings

Use Case Example

Use Case Example:

  • Default Claude Code usage: Don't need MCP browser automation tools (reduces context, prevents accidental usage)
  • chatgpt-project-manager agent: Requires playwright MCP for web automation
  • codebase-auditor agent: Doesn't need any MCP tools
  • Other agents: May need different subsets of MCP tools

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mcpduplicateThis issue or pull request already existsenhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions