[FEATURE] SDK Support for Enabling/Disabling MCPs
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
The Claude Code CLI allows a user to manage their MCP servers using the slash command /mcp [enable|disable server-name]]. This type of control is absent in the Claude Code SDK.
While the SDK allows passing a list of MCP servers via the mcpServers option when calling query, we use presets in the SDK to automatically load MCP servers based on users' environments so we have no control over enabling/disabling servers selectively.
Proposed Solution
Support for a session-scoped method that allows a developer to enable/disable a connected MCP server.
Alternative Solutions
The SDK does not support any form of MCP management in its current state.
Priority
High - Significant impact on productivity
Feature Category
Developer tools/SDK
Use Case Example
_No response_
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗