Repository navigation
removing a tool or resource dynamically #711
Copy link
Copy link
Closed
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featureenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedready for workEnough information for someone to start working onEnough information for someone to start working on
Description
Activity
Hi @skunkwerk,
I've submitted a PR that addresses this feature request: #728
The PR adds enable() and disable() methods to tools, which allows temporarily disabling tools and re-enabling them when needed.
Would this solution work for your use case?
The PR adds enable() and disable() methods to tools, which allows temporarily disabling tools and re-enabling them when needed.
Would this solution work for your use case?
I can't speak for @skunkwerk, but for our use case (a multi-tenant MCP server), no, we need to actually remove the tool, not just disable it.
Right now, we are doing some hackery like
def _remove_tool_from_mcp(self, tool_name: str) -> bool: """Remove a tool from the MCP server. NOTE: There is no API available for tool removal, so we edit private members ourselves. """ if tool_name in mcp._tool_manager._tools: # noqa: SLF001 del mcp._tool_manager._tools[tool_name] # noqa: SLF001 return True return False
- addedenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedready for workEnough information for someone to start working onEnough information for someone to start working onP2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable feature
on Oct 3, 2025 - linked a pull request that will close this issuefeat: add ability to remove tools #1322
on Oct 3, 2025 Should be addressed by #1322 once we land that
- marked Dynamic load or unload mcp tools #599 as a duplicate of this issue
on Oct 7, 2025
Metadata
Metadata
Assignees
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featureenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedready for workEnough information for someone to start working onEnough information for someone to start working on
Is your feature request related to a problem? Please describe.
There doesn't seem to be a way to call remove_tool or remove_resource, such as in the tool manager
Describe the solution you'd like
If this is indeed the case, I'm happy to submit a PR to add those methods to the resource & tool managers in fastMCP
Describe alternatives you've considered
None