MCPcopy
hub / github.com/codeaashu/claude-code / sendMcpMessage

Method sendMcpMessage

src/cli/structuredIO.ts:758–773  ·  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

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

Callers 3

updateSdkMcpFunction · 0.80
sendMethod · 0.80
sendMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected