[BUG] `StaticToolFilter(allowed_tool_names=[])` allows all MCP tools instead of blocking all
Author: truecallerabrehamCreated Sep 26, 2026Updated Sep 29, 2026
Description
Passing an explicit empty list allowed_tool_names=[] to StaticToolFilter or create_static_tool_filter allows every non-blocked MCP tool instead of blocking all tools.
In StaticToolFilter.__init__ (lib/crewai/src/crewai/mcp/filters.py), self.allowed_tool_names = set(allowed_tool_names or []) converts both allowed_tool_names=None and allowed_tool_names=[] into set(). In __call__, if self.allowed_tool_names: evaluates to False when the allowlist is empty, so __call__ falls through to return True.
Steps to Reproduce
from crewai.mcp.filters import create_static_tool_filter
tool_filter = create_static_tool_filter(allowed_tool_names=[])
print(tool_filter({"name": "read_file"})) # Returns True instead of FalseExpected behavior
allowed_tool_names=None(the default) should allow all non-blocked tools.allowed_tool_names=[](an explicit empty allowlist) should returnFalsefor all tools.
Operating System
Windows 11
Python Version
3.12
crewAI Version
main
Possible Solution
Track whether allowed_tool_names was explicitly passed (allowed_tool_names is not None) in StaticToolFilter so an empty allowlist checks membership against the empty set and returns False.
Source: crewAIInc/crewAI