Skip to content

Commit 97b156d

Browse files
committed
fix: Remove StrEnum due to versioning
1 parent 78f270c commit 97b156d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/mcp/server/elicitation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import types
66
from collections.abc import Sequence
7-
from enum import Enum, StrEnum
7+
from enum import Enum
88
from typing import Generic, Literal, TypeVar, Union, get_args, get_origin
99

1010
from pydantic import BaseModel
@@ -47,7 +47,7 @@ class AcceptedUrlElicitation(BaseModel):
4747

4848

4949
# Primitive types allowed in elicitation schemas
50-
_ELICITATION_PRIMITIVE_TYPES = (str, int, float, bool, StrEnum)
50+
_ELICITATION_PRIMITIVE_TYPES = (str, int, float, bool, Enum)
5151

5252

5353
def _validate_elicitation_schema(schema: type[BaseModel]) -> None:

tests/server/fastmcp/test_elicitation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Test the elicitation feature using stdio transport.
33
"""
44

5-
from enum import StrEnum
5+
from enum import Enum
66
from typing import Any
77

88
import pytest
@@ -149,7 +149,7 @@ async def elicitation_callback(
149149
assert field_name in result.content[0].text
150150

151151
# Test valid Enum types (should not fail validation)
152-
class Status(StrEnum):
152+
class Status(str, Enum):
153153
ACTIVE = "active"
154154
INACTIVE = "inactive"
155155

0 commit comments

Comments
 (0)