Skip to content

Commit 07bef73

Browse files
committed
fix: Remove StrEnum due to versioning
1 parent 66d675f commit 07bef73

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
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
import types
6-
from enum import Enum, StrEnum
6+
from enum import Enum
77
from typing import Generic, Literal, TypeVar, Union, get_args, get_origin
88

99
from pydantic import BaseModel
@@ -38,7 +38,7 @@ class CancelledElicitation(BaseModel):
3838

3939

4040
# Primitive types allowed in elicitation schemas
41-
_ELICITATION_PRIMITIVE_TYPES = (str, int, float, bool, StrEnum)
41+
_ELICITATION_PRIMITIVE_TYPES = (str, int, float, bool, Enum)
4242

4343

4444
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
@@ -144,7 +144,7 @@ async def elicitation_callback(context: RequestContext[ClientSession, None], par
144144
assert field_name in result.content[0].text
145145

146146
# Test valid Enum types (should not fail validation)
147-
class Status(StrEnum):
147+
class Status(str, Enum):
148148
ACTIVE = "active"
149149
INACTIVE = "inactive"
150150

0 commit comments

Comments
 (0)