Skip to content

Commit 66598b1

Browse files
committed
Another attempt to fix the issue in Python 3.10
1 parent e14e50b commit 66598b1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tools/json.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
from src.common.server import mcp
77

88
# Define JsonType for type checking to match redis-py definition
9+
# Use object as runtime type to avoid issubclass() issues with Any in Python 3.10
910
if TYPE_CHECKING:
1011
JsonType = Union[
1112
str, int, float, bool, None, Mapping[str, "JsonType"], List["JsonType"]
1213
]
1314
else:
14-
# Use Any at runtime to avoid Pydantic issues with recursive types
15-
JsonType = Any
15+
# Use object at runtime to avoid MCP framework issubclass() issues
16+
JsonType = object
1617

1718

1819
@mcp.tool()

0 commit comments

Comments
 (0)