MCPcopy
hub / github.com/modelcontextprotocol/python-sdk / _send_message

Function _send_message

src/mcp/client/sse.py:122–133  ·  view source on GitHub ↗
(session_message: SessionMessage)

Source from the content-addressed store, hash-verified

120 async with write_stream_reader, write_stream:
121
122 async def _send_message(session_message: SessionMessage) -> None:
123 logger.debug(f"Sending client message: {session_message}")
124 response = await client.post(
125 endpoint_url,
126 json=session_message.message.model_dump(
127 by_alias=True,
128 mode="json",
129 exclude_unset=True,
130 ),
131 )
132 response.raise_for_status()
133 logger.debug(f"Client message sent successfully: {response.status_code}")
134
135 async for session_message in write_stream_reader:
136 sender_ctx = write_stream_reader.last_context

Callers 1

post_writerFunction · 0.85

Calls 1

debugMethod · 0.80

Tested by

no test coverage detected