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:
- Configure MCPs that are only available to specific agents or skills
- Keep MCPs disabled in the main conversation to reduce context bloat while still having them available to specialized agents/skills
- 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
linearMCP in main thread → subagents AND skills can't use it either - If I enable
linearMCP → context bloat in main thread even when not using Linear - The
toolsfield in agent definitions can only filter inherited tools, not add new ones - The
allowed-toolsfield 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
- Reduced context bloat - Main conversation stays lean
- Better separation of concerns - Agents and skills are truly specialized
- Improved performance - Only load MCPs when needed
- Cleaner architecture - Agents and skills become self-contained units with declared dependencies
- 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-manageragent for Linear operations (loads Linear MCP only when invoked) - Use
github-workflow-manageragent for Git operations (loads GitHub MCP only when invoked) - Use
/linearskill for quick Linear queries (loads Linear MCP only when skill invoked) - Use
/scrapeskill 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
- Add
mcpsfield to agent and skill configuration schemas - When agent/skill is invoked, dynamically load specified MCPs into that context
- MCPs are unloaded when agent/skill completes
- Main thread context is unaffected
- 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
- Subagent documentation: https://docs.anthropic.com/en/docs/claude-code/sub-agents
- Skills documentation: https://docs.anthropic.com/en/docs/claude-code/skills
- MCP documentation: https://modelcontextprotocol.io/
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗