MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / sendMcpMessage

Method sendMcpMessage

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

781 * Sends an MCP message to an SDK server and waits for the response
782 */
783 async sendMcpMessage(
784 serverName: string,
785 message: JSONRPCMessage,
786 ): Promise<JSONRPCMessage> {
787 const response = await this.sendRequest<{ mcp_response: JSONRPCMessage }>(
788 {
789 subtype: 'mcp_message',
790 server_name: serverName,
791 message,
792 },
793 z.object({
794 mcp_response: z.any() as z.Schema<JSONRPCMessage>,
795 }),
796 )
797 return response.mcp_response
798 }
799}
800
801function 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