---
title: enabled
sidebarTitle: enabled
---

# `fastmcp.server.transforms.enabled`


Enabled transform for marking component enabled state.

Each Enabled instance marks components via internal metadata. Multiple
enabled transforms can be stacked - later transforms override earlier ones.
Final filtering happens at the Provider level.


## Functions

### `is_enabled` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/transforms/enabled.py#L273" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
is_enabled(component: FastMCPComponent) -> bool
```


Check if component is enabled.

Returns True if:
- No enabled mark exists (default is enabled)
- Enabled mark is True

Returns False if enabled mark is False.

**Args:**
- `component`: Component to check.

**Returns:**
- True if component should be enabled/visible to clients.


## Classes

### `Enabled` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/transforms/enabled.py#L40" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


Sets enabled state on matching components.

Does NOT filter inline - just marks components with enabled state.
Later transforms in the chain can override earlier marks.
Final filtering happens at the Provider level after all transforms run.


**Methods:**

#### `list_tools` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/transforms/enabled.py#L194" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
list_tools(self, call_next: ListToolsNext) -> Sequence[Tool]
```

Mark tools by enabled state.


#### `get_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/transforms/enabled.py#L199" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
get_tool(self, name: str, call_next: GetToolNext) -> Tool | None
```

Mark tool if found.


#### `list_resources` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/transforms/enabled.py#L212" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
list_resources(self, call_next: ListResourcesNext) -> Sequence[Resource]
```

Mark resources by enabled state.


#### `get_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/transforms/enabled.py#L217" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
get_resource(self, uri: str, call_next: GetResourceNext) -> Resource | None
```

Mark resource if found.


#### `list_resource_templates` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/transforms/enabled.py#L234" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
list_resource_templates(self, call_next: ListResourceTemplatesNext) -> Sequence[ResourceTemplate]
```

Mark resource templates by enabled state.


#### `get_resource_template` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/transforms/enabled.py#L241" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
get_resource_template(self, uri: str, call_next: GetResourceTemplateNext) -> ResourceTemplate | None
```

Mark resource template if found.


#### `list_prompts` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/transforms/enabled.py#L258" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
list_prompts(self, call_next: ListPromptsNext) -> Sequence[Prompt]
```

Mark prompts by enabled state.


#### `get_prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/transforms/enabled.py#L263" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
get_prompt(self, name: str, call_next: GetPromptNext) -> Prompt | None
```

Mark prompt if found.

