
Run your Mercado Pago integration from the terminal
The MP CLI (mp) brings Mercado Pago API resources to the terminal with a single Access TokenAccess Token from your application, letting you run payments, subscriptions, stores and reports without a browser, a GUI, or switching context in your AI agent.
Why does this matter in practice?
Imagine a customer reported a payment failure. With the MP CLI, you identify and act without leaving the terminal:
plain
mp payments search --status rejected --external-reference "ORDER-123" mp preferences create --title "Producto X" --unit-price 299.90 --quantity 1 --payer-email cliente@email.com
In two commands, you found the issue and created a new payment preference. No opening the dashboard, no building cURLs, no losing context.
On the security side, credentials are stored in the operating system's native keychain, not in configuration files or shell history. This eliminates the risk of accidentally exposing tokens in repositories or logs. All commands return JSON by default, so you can plug the CLI into any existing script without an extra parsing layer.
The Mercado Pago CLI has features for every scenario:
For development teams, features that eliminate repetitive setup:
- Named profiles to switch between accounts and environments without re-authenticating, and
- The
.mp.tomlfile at the repository root with shared default settings. Anyone who clones the project automatically inherits the configured profile and country.
For CI/CD pipelines, export the Access Token as an environment variable and use the --no-interactive flag to ensure no prompt blocks execution.
For AI agents, our CLI was designed from the start to work with agents. Default JSON output, --silent, --no-interactive and exit codes categorized by error type let an AI agent operate your Mercado Pago integration safely and in a structured way, without needing to parse raw API responses or manage credentials in the conversation context.
Finally, sandbox testing from the terminal: instead of setting up test users from the dashboard, you can create buyers, set virtual balances and provision cards with specific behaviors directly from the terminal:
plain
mp tester create --site-id MLB --type buyer mp tester balance set 123456 --amount 10000 mp tester card add --user-id 123456 --scenario insufficient_funds
What's coming next
Upcoming releases bring new installation options beyond Homebrew and expand command coverage to reach 100% of the Mercado Pago API.
Check out the full documentation for the new feature.
