Agent and Skill-Scoped MCP Configurations

Resolved 💬 3 comments Opened Dec 19, 2025 by brandoncollins7 Closed Dec 23, 2025

Feature Request: Agent and Skill-Scoped MCP Configurations

Problem

Currently, MCP servers are configured at the user/project level and all enabled MCPs are inherited by subagents and skills. There's no way to:

  1. Configure MCPs that are only available to specific agents or skills
  2. Keep MCPs disabled in the main conversation to reduce context bloat while still having them available to specialized agents/skills
  3. Define agent or skill-specific MCP dependencies

This defeats one of the primary benefits of subagents and skills - delegating specialized tasks to isolated contexts.

Current Behavior

Main Thread (MCPs: github, linear, firecrawl)
    ├── Subagent (inherits: github, linear, firecrawl)
    └── Skill (inherits: github, linear, firecrawl)
  • If I disable linear MCP in main thread → subagents AND skills can't use it either
  • If I enable linear MCP → context bloat in main thread even when not using Linear
  • The tools field in agent definitions can only filter inherited tools, not add new ones
  • The allowed-tools field in skill definitions has the same limitation - filter only, cannot add

Desired Behavior

Main Thread (MCPs: github)
    ├── linear-task-manager agent (MCPs: linear)  ← loads only when agent invoked
    ├── web-scraper agent (MCPs: firecrawl)       ← loads only when agent invoked
    └── linear skill (MCPs: linear)               ← loads only when skill invoked

Allow agent and skill definitions to specify their own MCP dependencies:

Agent example:

# .claude/agents/linear-task-manager.md
---
name: linear-task-manager
description: Manages Linear issues and projects
mcps:
  - linear    # Agent-specific MCP, loaded only when this agent runs
tools:
  - mcp__linear__*
  - Read
  - Bash
---

Skill example:

# .claude/skills/linear.md
---
name: linear
description: Linear project management operations
mcps:
  - linear    # Skill-specific MCP, loaded only when this skill runs
allowed-tools:
  - mcp__linear__*
---

Benefits

  1. Reduced context bloat - Main conversation stays lean
  2. Better separation of concerns - Agents and skills are truly specialized
  3. Improved performance - Only load MCPs when needed
  4. Cleaner architecture - Agents and skills become self-contained units with declared dependencies
  5. Composability - Skills can be shared across projects with their MCP dependencies bundled

Use Case

I have a monorepo with multiple MCP integrations (GitHub, Linear, Firecrawl, Playwright). I want to:

  • Keep my main conversation lightweight for coding tasks
  • Use linear-task-manager agent for Linear operations (loads Linear MCP only when invoked)
  • Use github-workflow-manager agent for Git operations (loads GitHub MCP only when invoked)
  • Use /linear skill for quick Linear queries (loads Linear MCP only when skill invoked)
  • Use /scrape skill for web scraping (loads Firecrawl MCP only when skill invoked)

Currently I must choose between:

  • Enable all MCPs → bloated context everywhere (tool definitions in every message)
  • Disable MCPs → agents and skills can't function

Suggested Implementation

  1. Add mcps field to agent and skill configuration schemas
  2. When agent/skill is invoked, dynamically load specified MCPs into that context
  3. MCPs are unloaded when agent/skill completes
  4. Main thread context is unaffected
  5. MCP connection pooling could optimize repeated invocations

Prior Art

The Agent SDK already supports this pattern:

options=ClaudeAgentOptions(
    mcp_servers={
        "postgres": {"command": "npx", "args": ["postgres-mcp"]}
    }
)

This feature request is essentially asking for the same capability to be exposed in Claude Code's declarative agent/skill configuration.

Related

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗