@koduhai/mcp-kit
    Preparing search index...

    Function serveTools

    • Register a list of ToolDescriptors on a low-level MCP Server: wires the tools/list and tools/call handlers, JSON-encodes each handler's return value as MCP text content, and answers unknown tool names with a MethodNotFound error. This replaces the boilerplate you'd otherwise hand-write per server.

      The server must advertise the tools capability when constructed, e.g. new Server(info, { capabilities: { tools: {} } }).

      Parameters

      Returns void

      const server = new Server({ name: 'x', version: '1.0.0' }, { capabilities: { tools: {} } });
      serveTools(server, [versionTool(versioning), myTool]);
      await server.connect(transport);