MCPcopy Index your code
hub / github.com/modelcontextprotocol/python-sdk / server_on_request

Function server_on_request

tests/shared/test_context.py:29–32  ·  view source on GitHub ↗
(ctx: DCtx, method: str, params: Mapping[str, Any] | None)

Source from the content-addressed store, hash-verified

27 captured: list[BaseContext[TransportContext]] = []
28
29 async def server_on_request(ctx: DCtx, method: str, params: Mapping[str, Any] | None) -> dict[str, Any]:
30 bctx = BaseContext(ctx)
31 captured.append(bctx)
32 return {}
33
34 async with running_pair(direct_pair, server_on_request=server_on_request) as (client, *_):
35 with anyio.fail_after(5):

Callers

nothing calls this directly

Calls 6

send_raw_requestMethod · 0.95
notifyMethod · 0.95
report_progressMethod · 0.95
BaseContextClass · 0.90
ClientPeerClass · 0.90
pingMethod · 0.45

Tested by

no test coverage detected