{"record":{"id":"b98f00d862b8dbd1","repo":"PrefectHQ/fastmcp","slug":"name-r-moved-to-the-fastmcp-tasks-package-insta","errorCode":null,"errorMessage":"{name!r} moved to the fastmcp-tasks package. Install it with `pip install 'fastmcp[tasks]'` and import from `fastmcp_tasks.dependencies`.","messagePattern":"(.+?) moved to the fastmcp-tasks package\\. Install it with `pip install 'fastmcp\\[tasks\\]'` and import from `fastmcp_tasks\\.dependencies`\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"fastmcp_slim/fastmcp/dependencies.py","lineNumber":50,"sourceCode":"    \"CurrentHeaders\",\n    \"CurrentRequest\",\n    \"CycleError\",\n    \"Dependency\",\n    \"Depends\",\n    \"Progress\",\n    \"ProgressLike\",\n    \"Shared\",\n    \"TokenClaim\",\n]\n\n# Docket-specific dependencies moved to the fastmcp-tasks package. Point users\n# there instead of raising a bare AttributeError.\n_MOVED_TO_TASKS = {\"CurrentDocket\", \"CurrentWorker\"}\n\n\ndef __getattr__(name: str) -> Any:\n    if name in _MOVED_TO_TASKS:\n        raise ImportError(\n            f\"{name!r} moved to the fastmcp-tasks package. Install it with \"\n            f\"`pip install 'fastmcp[tasks]'` and import from \"\n            f\"`fastmcp_tasks.dependencies`.\"\n        )\n    raise AttributeError(f\"module {__name__!r} has no attribute {name!r}\")\n","sourceCodeStart":32,"sourceCodeEnd":56,"githubUrl":"https://github.com/PrefectHQ/fastmcp/blob/1f021142978e0861cd910c8df4e8074bc7cf3978/fastmcp_slim/fastmcp/dependencies.py#L32-L56","documentation":"fastmcp.dependencies defines a module-level __getattr__ that intercepts names moved to the separate fastmcp-tasks package. Requesting CurrentDocket or CurrentWorker without that package installed raises this ImportError with install instructions instead of silently failing.","triggerScenarios":"`from fastmcp.dependencies import CurrentDocket` (or CurrentWorker) in an environment where the optional fastmcp-tasks extra is not installed.","commonSituations":"Following task/docket documentation without installing the `fastmcp[tasks]` extra; upgrading fastmcp where these dependencies were split out into the tasks package; fresh environments/CI missing the optional dependency.","solutions":["Install the extra: pip install 'fastmcp[tasks]' (or add it to your dependency group)","Change the import to `from fastmcp_tasks.dependencies import CurrentDocket` (or CurrentWorker)","If you don't need task dependencies, remove the import and use standard fastmcp dependencies instead"],"exampleFix":"// before\nfrom fastmcp.dependencies import CurrentDocket\n\n// after\n# pip install 'fastmcp[tasks]'\nfrom fastmcp_tasks.dependencies import CurrentDocket","handlingStrategy":"try-catch","validationCode":"import importlib.util\nif importlib.util.find_spec(\"fastmcp_tasks\") is None:\n    raise RuntimeError(\"Install the tasks extra: pip install 'fastmcp[tasks]'\")","typeGuard":"def tasks_extra_installed() -> bool:\n    import importlib.util\n    return importlib.util.find_spec(\"fastmcp_tasks\") is not None","tryCatchPattern":"try:\n    from fastmcp.dependencies import CurrentDocket\nexcept ImportError as e:\n    # message tells you to install 'fastmcp[tasks]' and import from fastmcp_tasks.dependencies\n    from fastmcp_tasks.dependencies import CurrentDocket  # after installing the extra","preventionTips":["Add 'fastmcp[tasks]' to your dependency file whenever you use docket/task dependencies","Import CurrentDocket/CurrentWorker directly from fastmcp_tasks.dependencies","Keep extras and code imports in sync in CI (import-lint check)"],"tags":["python","import-error","optional-dependency","fastmcp"],"backgroundTag":"missing-optional-dependency","analyzedSha":"1f021142978e0861cd910c8df4e8074bc7cf3978","analyzedAt":"2026-08-29T14:31:16.082Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}