Skip to content

Commit 8914490

Browse files
committed
update some doc formatting
1 parent 8b04353 commit 8914490

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

docs/migration.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -772,24 +772,25 @@ The session hierarchy has been refactored to support pluggable transport impleme
772772

773773
#### New `AbstractBaseSession` Protocol
774774

775-
A new runtime-checkable Protocol, AbstractBaseSession, establishes a transport-agnostic contract for all MCP sessions. It ensures that client and server sessions share a consistent communication interface regardless of the transport used.
775+
A new runtime-checkable Protocol, `AbstractBaseSession`, establishes a transport-agnostic contract for all MCP sessions. It ensures that client and server sessions share a consistent communication interface regardless of the transport used.
776776

777-
**Key characteristics of `AbstractBaseSession`:**
777+
##### Key characteristics of `AbstractBaseSession`
778778

779-
To maintain a clean architectural boundary, AbstractBaseSession is a pure interface—it defines what methods must exist but does not manage how they work.
779+
To maintain a clean architectural boundary, `AbstractBaseSession` is a pure interface—it defines what methods must exist but does not manage how they work.
780780

781781
* **No State Management**: The protocol does not handle internal machinery like task groups, response streams, or buffers.
782782

783-
* **Implementation Ownership**: The concrete class is now fully responsible for managing its own state and lifecycle for how it sends and receives data.
783+
* **Implementation Ownership**: The concrete class is fully responsible for managing its own state and lifecycle for how it sends and receives data.
784784

785-
* **No Inheritance Needed**: As a structural protocol, you no longer need to call super().**init**() or inherit from a base class to satisfy the contract.
785+
* **No Inheritance Needed**: As a structural protocol, you no longer need to call **super().\_\_init\_\_()** or inherit from a base class to satisfy the contract.
786786

787-
**Motivation: Interface vs. Implementation**
788-
Previously, all custom sessions were required to inherit from BaseSession, which locked them into a specific architecture involving memory streams and JSON-RPC message routing, but now users have the flexibility to implement their own transport logic.
787+
##### Motivation: Interface vs. Implementation
789788

790-
BaseSession (Implementation): Remains available for transports that follow the standard pattern of reading and writing JSON-RPC messages over streams. You can continue to inherit from this if you want the SDK to handle message linking and routing for you.
789+
Previously, all custom sessions were required to inherit from BaseSession, which locked them into a specific architecture involving memory streams and JSON-RPC message routing, but with this change, users have the flexibility to implement their own transport logic with either of the following options:
791790

792-
AbstractBaseSession (Interface): A new stateless protocol for transports that do not use standard streams or JSON-RPC. It defines the "what" (method signatures) without enforcing the "how" (internal machinery).
791+
* **BaseSession (Implementation)**: Remains available for transports that follow the standard pattern of reading and writing JSON-RPC messages over streams. You can continue to inherit from this if you want the SDK to handle message linking and routing for you.
792+
793+
* **AbstractBaseSession (Interface)**: A new stateless protocol for transports that do not use standard streams or JSON-RPC. It defines the "what" (method signatures) without enforcing the "how" (internal machinery).
793794

794795
**Before:**
795796

0 commit comments

Comments
 (0)