Skip to main content
Glama

Mobile FreeCode

mobile-freecode is an MCP server that lets any MCP client (Claude Code, Claude Desktop, the FreeCode desktop app, …) discover and control an Android phone running the FreeCode Agent app over your local network.

Direction of control: this server runs on your desktop and drives the phone. The phone is the device being controlled; the desktop is the controller. There is no reverse channel — the phone never drives the desktop.

The phone runs a lightweight WebSocket gateway (port 8765); this server finds it on the LAN, pairs with it once, and then routes tool calls to the phone's native capabilities (accessibility tree, taps / swipes / text, screenshots, and a live screen stream).

Tools

Tool

Purpose

list_devices

List discovered / paired phones on the network.

get_device

Details + capabilities + current foreground app for one device.

pair

Pair with a device (enter the code shown on the phone, or generate one).

unpair

Remove a device's trust.

call

Run a native tool on the phone (computer.tap, screen.dump, device.info, …).

batch

Run one tool across several phones at once.

screenshot

Capture the current screen (MediaProjection when active, else accessibility).

screen_stream

Start/stop a live screen stream; the first frame is returned as an image.

The full device-tool reference (every computer.* / screen.* / device.* / app.* tool, its parameters and return shape) is in docs/MOBILE_MCP_TOOLS.md.

Related MCP server: phone-control

Requirements

  • Node.js ≥ 18.

  • The FreeCode Agent app installed on the Android phone, its accessibility service enabled, notifications allowed, and the phone on the same Wi‑Fi as the computer running this server.

What this repo ships

This repository distributes the compiled connector (dist/) — the ready-to-run MCP server — not the TypeScript source. Clone it, install the two runtime dependencies, and run:

git clone https://github.com/zunairvf-sys/MCP-Mobile-FreeCode.git
cd MCP-Mobile-FreeCode
npm install          # pulls @modelcontextprotocol/sdk + ws
node dist/index.js   # speaks MCP over stdio

Wire it into an MCP client

Add an entry to your client's MCP config (here, .mcp.json):

{
  "mcpServers": {
    "mobile-freecode": {
      "command": "node",
      "args": ["/absolute/path/to/MCP-Mobile-FreeCode/dist/index.js"]
    }
  }
}

Paired devices and this host's identity are stored per-user in ~/.freecode/ (mobile-paired.json, mobile-host.json) so every client that runs this server shares the same trust store.

License

Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.

Trademarks

The Apache-2.0 license covers the code. It does not grant any right to the names or brand. "FreeCode", "FreeCode Agent", and "Mobile FreeCode", and their logos, are trademarks of the project author. You may fork and redistribute this code under the Apache-2.0 terms, but you may not:

  • ship your fork under the "FreeCode" / "FreeCode Agent" name or logo,

  • represent your build as the official FreeCode app, or

  • reuse the FreeCode Agent Android package id or AdMob/publisher identifiers.

If you distribute a modified version, give it your own name.

Available Tools

8 tools
batchA

Run an operation against multiple devices concurrently. Returns results for each device.

Inputs: tool (required), devices (required), arguments.

callB

Execute a tool on a paired Android device. See docs/MOBILE_MCP_TOOLS.md for the full tool reference. Available device tools: computer.tap, computer.double_tap, computer.long_press, computer.swipe, computer.drag_path, computer.multi_touch, computer.pinch, computer.type, computer.key, computer.scroll, screen.screenshot, screen.dump, screen.observe, device.info, device.brightness, device.volume, device.clipboard, app.current, app.list, app.launch. The device routes the call through its MobileGatewayService to the appropriate service.

Inputs: tool (required), device (required), arguments.

get_deviceA

Get detailed information about a specific device, including capabilities, connection state, and current foreground app.

Inputs: device (required).

list_devicesA

List all discovered and paired Android devices running the FreeCode Agent app. If no devices appear, the user needs to: (1) install the FreeCode Agent app on their Android phone from the Play Store or by installing the APK directly, (2) enable the accessibility service in the app, and (3) ensure the phone is on the same WiFi network as the computer. The app automatically discovers the desktop on the local network once installed.

Inputs: status.

pairA

Initiate pairing with a discovered Android device. The device must have the FreeCode Agent app installed and running. If a pairing code was generated on the device, pass it via the "code" parameter. Otherwise a code is generated automatically — the user enters this code on their phone to confirm pairing.

Inputs: device (required), code.

screenshotC

Capture a screenshot from a device. Uses MediaProjection when active, falls back to AccessibilityService.

Inputs: device (required).

screen_streamA

Start, poll, or stop a persistent screen stream from a device. Use action="start" to begin streaming, action="poll" to fetch the most recent frames (a sliding window of the last few, oldest→newest, so you see recent motion — call this repeatedly to keep watching a screen that changes on its own, e.g. a video or animation), action="stop" to end.

Inputs: action (required), device (required), format.

unpairA

Remove pairing for a device. The device will need to be paired again before it can be controlled.

Inputs: device (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 8 tools

    Disambiguation4/5

    Each tool maps to a distinct lifecycle stage: discovery (list/get), pairing (pair/unpair), command execution (call), multi-device execution (batch), and screen capture (screenshot/screen_stream). Some overlap exists between 'screenshot' and 'screen_stream'—and 'call' can also trigger screen.screenshot—but the descriptions clarify single-frame versus streaming.

    Naming Consistency3/5

    Names are readable and snake_case, but not one consistent pattern: list_devices/get_device use verb_noun, pair/unpair are simple verbs, call/batch are generic verbs, and screenshot/screen_stream are compound nouns. This is mixed but still understandable.

    Tool Count5/5

    Eight tools is well-scoped for an Android device-control server. Each tool has a clear role, with no obvious filler, and the count sits comfortably in the typical 3-15 range.

    Completeness4/5

    The core lifecycle is covered: discovery, pairing, unpairing, device info, command execution, batch execution, and screen capture/streaming. One minor gap is that the 'call' tool defers to an external docs file and the server exposes no schema-listing for the device tools, which could create dead ends if those device tools change.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP-compatible agents to control an Android device over the network via ADB, providing tools for shell commands, screen capture, UI inspection, file operations, and input simulation.
      16 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables controlling an Android device from an MCP client via ADB, including wireless debugging discovery, UI-tree inspection, and performing taps, swipes, typing, app actions, and shell commands without relying on screen coordinates.
      12 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP-compatible AI assistants to see and control Android devices through ADB and a fast device-control protocol, including screenshots, touch input, typing, app management, UI inspection, file transfer, shell commands, and audio/video streaming.
      374 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides an MCP server that lets AI agents inspect and control an Android phone over Wi-Fi or USB, including screenshot element maps, OCR, taps, typing, scrolling, app launching, notifications, clipboard, and device settings/controls.
      160 npm
      3
      MIT