This paper describes an efficient implementation of the Message Passing Interface (MPI) library based on the shared memory model. Our implementation, called MPI/MBCF, combines two protocols to utilize shared memory communication facilities; the write protocol and the read protocol. In the write protocol, the remote write is used for communication with no buffering. In the eager protocol, the Memory-Based FIFO is used for buffering by the library. These two protocols are switched autonomously according to the precedence of send and receive functions. The performance of our library was evaluated on a cluster of workstations. We measured the round-trip time and the peak bandwidth, and executed the NAS Parallel Benchmarks. The results show that it is efficient to construct a message passing library with the MBCF which is based on the shared memory model.