Support for http request injection propagation to tools (#816)
This commit is contained in:
parent
532b1176f9
commit
70014a2bbb
1 changed files with 413 additions and 35 deletions
|
|
@ -8,11 +8,13 @@ from mcp.types import RequestId, RequestParams
|
|||
|
||||
SessionT = TypeVar("SessionT", bound=BaseSession[Any, Any, Any, Any, Any])
|
||||
LifespanContextT = TypeVar("LifespanContextT")
|
||||
RequestT = TypeVar("RequestT", default=Any)
|
||||
|
||||
|
||||
@dataclass
|
||||
class RequestContext(Generic[SessionT, LifespanContextT]):
|
||||
class RequestContext(Generic[SessionT, LifespanContextT, RequestT]):
|
||||
request_id: RequestId
|
||||
meta: RequestParams.Meta | None
|
||||
session: SessionT
|
||||
lifespan_context: LifespanContextT
|
||||
request: RequestT | None = None
|
||||
|
|
|
|||
Loading…
Reference in a new issue