Cursor + Android Emulator MCP Setup: BlueStacks, LDPlayer, MuMu, MEmu

Set up a Cursor Android emulator MCP server in minutes: the .cursor/mcp.json entries, the token flow, first prompts, and the hosted route to cloud devices.

Macro Automation Studio Team 8 min read Published September 4, 2026
Cursor + Android Emulator MCP Setup: BlueStacks, LDPlayer, MuMu, MEmu

Cursor can control an Android emulator as soon as an MCP server turns the device into tools its agent can call. This Cursor Android emulator MCP setup uses the free local connector from Macro Automation Studio for BlueStacks, LDPlayer, MuMu or MEmu, plus the hosted MAS server when you want cloud devices, saved macros and MAS Agent in the same chat. Both are a few lines in .cursor/mcp.json, and the whole thing takes about ten minutes.

What Cursor gets

The local connector exposes 13 tools over adb. All of them work from pixels rather than an accessibility tree, so they behave the same on a game as on a settings screen:

  • Devices: list_devices, screen_size.
  • Seeing: screenshot, read_text (OCR lines with a confidence and a bounding box each), find_image (template matching that returns coordinates and a score).
  • Acting: tap, swipe, type_text, press_key, wait.
  • Apps: open_app, close_app, current_app.

Screenshots come back scaled to 1280 px on the long edge with the scale factor attached, so coordinates from read_text and find_image line up with tap without arithmetic on your side. The connector makes no network calls of its own and needs no account.

Cursor Android emulator MCP setup: prerequisites

  • An Android emulator on your machine: BlueStacks, LDPlayer, MuMu, MEmu or any other adb-compatible emulator, on Windows or macOS.
  • adb on your PATH. The connector drives whatever adb devices lists, so the emulator’s ADB option has to be on. The BlueStacks setup guide shows where the switch lives; the other three keep it in their settings under a similar name.
  • Python, and the MAS agent package. The desktop app’s Connect page walks you through getting it; the download is free to try.
  • Cursor, any recent version with MCP support.

Step 1: confirm adb sees the emulator

Run adb devices in a terminal. You want one line per running emulator, each marked device. An empty list means the emulator’s ADB setting is off or its port is not exposed; fix that before touching Cursor, because the connector cannot see what adb cannot.

Step 2: add the Android MCP server to .cursor/mcp.json

Cursor reads MCP servers from .cursor/mcp.json in the project root (that project only) or from ~/.cursor/mcp.json (every project). Create the file if it does not exist and add the local connector as a stdio server:

{
  "mcpServers": {
    "mas-local": {
      "command": "python",
      "args": ["-m", "masagent", "mcp"]
    }
  }
}

Save the file, then open Cursor Settings and find the MCP section. The mas-local entry should show as running with its 13 tools listed. If you run more than one emulator, pin the one Cursor should use by adding an env block with MAS_DEVICE set to the serial from adb devices; without it the connector takes the first device adb lists.

"mas-local": {
  "command": "python",
  "args": ["-m", "masagent", "mcp"],
  "env": { "MAS_DEVICE": "emulator-5554" }
}

Step 3: first prompts in the agent panel

Open the agent panel, pick agent mode, and ask in plain English. Cursor asks before each tool call until you allow the server’s tools to run on their own.

  • “List my Android devices.” You should get the emulator back with its serial.
  • “Take a screenshot of the device and describe what is on screen.” Cursor receives the image and reads it.
  • “Read the text on screen.” OCR lines come back with coordinates.
  • “Find the Claim button and tap it.” Cursor calls find_image with a template, gets coordinates and a score, then tap.

Then give it a job that chains several tools: “Open the game, claim the daily reward, close any popup that appears, and tell me what the energy counter says.” Every step shows up as a tool call you can expand, and every screenshot is something you can inspect. For a test flow on your own app: “Log in with the test account and tell me whether the welcome screen appears.”

Cursor is driving the app through the screen, with no root, no APK changes and no memory reading. No automation tool is 100% risk-free, so automate responsibly and at your own discretion.

The hosted server: cloud devices, macros and MAS Agent

The local connector stays on your machine and works on the emulators adb can see. The hosted MAS MCP server is one HTTPS endpoint with 25 tools, and it works on the always-on cloud Android devices in your account. Add it alongside the local entry:

{
  "mcpServers": {
    "mas": {
      "url": "https://api.automationmacro.com/mcp",
      "headers": {
        "Authorization": "Bearer <your token>"
      }
    }
  }
}

What it adds over the local 13:

  • lease_device opens a control session on a cloud device. With auto_start it boots a stopped device first. Leases renew on every call and expire after ten idle minutes, so a forgotten session does not hold the device.
  • run_macro executes a saved macro server-side on the leased device. It costs zero credits, and the device keeps running with your PC off.
  • author_macro hands a goal in plain English to MAS Agent. The agent explores the app on the cloud device, captures template images and OCR regions verified on-device, states a budget you confirm, then compiles a deterministic Python macro and validates it by replay before it lands in your library. This is the one tool on the list that spends credits.
  • get_map returns the screens and proven routes the agent learned about an app, so a second task starts from memory instead of from zero.

The rest of the 25 cover device control, vision, macros and runs, agent authoring and app maps on the cloud device, with no per-call charge on the device tools. The MCP page lists each tool with its parameters. A cloud device is $80 a month and includes 20,000 AI credits every month; the pricing page has the full table.

How the token works

Auth is OAuth client credentials, with no interactive sign-in. Create a key in the app under API keys, exchange it for a one-hour access token at the token endpoint, and send that token as the bearer header in mcp.json. When the hour is up, exchange the key again and update the header; a small script that refreshes the file before you open Cursor keeps this painless.

Keep the token out of version control. Put the hosted entry in ~/.cursor/mcp.json rather than the project file, or add .cursor/mcp.json to .gitignore if the project file is where it has to live.

Troubleshooting

  • The server shows an error in Cursor’s MCP settings. Run python -m masagent mcp in a terminal yourself. If Python cannot find masagent, the package is installed in a different interpreter; put the full path to that interpreter in command. On Windows, py in place of python often fixes a PATH mismatch.
  • list_devices returns nothing. Same cause as an empty adb devices: the emulator’s ADB option is off, or adb is not on the PATH Cursor inherited. Restart Cursor after changing PATH.
  • Taps land in the wrong place. Two devices are connected and the connector picked the other one, or the emulator’s resolution changed after a template was captured. Pin the device with MAS_DEVICE and recapture the template.
  • The screenshot is blank. Some emulators render to a second window. Make sure the game is in the foreground of the device you selected.
  • The hosted server answers 401. The one-hour token expired. Exchange the key again and update the header.
  • Every step is slow. Each action waits on a model decision. For anything you will repeat, let author_macro compile it into a macro and call run_macro instead, at zero credits and with no model in the loop.

Frequently asked questions

Can Cursor control an Android emulator?

Yes. With the free MAS local connector in .cursor/mcp.json, Cursor’s agent gets screenshots, OCR, template matching and input on BlueStacks, LDPlayer, MuMu, MEmu or any adb-compatible emulator, and it drives the emulator from plain English prompts.

Where does the Android MCP config go in Cursor?

In .cursor/mcp.json at the project root for one project, or ~/.cursor/mcp.json for every project. Both take the same mcpServers shape: the local connector is a stdio entry with a command, and the hosted server is a url entry with a bearer header.

Does the local connector send anything to the cloud?

No. It talks to the emulator over adb on your machine, makes no network calls of its own, and needs no account. Only the hosted server at api.automationmacro.com talks to MAS, and it reaches only the cloud devices your account owns.

How do I get a token for the hosted server?

Create a key in the app under API keys, exchange it for a one-hour access token at the token endpoint, and paste that token as the bearer header. There is no interactive sign-in; when the token expires, exchange the key again.

Does each tool call cost credits?

Device and vision tools have no per-call charge on either server, and run_macro costs zero credits. author_macro spends credits while MAS Agent explores and builds, against a budget you confirm first.

Does it work on a physical phone or with other AI clients?

Yes to both. Enable USB debugging, plug the phone in, and the connector lists it like an emulator with nothing installed on the phone. The same stdio command and the same hosted URL work from Claude Code, Codex, Hermes and Claude Desktop; the Claude Code walkthrough covers that client.

Ready to automate it?

Download Macro Automation Studio, point it at your emulator, cloud device or phone, and let the agent build the first macro.