modelcontextprotocol / modelcontextprotocol/python-sdk

feat: enhance dynamic tool management with notifications and enable/disable

Open
#1,429 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs decision P1 v2
Dominant language
Python
Stars
24.3k
Forks
4k
Avg merge
1d 1h
Merged PRs (30d)
31

Description

Summary

Enhance the Python SDK's dynamic tool management capabilities to match the TypeScript SDK by adding:

  1. Automatic tools/list_changed notifications when tools are added/removed
  2. Tool enable/disable functionality (temporary hiding without removal)

Background

The Python SDK currently supports adding and removing tools dynamically (see #1322), but lacks two key features present in the TypeScript SDK:

1. List Changed Notifications

The TypeScript SDK automatically sends notifications/tools/list_changed when tools are modified. This allows clients to know when they should refresh their tool list.

Python SDK gap: Currently, when calling add_tool() or remove_tool(), clients are not notified of the change and may show stale tool lists.

2. Enable/Disable Tools

The TypeScript SDK provides enable() and disable() methods on tools:

const tool = server.tool("myTool", ..., async () => { ... });
tool.disable()  // Hides from list_tools, blocks calls
tool.enable()   // Re-enables the tool
tool.remove()   // Permanently removes

Benefits:

  • Temporarily hide tools without losing registration
  • Re-enable tools without re-registering
  • Useful for permission-based or state-based tool visibility

Python SDK gap: Only permanent removal via remove_tool() is supported. No way to temporarily disable/re-enable tools.

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Python SDK entry points for add_tool(), remove_tool(), list_tools(), and tool invocation, then compare their behavior with the referenced TypeScript SDK dynamic-server implementation. Done means added and removed tools trigger tools/list_changed notifications, while disabled tools are hidden and blocked, can be re-enabled, and remain removable.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.