-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
MCP Tools Bloating Claude Code Context - Suggestion for Lightweight Version
Issue Summary
The Task Master MCP integration is consuming a significant portion of Claude Code's context window, which can impact performance and limit available context for actual development work.
Context Usage Analysis
From a real Claude Code session with Task Master MCP enabled:
Context Usage: 178k/200k tokens (89%)
Breakdown:
- MCP tools: 63.7k tokens (31.8%) ← Task Master is major contributor
- System tools: 11.9k tokens (6.0%)
- Messages: 49.8k tokens (24.9%)
- Reserved: 45.0k tokens (22.5%)
- System prompt: 7.3k tokens (3.6%)
Task Master MCP Tools Consuming Context:
- 59 total MCP tool definitions from task-master-ai
- Each tool definition: ~600-1,500 tokens
- Estimated total for Task Master alone: ~45-50k tokens (22-25% of total context)
Example Tool Definitions:
mcp__task-master-ai__initialize_project: 969 tokens
mcp__task-master-ai__models: 941 tokens
mcp__task-master-ai__parse_prd: 959 tokens
mcp__task-master-ai__analyze_project_complexity: 892 tokens
mcp__task-master-ai__expand_task: 787 tokens
mcp__task-master-ai__expand_all: 787 tokens
... (59 tools total)
Problem Statement
-
Context Exhaustion: With Task Master MCP enabled, users start with only ~135k usable tokens (200k - 65k MCP tools), reducing available context for:
- Code files being edited
- Conversation history
- Project context
- Documentation
-
Most Tools Rarely Used: Many Task Master functions are infrequently needed during typical coding sessions:
- Project initialization (once per project)
- PRD parsing (once per project)
- Complex task operations (periodic)
- Tag management (occasional)
-
Cognitive Overhead: 59 tool definitions in the context can also impact Claude's decision-making and response quality.
Proposed Solutions
Option 1: Lightweight MCP Profile (Recommended)
Create a "lite" MCP configuration that only exposes the most frequently used tools:
Essential Tools (~15 tools, estimated ~10-12k tokens):
{
"command": "task-master-mcp",
"args": ["--profile", "lite"],
"tools": [
"get_tasks",
"get_task",
"next_task",
"set_task_status",
"add_task",
"add_subtask",
"update_task",
"update_subtask",
"remove_task",
"generate",
"complexity_report",
"validate_dependencies",
"fix_dependencies",
"research",
"list_tags"
]
}Full Profile (current): All 59 tools for comprehensive task management via CLI
Option 2: Dynamic Tool Loading
Only load tools when needed, reducing initial context:
- Start with core 10 tools
- Load additional tools on demand
- Cache loaded tools for session
Option 3: CLI-First Recommendation
Add prominent documentation recommending:
- CLI for heavy operations: Initialization, PRD parsing, bulk operations
- MCP for coding workflow: Task status, next task, quick updates
- Hybrid approach: Best of both worlds
Impact on Users
Current Experience (59 tools):
- ❌ 31.8% of context consumed by MCP tools
- ❌ Faster context exhaustion during long sessions
- ❌ Less room for code and conversation history
- ✅ All features available via MCP
With Lightweight Profile (15 tools):
- ✅ ~12-15k tokens for MCP tools (7-8% of context)
- ✅ More available context for actual development
- ✅ Faster Claude response times
- ✅ Core workflow tools still available
⚠️ Advanced features require CLI
Suggested Implementation
1. Add --profile flag to MCP server:
// server.ts
const profile = args.includes('--profile=lite') ? 'lite' : 'full';
const tools = profile === 'lite'
? LITE_TOOLS // 15 essential tools
: FULL_TOOLS; // All 59 tools2. Update MCP configuration examples:
For Claude Code (recommended lite profile):
{
"mcpServers": {
"task-master-ai": {
"command": "task-master-mcp",
"args": ["--profile", "lite"],
"description": "Lightweight Task Master (15 essential tools)"
}
}
}For Cline/Windsurf (full profile):
{
"mcpServers": {
"task-master-ai": {
"command": "task-master-mcp",
"args": ["--profile", "full"],
"description": "Full Task Master (59 tools)"
}
}
}3. Add context usage warning to README:
## ⚠️ Context Usage Considerations
Task Master's MCP integration exposes 59 tools, consuming ~45-50k tokens
(22-25% of Claude Code's context window).
**Recommendations:**
- **Claude Code**: Use `--profile lite` (15 essential tools, ~12k tokens)
- **CLI for setup**: Run initialization, PRD parsing via CLI
- **MCP for workflow**: Use MCP for task status, updates during codingBenefits
- Performance: Reduced context consumption → faster responses
- User Choice: Opt-in to full toolset when needed
- Better Defaults: Lite profile optimized for coding workflow
- Backward Compatible: Existing users unaffected (full profile default)
- CLI + MCP Synergy: Encourages best-practice hybrid usage
Questions for Maintainers
- Would you be open to a
--profileflag implementation? - Should lite profile be the default for Claude Code users?
- Are there other tools that should be in the "essential" list?
- Would you prefer a configuration file approach instead of CLI flags?
Volunteer Offer
I'm happy to contribute a PR implementing the lightweight profile if this approach sounds good to the team.
Environment:
- Task Master version: [latest]
- Claude Code version: [latest]
- MCP SDK version: [check]
- Context window: 200k tokens (Claude Sonnet 4.5)