Skip to content

Commit 91f64db

Browse files
Fixed crash when using mcp.tool decorator (#1297)
1 parent 719e09a commit 91f64db

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Releases prior to 7.0 has been removed from this file to declutter search result
1111
### Fixed
1212

1313
- demos: Use Etherscan v2 API endpoints in EVM templates.
14+
- mcp: Fixed crash when using `mcp.tool` decorator.
1415

1516
### Changed
1617

src/dipdup/mcp.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
from __future__ import annotations
2-
1+
# NOTE: Careful there, PEP 563 annotations break `mcp` library!
2+
# from __future__ import annotations
33
import logging
44
import traceback
55
from collections.abc import Awaitable
66
from collections.abc import Callable
7-
from typing import TYPE_CHECKING
87
from typing import Any
98
from typing import TypeVar
109
from typing import cast
@@ -21,13 +20,11 @@
2120
_logger = logging.getLogger(__name__)
2221

2322

23+
from collections.abc import Iterable
24+
2425
import mcp.server
2526
import mcp.types as types
2627

27-
if TYPE_CHECKING:
28-
from collections.abc import Iterable
29-
30-
3128
# NOTE: Global context management
3229
_ctx: McpContext | None = None
3330

0 commit comments

Comments
 (0)