[Feature Request] Expose MCP Server Toggle as a Claude-Invokable Tool for Skills
Problem
Currently, MCP server toggling via /mcp is UI-only. While #10447 requests CLI commands for hook automation (external), there's no way for Claude itself to programmatically toggle MCP servers during a conversation.
This prevents skills from dynamically managing MCP server lifecycle based on context.
Proposed Solution
Expose an internal tool that Claude can invoke:
McpServerToggle(server_name: string, enabled: bool) -> { success: bool, server: string, enabled: bool }
Or similar, mirroring what the /mcp UI does internally.
Use Case: Context-Aware Skills
A skill could intelligently enable/disable MCP servers based on the task:
# Example: database-admin.md skill
When activated, this skill:
1. Enables the `postgres-mcp` server
2. Performs database operations
3. Disables `postgres-mcp` when done to free context
This allows skills to be self-contained - they bring their own MCP dependencies online only when needed.
Why This Differs from #10447
| #10447 | This Request |
|--------|--------------|
| CLI commands for hooks/scripts | Tool Claude invokes directly |
| External automation | Internal tool call |
| Triggered by hook events | Triggered by Claude/skill logic |
Both are valuable and complementary. #10447 enables automation at session boundaries; this enables dynamic toggling mid-conversation based on Claude's reasoning.
Benefits
- Reduced context usage - MCP servers enabled only when needed
- Self-contained skills - Skills manage their own dependencies
- Dynamic workflows - Claude can adapt available tools to the task
- Composability - Chain skills that require different MCP servers
Implementation Notes
- Should respect existing approval workflows and enterprise policies
- Session-scoped only (no config file changes)
- Could log toggles for auditability
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗