Smart grid is one of the most important applications of the Internet of Things (IoT) for environmental sustainability and energy efficiency issues in recent years. IP-based wireless sensor networks (IP-WSNs) are considered as one of the promising wireless communication technologies applied in smart grid for providing pervasive communications and control capabilities at low cost as well as connecting metering devices with wired area network (WAN) infrastructures seamlessly without a requirement for deploying proxies. In addition, the IPv6 Internet has become an inevitable trend for all-IP communication because of its large address space and others advantages over IPv4. One of the main challenges for connecting WSNs and IPv6 Internet is IPv6 address configuration since nodes with unique address are a prerequisite for reliability and end to end communication. Hence, an IPv6 address configuration scheme called MPIPA is proposed in this paper. MPIPA utilizes three-dimensional locations coordinates to assign each node a unique spatial IPv6 address based on grouping methods and scan-line scheme. Besides, Assignment Success Rate (ASR) is used in this paper to evaluate the probability that assigns unique IP address to nodes successfully. The simulation results show that MPIPA enables over 8, 000 nodes to be assigned IP address successfully when ASR is still nearly 90%.