Install Mercado Pago CLI
The Mercado Pago CLI is available for macOS, Linux, and Windows. In the tabs below, choose the installation method that best suits your operating system, then authenticate with your Access Token to start operating.
The Mercado Pago CLI is distributed as a Homebrew package compatible with macOS and Linux. To install it, run the following command in the terminal:
bash
brew install mercadopago/tap/mp-cli
To confirm that the installation was completed successfully, run the following command:
bash
mpcli --version
Shell completion
To enable command autocompletion in the terminal:
bash
mpcli completion bash >> ~/.bashrc mpcli completion zsh >> ~/.zshrc mpcli completion fish >> ~/.config/fish/completions/mp.fish mpcli completion powershell
Authenticate credentials
The Mercado Pago CLI stores credentials in the operating system's native keychain, preventing tokens from being exposed in configuration files, shell history, or logs.
Log in
Authenticate with your Access Token:
bash
mpcli login --token TEST-... # test credentials mpcli login --token APP_USR-... # production credentials or test account credentials
When interpreting the login response, note the following behavior:
The environment field reflects the token format, not the actual account type. An APP_USR- token issued for a test account will show "environment": "production" and this is expected behavior.
Log out
Use the command below to end the CLI's access to the account and remove the credentials stored in the keychain. If you are working with multiple profiles, specify the name of the profile you want to disconnect:
bash
mpcli logout mpcli logout --profile sandbox
Configure the project
This configuration is ideal for teams looking to use the Mercado Pago CLI on a recurring basis. To get started, create the .mp.toml file at the root of your repository with your team's default settings, such as credentials profile and country of operation:
toml
[defaults] profile = "checkout-pro-sandbox" # default credentials profile site_id = "MLB" # country of operation [output] no_color = false # disable colored output
Configuration sources
The CLI determines which configuration source to use following the order from most specific to least specific:
| Source | Recommended use |
CLI flags (--profile, --json, etc.) | Override any configuration on a one-off basis without changing defaults. |
Environment variables (MP_PROFILE, MP_ACCESS_TOKEN) | Authentication in CI/CD and automated environments. |
.mp.toml in the current directory | Shared team defaults in the repository. |
~/.config/mp/config.toml | Personal developer preferences. |
| Internal defaults | Applied when no other source is configured. |