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

Method send_raw_request

src/mcp/server/connection.py:218–235  ·  view source on GitHub ↗

Send a raw request on the standalone stream. Low-level `Outbound` channel. Prefer the typed `send_request` or the convenience methods below; use this directly only for off-spec messages. `opts` carries per-call `timeout` / `on_progress` / resumption hints; see `CallO

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

Source from the content-addressed store, hash-verified

216 return self.client_params is not None or self.initialized.is_set()
217
218 async def send_raw_request(
219 self,
220 method: str,
221 params: Mapping[str, Any] | None,
222 opts: CallOptions | None = None,
223 ) -> dict[str, Any]:
224 """Send a raw request on the standalone stream.
225
226 Low-level `Outbound` channel. Prefer the typed `send_request` or the
227 convenience methods below; use this directly only for off-spec
228 messages. `opts` carries per-call `timeout` / `on_progress` /
229 resumption hints; see `CallOptions`.
230
231 Raises:
232 MCPError: The peer responded with an error.
233 NoBackChannelError: `has_standalone_channel` is `False`.
234 """
235 return await self.outbound.send_raw_request(method, params, opts)
236
237 @overload
238 async def send_request(

Callers 3

send_requestMethod · 0.95
pingMethod · 0.95
send_requestMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected