MCPcopy Create free account
hub / github.com/echoVic/blade-code / sendResponse

Method sendResponse

src/mcp/server/MCPServer.ts:405–420  ·  view source on GitHub ↗

* 发送响应

(clientId: string, messageId: any, result: any)

Source from the content-addressed store, hash-verified

403 * 发送响应
404 */
405 private sendResponse(clientId: string, messageId: any, result: any): void {
406 const response: MCPMessage = {
407 jsonrpc: '2.0',
408 id: messageId,
409 result,
410 };
411
412 if (clientId === 'stdio') {
413 process.stdout.write(JSON.stringify(response) + '\n');
414 } else {
415 const client = this.clients.get(clientId);
416 if (client) {
417 client.send(JSON.stringify(response));
418 }
419 }
420 }
421
422 /**
423 * 发送错误

Callers 7

handleInitializeMethod · 0.95
handleListResourcesMethod · 0.95
handleReadResourceMethod · 0.95
handleListToolsMethod · 0.95
handleCallToolMethod · 0.95
handleListPromptsMethod · 0.95
handleGetPromptMethod · 0.95

Calls 1

getMethod · 0.80

Tested by

no test coverage detected