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

Method send_raw_request

src/mcp/shared/context.py:62–74  ·  view source on GitHub ↗

Send a request to the peer on the back-channel. Raises: MCPError: The peer responded with an error. NoBackChannelError: `can_send_request` is `False`.

(
        self,
        method: str,
        params: Mapping[str, Any] | None,
        opts: CallOptions | None = None,
    )

Source from the content-addressed store, hash-verified

60 return self._meta
61
62 async def send_raw_request(
63 self,
64 method: str,
65 params: Mapping[str, Any] | None,
66 opts: CallOptions | None = None,
67 ) -> dict[str, Any]:
68 """Send a request to the peer on the back-channel.
69
70 Raises:
71 MCPError: The peer responded with an error.
72 NoBackChannelError: `can_send_request` is `False`.
73 """
74 return await self._dctx.send_raw_request(method, params, opts)
75
76 async def notify(self, method: str, params: Mapping[str, Any] | None, opts: CallOptions | None = None) -> None:
77 """Send a notification to the peer on the back-channel."""

Callers 1

server_on_requestFunction · 0.95

Calls

no outgoing calls

Tested by 1

server_on_requestFunction · 0.76