The request a middleware wraps.
target is the tool name, the resource URI or the prompt name; for
completion/complete the prompt name or the URI template; for
skills/get the URI of the skill's SKILL.md. payload holds the
request's parameters. On a list request, which runs middleware only around
a visibility, once per registration, target is that registration's
name, URI or URI template and payload is None.
headers are the HTTP request's, empty on stdio and in process;
session_id is its mcp-session-id header.
Attributes#
| Attribute | Type | Description |
|---|---|---|
method | MiddlewareMethod | |
target | str | |
payload | object | |
request_context | RequestContext | |
headers | Mapping[str, str] | |
session_id | str | None |
Functions#
__init__#
__init__(*, method, target, payload, request_context, headers, session_id) -> None| Parameter | Type | Description |
|---|---|---|
method | MiddlewareMethod | |
target | str | |
payload | object | |
request_context | RequestContext | |
headers | Mapping[str, str] | |
session_id | str | None |