Install Mercado Pago CLI
The Mercado Pago CLI is installed via Homebrew and authenticated with your Access TokenAccess Token to start operating. Follow the steps below to install and configure your credentials:
Install via Homebrew
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
mp --version
Shell completion
To enable command autocompletion in the terminal:
bash
mp completion bash >> ~/.bashrc mp completion zsh >> ~/.zshrc mp completion fish >> ~/.config/fish/completions/mp.fish mp 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 according to the desired environment:
bash
# Sandbox mp login --token TEST-... # Production mp login --token APP_USR-...
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
mp logout mp 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. |