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 TokenPrivate key of the application created in Mercado Pago, used in the backend. You can access it from Your integrations > Application details > Tests > Test credentials or Production > Production credentials. to start operating.
The Mercado Pago CLI is distributed as a Homebrew package compatible with macOS and Linux.
- If you have the previous version installed (
mercadopago/tap/mp-cli), run the following command to uninstall it before installing the current version.
bash
brew uninstall mp-cli
- Then, run the following command to install the current version.
bash
brew install mercadopago/tap/mpcli
To confirm that the installation was completed successfully, run the following command:
bash
mpcli --version
Before using any command, authenticate with your Access TokenPrivate key of the application created in Mercado Pago, used in the backend. You can access it from Your integrations > Application details > Tests > Test credentials or Production > Production credentials. — access your credentials in Your integrations and run:
bash
mpcli login
For advanced authentication options, see Authenticate credentials below.
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
In these cases,
~/.config is owned by root and mpcli login may fail with permission denied. To fix it, manually create the directory before logging in: sudo mkdir -p ~/.config/mp && sudo chown $USER ~/.config/mp.To get your Access TokenPrivate key of the application created in Mercado Pago, used in the backend. You can access it from Your integrations > Application details > Tests > Test credentials or Production > Production credentials., go to Your integrations, select or create an application, and copy the token from Production credentials or Test credentials in the left menu. Then run:
bash
mpcli login --token <your_access_token>
When interpreting the login response, note the following behavior:
The environment field reflects the token type, not the actual account type — a test account token may 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. |