Revert "refactor: reorganize message handling for better type safety and clar…" (#282)
Some checks failed
Main branch checks / checks (push) Has been cancelled

This reverts commit 9d0f2daddb.
This commit is contained in:
Marcelo Trylesinski 2025-03-14 10:50:46 +01:00 • committed by GitHub
commit 7196604468
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -42,15 +42,14 @@ from typing import Any, TypeVar
import anyio
import anyio.lowlevel
from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream
from pydantic import AnyUrl
import mcp.types as types
from mcp.server.models import InitializationOptions
from mcp.shared.session import (
BaseSession,
ReadStream,
RequestResponder,
WriteStream,
)
@ -77,8 +76,8 @@ class ServerSession(
def __init__(
self,
read_stream: ReadStream,
write_stream: WriteStream,
read_stream: MemoryObjectReceiveStream[types.JSONRPCMessage | Exception],
write_stream: MemoryObjectSendStream[types.JSONRPCMessage],
init_options: InitializationOptions,
) -> None:
super().__init__(