> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # handleMcpRequest > Handle an MCP JSON-RPC 2.0 request and return the response. [enable-mcp-server]: /docs/server-sdks/reference/typescript/agents/agent-base/enable-mcp-server Handle an incoming MCP JSON-RPC 2.0 request. This method is called automatically by the `/mcp` endpoint when [`enableMcpServer()`][enable-mcp-server] is active. It supports the `initialize`, `notifications/initialized`, `tools/list`, `tools/call`, and `ping` methods. You typically do not need to call this directly -- it is invoked by the Hono route handler. ## **Parameters** **`body`** `Record` — required The parsed JSON-RPC 2.0 request body, containing `jsonrpc`, `method`, `params`, and `id` fields. --- ## **Returns** `Promise>` -- The JSON-RPC 2.0 response object. ## **Example** ```typescript {7} import { AgentBase } from '@signalwire/sdk'; const agent = new AgentBase({ name: 'assistant', route: '/assistant' }); agent.enableMcpServer(); // Manually invoke (normally handled by the /mcp endpoint) const response = await agent.handleMcpRequest({ jsonrpc: '2.0', id: 1, method: 'tools/list', params: {}, }); console.log(response); ``` > Handle an MCP JSON-RPC 2.0 request and return the response.