The mtools collection is written in Python, and most of the tools only use the standard packages shipped with Python. The tools are currently tested with Python 3.7, 3.8, and 3.9.

Some of the tools have additional dependencies, which are listed under the specific tool’s section.

The mtools suite is only tested with actively supported (non End-of-Life) versions of the MongoDB server. As of December 2021, that includes MongoDB 4.0 or newer.



You need to have Python 3.7.x, 3.8.x, or 3.9.x installed in order to use mtools. Other versions of Python are not currently supported or tested.

To check your Python version, run python --version on the command line.

Installation with pip3#

The easiest way to install mtools is via pip3. From the command line, run:

pip3 install mtools

Some mtools scripts have additional dependencies. To install all optional dependencies use:

pip3 install 'mtools[all]'

You need to have Python 3.7 or newer installed. pip3 should be included as part of the default install for supported versions of Python 3.

Depending on your user rights, pip3 may complain about not having permissions to install into the system directory.

In that case, you either need to add sudo in front of the pip3 command to install into a system directory, or append --user to install into your home directory.

Installation from source#

If pip3 is not available and you want to install mtools from source, you can get the source code by cloning the mtools github repository:

git clone git://

Or download the tarball from PyPI and extract it with:

tar xzvf mtools-<version>.tar.gz

Then cd into the mtools directory and run:

sudo python install

This will install mtools into your Python’s site-packages folder, create links to the scripts and set everything up. You should now be able to use all the scripts directly from the command line.


The full list of requirements (some of which are already included in the Python standard library) can be found in the requirements.txt file.

To install all dependencies for full feature support, run:

pip3 install 'mtools[all]'

To install dependencies for a subset of mtools utilities, specify one or more script names as a comma-separated list:

pip3 install 'mtools[mlaunch,mloginfo]'


required for mlaunch

mlaunch uses psutil to manage starting, stopping, and finding MongoDB processes.


required for mlaunch and mtransfer

pymongo is MongoDB’s official Python driver. mlaunch uses this to configure and query local MongoDB deployments.


required for mplotqueries

matplotlib is a python 2D plotting library which produces figures and graphs in a variety of formats and interactive environments across platforms.


required for matplotlib (in mplotqueries)

numpy is a Python module for scientific computing and numerical calculations.


required for mtransfer

WiredTiger is the default storage engine for MongoDB.