MCPcopy Create free account
hub / github.com/Noumena-Network/code / sendMcpMessage

Method sendMcpMessage

src/cli/structuredIO.ts:757–772  ·  view source on GitHub ↗

* Sends an MCP message to an SDK server and waits for the response

(
    serverName: string,
    message: JSONRPCMessage,
  )

Source from the content-addressed store, hash-verified

755 * Sends an MCP message to an SDK server and waits for the response
756 */
757 async sendMcpMessage(
758 serverName: string,
759 message: JSONRPCMessage,
760 ): Promise<JSONRPCMessage> {
761 const response = await this.sendRequest<{ mcp_response: JSONRPCMessage }>(
762 {
763 subtype: 'mcp_message',
764 server_name: serverName,
765 message,
766 },
767 z.object({
768 mcp_response: z.any() as z.Schema<JSONRPCMessage>,
769 }),
770 )
771 return response.mcp_response
772 }
773}
774
775/**

Callers 3

updateSdkMcpFunction · 0.80
sendMethod · 0.80
sendMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected