Due to their high-current-carrying capacity, round geometry, and low cost, MgB2 wires are promising candidates for realizing high-power cables. However, their operating temperature between 4.2 K and 25 K makes ac losses a critical issue for those cables. To optimize the cable architecture for minimizing ac losses, one must be able to predict them quite accurately. As a first step in this direction, we addressed the numerical computation of a single multifilamentary MgB2 wire that forms the basic element of a high-current cable. The wire under consideration has 36 twisted MgB2 filaments disposed on three concentric layers and embedded in a pure-nickel matrix. An initial comparison between 2-D and 3-D finite elements was performed to justify the need for a full 3-D model, without which coupling losses in the matrix cannot be modeled properly. This is of prime importance since coupling loss is the dominant loss mechanism at high applied fields. Then, simulations of simpler geometries (6- and 18-filament wires) submitted to various transport currents and/or applied fields were performed to identify trends in ac losses and find the best numerical tools for scaling up simulations to the full 36-filament case. The complexity of the model was progressively increased, starting with MgB2 filaments in the air matrix and then adding electrical conductivity and magnetic properties in the nickel matrix.