Skip to content

Commit 80756e9

Browse files
committed
fix markdownlint
1 parent d6a54df commit 80756e9

File tree

2 files changed

+1145
-1143
lines changed

2 files changed

+1145
-1143
lines changed

docs/migration.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,10 @@ from mcp.shared._context import SessionT_co
555555
The session hierarchy now uses a new **runtime-checkable Protocol** called `AbstractBaseSession` to define the shared contract for all MCP sessions. This protocol enables structural subtyping, allowing different transport implementations to be used interchangeably without requiring rigid inheritance.
556556

557557
Key characteristics of `AbstractBaseSession`:
558-
1. **Pure Interface**: It is a structural protocol with no implementation state or `__init__` method.
559-
2. **Simplified Type Parameters**: It takes two parameters: `AbstractBaseSession[SendRequestT_contra, SendNotificationT_contra]`. Contravariant variance is used for these parameters to ensure that sessions can be used safely in generic contexts (like `RequestContext`).
560-
3. **BaseSession Implementation**: The concrete implementation logic (state management, response routing) is provided by the `BaseSession` class, which satisfies the protocol.
558+
559+
1. **Pure Interface**: It is a structural protocol with no implementation state or `__init__` method.
560+
2. **Simplified Type Parameters**: It takes two parameters: `AbstractBaseSession[SendRequestT_contra, SendNotificationT_contra]`. Contravariant variance is used for these parameters to ensure that sessions can be used safely in generic contexts (like `RequestContext`).
561+
3. **BaseSession Implementation**: The concrete implementation logic (state management, response routing) is provided by the `BaseSession` class, which satisfies the protocol.
561562

562563
**Before:**
563564

@@ -627,7 +628,8 @@ ReceiveResultT = TypeVar("ReceiveResultT", bound=BaseModel)
627628
**After:**
628629

629630
```python
630-
ReceiveResultT_co = TypeVar("ReceiveResultT_co", bound=BaseModel, covariant=True)
631+
ReceiveResultT_co =
632+
TypeVar("ReceiveResultT_co", bound=BaseModel, covariant=True)
631633
```
632634

633635
#### `BaseClientSession` is now a Protocol

0 commit comments

Comments
 (0)