fastmcp.server.dependencies
Functions
without_injected_parameters
fn: Original function with Context and/or dependencies
- Async wrapper function without injected parameters
resolve_dependencies
- Filters out any dependency parameter names from user arguments (security)
- Resolves Docket dependencies
- Injects Context if needed
- Merges everything together
fn: The function to resolve dependencies forarguments: User arguments (may contain keys that match dependency names, which will be filtered out)
get_context
CurrentContext
- A dependency that resolves to the active Context instance
RuntimeError: If no active context found (during resolution)
CurrentDocket
- A dependency that resolves to the active Docket instance
RuntimeError: If not within a FastMCP server context
CurrentWorker
- A dependency that resolves to the active Worker instance
RuntimeError: If not within a FastMCP server context
CurrentFastMCP
- A dependency that resolves to the active FastMCP server
RuntimeError: If no server in context (during resolution)
get_server
- The active FastMCP server
RuntimeError: If no server in context
get_http_request
get_http_headers
content-length that cause issues if forwarded to downstream clients.
If include_all is True, all headers are returned.
get_access_token
- The access token if an authenticated user is available, None otherwise.
Classes
InMemoryProgress
In-memory progress tracker for immediate tool execution.
Provides the same interface as Progress but stores state in memory
instead of Redis. Useful for testing and immediate execution where
progress doesn’t need to be observable across processes.
Methods:
current
total
message
set_total
increment
set_message
Progress
FastMCP Progress dependency that works in both server and worker contexts.
Extends Docket’s Progress to handle two execution modes:
- In Docket worker: Uses the execution’s progress (standard Docket behavior)
- In FastMCP server: Uses in-memory progress (not observable remotely)

