Skip to content

Feature Request: Add ability to unregister/deregister tools at runtime in TypeScript SDK #898

@dharmik-at

Description

@dharmik-at

I'm building an MCP server in TypeScript using @modelcontextprotocol/sdk.
I can dynamically register tools using registerTool(), but there is no documented way to unregister/deregister tools at runtime.

This is problematic for scenarios where:

  • Tools are user/session-specific and need to be removed when a user disconnects.
  • Tools are loaded from a database and must be refreshed dynamically.
  • We want to implement plugin-like behavior with hot-swapping tools.

A method like unregisterTool(name: string) that removes a previously registered tool from the server's active registry.

  • Maintaining my own registry and filtering calls manually, but this feels like duplicating what the SDK should already manage.
  • Restarting the server when tool sets change (not ideal for production).

Additional context
This feature would allow more flexible, real-time management of tools in MCP servers.
Is this something planned, or would you accept a PR implementing it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions