fastmcp.server.transforms.version_filter
Version filter transform for filtering components by version range.
Classes
VersionFilter
Filters components by version range.
When applied to a provider or server, components within the version range
are visible, and unversioned components are included by default. Within
that filtered set, the highest version of each component is exposed to
clients (standard deduplication behavior). Set
include_unversioned=False to exclude unversioned components.
Parameters mirror comparison operators for clarity:
Versions < 3.0 (v1 and v2)
server.add_transform(VersionFilter(version_lt=“3.0”))Versions >= 2.0 and < 3.0 (only v2.x)
server.add_transform(VersionFilter(version_gte=“2.0”, version_lt=“3.0”)) Works with any version string - PEP 440 (1.0, 2.0) or dates (2025-01-01). Args:version_gte: Versions >= this value pass through.version_lt: Versions < this value pass through.include_unversioned: Whether unversioned components (version=None) should pass through the filter. Defaults to True.

