docs: fix InMemoryTaskStore import path in experimental tasks docs#2739
Open
vidigoat wants to merge 1 commit into
Open
docs: fix InMemoryTaskStore import path in experimental tasks docs#2739vidigoat wants to merge 1 commit into
vidigoat wants to merge 1 commit into
Conversation
The docs import InMemoryTaskStore from the package root:
from mcp.shared.experimental.tasks import InMemoryTaskStore
but the class is not re-exported there, so this raises ImportError. The
package __init__ explicitly directs callers to import from the submodule,
and all library code and tests use:
from mcp.shared.experimental.tasks.in_memory_task_store import InMemoryTaskStore
Update both doc snippets (tasks.md, tasks-client.md) to the working path.
Signed-off-by: Vidit Patankar <vidit.patankar16@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The experimental tasks docs show:
but
InMemoryTaskStoreis not re-exported from themcp.shared.experimental.taskspackage, so copying this line raisesImportError: cannot import name 'InMemoryTaskStore' from 'mcp.shared.experimental.tasks'.The package's own
__init__.pydirects callers to the submodule:and all library code and tests use that path (e.g.
src/mcp/server/experimental/task_support.py,src/mcp/server/lowlevel/experimental.py,tests/experimental/tasks/test_elicitation_scenarios.py).This fixes both doc snippets to the working import:
Files:
docs/experimental/tasks.md,docs/experimental/tasks-client.md.Verification
uv syncthen running the old line reproduces theImportError; the new line imports successfully. Docs-only change.