Sign up to claim 1 month of Merca Global Selling Pro ($10 value) plus a dedicated US ISP node via WeChat support

November 9, 2026

Automate Merca with Codex: MCP and browser-use CLI Quickstart

Connect Merca GS to Codex via Model Context Protocol (MCP) and control isolated store browsers with browser-use CLI. Includes natural prompts and troubleshooting tips.

Routine store operations—such as checking seller dashboards, exporting orders, monitoring inventory, and verifying listings—are often repetitive and time-consuming. Automating these workflows in ordinary browsers often risks platform account linking due to missing device fingerprinting or shared IP addresses.

Merca Global Selling (Merca GS) natively supports the Model Context Protocol (MCP). This allows you to connect Merca directly to AI coding agents like Codex. Combined with the open-source browser-use CLI, Codex can automate web actions directly inside an isolated, anti-detect browser profile configured with dedicated proxies and authentic hardware fingerprints.

This setup takes five straightforward steps: copy your MCP configuration from Merca, let Codex write the settings, restart Codex, install browser-use CLI, and trigger automated tasks with natural prompts.

This guide assumes Merca GS and Codex run on the same computer (localhost).

System Architecture: How the Tools Work Together

In this automation workflow, each layer has a distinct responsibility:

  1. Codex (Orchestration & Reasoning): Interprets your business instructions, determines execution steps, and calls the appropriate tools.
  2. Merca MCP Server (Environment Isolation): Provided by the Merca desktop client. It exposes store management, engine diagnostics, and profile launch controls to Codex. When a task begins, it starts the target store browser with its assigned proxy node, isolated user data directory, and hardware fingerprints.
  3. browser-use CLI (Browser Automation): A CLI tool built on the Chrome DevTools Protocol (CDP). It attaches to the running store browser to inspect elements, click buttons, fill forms, and capture screenshots. The official Browser Use documentation details how coding agents interact with this CLI.

Workflow: You describe a task -> Codex launches the store browser with a remote debugging port via Merca MCP -> browser-use CLI attaches to that port -> Codex executes page actions and returns the results.

Step 1: Copy the MCP Configuration from Merca

Open and sign in to the Merca desktop client. Navigate to Settings -> Automation (or the Automation page in your navigation menu). Turn on Enable service, then click Copy in the top-right corner of the MCP card.

Before proceeding, confirm the following prerequisites:

  • Plan & Permissions: Your account has an active paid subscription and permission to open the target store.
  • Engine & Node: The browser engine components are ready, and the store is bound to an active proxy node.
  • Read-Only Mode: Ensure Read-only mode is disabled in your MCP settings (read-only mode disables write tools like launchStore).
  • DevTools Access: If using a team member account, ensure "Disable developer tools" is turned off in the member settings. Restart the store browser after updating this setting.

When running on a single local machine, keep the default loopback address (127.0.0.1). You do not need to enable LAN access. Keep the Merca desktop client running and signed in while automations run.

> Security Note: The client interface masks the key with asterisks for screen privacy, but clicking Copy places the actual API key into your clipboard. Never commit this configuration to public repositories or forums.

Step 2: Have Codex Configure MCP and Restart

Open Codex and send the following concise prompt, pasting your copied configuration at the bottom:

Connect this Merca GS MCP configuration to Codex on this computer, keeping my existing settings intact. Let me know when it is saved so I can restart Codex.
Configuration:
[Paste your copied MCP configuration here]

Merca exports standard Streamable HTTP JSON, while Codex saves server configurations in TOML format (typically in ~/.codex/config.toml). Letting Codex perform the conversion prevents formatting mistakes. For configuration specifications, consult the official OpenAI MCP documentation.

Once Codex confirms the file has been updated, fully quit and reopen Codex to load the new Merca tools.

Step 3: Install browser-use CLI

After restarting Codex, ask it to install the CLI tool:

Install the latest browser-use CLI and its Codex skill on this computer. Check the installed version when done.

Codex will install the CLI using its standard toolchain (such as uv tool) and load the necessary skill instructions into context. If Codex suggests reloading the session, follow the prompt before continuing.

Step 4: Verify End-to-End Connectivity

Before assigning production tasks, run a quick connectivity check to ensure Merca MCP can launch the store and browser-use CLI can attach to it:

Test Merca MCP and browser-use CLI:
Use Merca MCP to launch "Demo Store" with remote debugging enabled, then have browser-use attach to it and read the current page URL and title.

Codex will automatically call launchStore with --remote-debugging-port, wait for the CDP port to respond, attach using browser-use, and report the page title and URL.

Keep these two ports distinct:

  • Merca Automation Service Port: Defaults to 43210. Codex uses this port to manage stores and launch browsers.
  • Browser CDP Debugging Port: For example 9222. browser-use connects to this port to control web pages. For additional protocol details, see the Automation API documentation.

Step 5: Assign Everyday Tasks with Natural Prompts

Once connectivity is verified, you can instruct Codex in plain language. Just provide the store name, the goal, and any guardrails:

Example 1: Routine Dashboard Status Check

Open the dashboard of "Demo Store" and check if there are any warnings on the Account Health panel. If it lands on a login page, pause and alert me without clicking anything.

Example 2: Extract Unshipped Orders into a Table

In "US Store", open the orders page and compile all unshipped orders from the last 7 days into a table with the order ID, purchase date, and product title. Query only; do not confirm or modify orders.

Example 3: Update Listing Copy with Confirmation Before Saving

In "US Store", find SKU DEMO-001 and open its edit page. Update the title to "[New Title]". Show me a comparison of the changes, then pause before clicking Save and wait for my confirmation.

Codex understands context well. Clear guardrails like "pause before submitting" or "read-only" keep critical seller workflows safe and controlled.

Troubleshooting

  • Merca tools do not appear in Codex: Verify that Codex was completely restarted after saving the configuration. Ensure Merca is running and the local automation service is enabled. If you regenerated the API key in Merca, update Codex with the new key.
  • Store queries work, but launch tools are missing: Ensure Read-only mode is disabled in Merca’s MCP settings. Refresh tools or restart Codex after changing this setting.
  • Store launch fails: Check account subscription status, store permissions, engine readiness, and node connectivity. If you see an IP conflict warning, review client logs under Login Protection.
  • The browser opens, but page actions fail: Confirm the store was launched with an available --remote-debugging-port. Ensure the operating member account does not have "Disable developer tools" enabled.

By combining Merca GS environment isolation with browser-use automation, sellers and operations teams can delegate repetitive browser work to AI while keeping each account secure and isolated.