Skip to main content
Glama

Keitai MCP ๐Ÿ“ฑ

License: MIT Python: 3.10+ MCP: Supported Hardware: Fujitsu F-03L Code Style: Ruff

Keitai MCP is an open-source Model Context Protocol (MCP) server and developer toolset designed specifically for AI agents (such as Antigravity, Claude, Cursor, Windsurf) and developers to interact with, automate, and develop software for Japanese Android feature phones ("ใ‚ฌใƒฉใ‚ฑใƒผ" / Garakei / Keitai), with first-class support for the Fujitsu arrows ใ‚ฑใƒผใ‚ฟใ‚ค F-03L (NTT DOCOMO).


๐ŸŒŸ Why Keitai MCP?

Japanese Android flip phones like the Fujitsu F-03L are unique beasts:

  • No standard touchscreen: Navigation is driven primarily by a 5-way physical D-Pad, numeric keypad (0โ€“9, *, #), and dedicated softkeys (F1, F2, CLR, CALL, ENDCALL).

  • Compact resolution: 480 ร— 854 FWVGA display at 240 dpi.

  • Clamshell form factor: Physical lid open/close sensor (gpio_lid).

  • Architecture: 32-bit ARM (armeabi-v7a) on Qualcomm Snapdragon 210 running Android 8.1 Oreo (API 27) with 1 GB RAM.

Most general-purpose Android automation tools assume high-resolution touchscreens and modern touch gestures. When AI agents attempt to operate a Keitai, they often fail because they don't know:

  1. Which UI element currently has D-Pad focus.

  2. How to map physical keys (UP, DOWN, CENTER, CLR, F1, FAV1).

  3. That screenshots must be scaled and captured efficiently without crashing low-memory buffers.

  4. How to detect clamshell open/close states.

Keitai MCP bridges this gap completely. It equips LLM agents with native Keitai awareness, real-time vision, focus tracking, and hardware key controls.


Related MCP server: MobileAgentMCP

โœจ Features

  • ๐ŸŽฎ Physical Keypad Control: Send individual key events, long-presses, and complex multi-key sequences (UP, DOWN, CENTER/OK, BACK/CLR, F1, F2, 0โ€“9, STAR, POUND, FAV1โ€“FAV3).

  • ๐Ÿ‘๏ธ Live Screen Vision: Capture 480ร—854 screenshots returned directly as MCP ImageContent for multimodal vision models, with automatic metadata (current package/activity).

  • ๐Ÿ” Token-Efficient UI Hierarchy: Automatically parses uiautomator dump XML into a clean, readable text tree, clearly marking [โ˜…FOCUSED] elements, [CLICKABLE] items, and exact bounding box coordinates.

  • ๐Ÿ“ฆ App Management: Install APKs (with automated armeabi-v7a compatibility checks and runtime permissions), launch activities, force-stop, and clear app data.

  • ๐Ÿฉบ Hardware & Battery Diagnostics: Real-time status of battery percentage, temperature (ยฐC), voltage, clamshell lid state (OPEN / CLOSED), RAM availability, and Wi-Fi IP address.

  • ๐Ÿ“œ Logcat & Crash Diagnostics: Query logcat filtered by package PID, inspect the Android crash ring buffer (logcat -b crash), and capture fatal exception stack traces.

  • ๐Ÿ“ Device File Transfer: Seamless push, pull, and ls on internal storage and microSD card.

  • ๐Ÿ“š Embedded MCP Resources & Prompts: Built-in F-03L hardware specification sheets, Android Keitai development guidelines, and step-by-step navigation prompts.

  • ๐Ÿ’ป Rich CLI: Includes the keitai-mcp CLI for quick terminal inspection, device discovery, screenshots, and key injection.


๐Ÿ“‹ Requirements

  1. Host Machine: Linux, macOS, or Windows.

  2. Python: Python 3.10 or newer.

  3. Android Platform Tools: adb command installed and available on your system PATH.

  4. Device: Fujitsu arrows ใ‚ฑใƒผใ‚ฟใ‚ค F-03L (or compatible Android Keitai) connected via USB with USB Debugging enabled.


๐Ÿš€ Quick Start

1. Installation

Clone and install using pip or pipx:

git clone https://github.com/haphuthinh/keitai_mcp.git
cd keitai_mcp
pip install -e .

Verify your connected Keitai:

keitai-mcp devices

Output:

                   Connected Android Devices                   
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Serial   โ”ƒ State  โ”ƒ Model โ”ƒ Product โ”ƒ F-03L Detected?       โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ 96344868 โ”‚ device โ”‚ F_03L โ”‚ F03L    โ”‚ โœ” YES (Fujitsu F-03L) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Inspect live device status:

keitai-mcp info

โš™๏ธ MCP Client Configuration

Claude Desktop

Add keitai to your claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "keitai": {
      "command": "keitai-mcp",
      "args": ["run"]
    }
  }
}

Or using direct virtualenv Python:

{
  "mcpServers": {
    "keitai": {
      "command": "/path/to/keitai_mcp/.venv/bin/python",
      "args": ["-m", "keitai_mcp", "run"]
    }
  }
}

Antigravity

In Antigravity, MCP servers are configured globally in ~/.gemini/config/mcp_config.json:

{
  "mcpServers": {
    "keitai": {
      "command": "/path/to/keitai_mcp/.venv/bin/python",
      "args": ["-m", "keitai_mcp", "run"],
      "env": {
        "PYTHONUNBUFFERED": "1"
      }
    }
  }
}

Cursor / Windsurf / Zed

Add to your workspace or user MCP settings (mcpServers object):

{
  "mcpServers": {
    "keitai": {
      "command": "keitai-mcp",
      "args": ["run"],
      "env": {
        "PYTHONUNBUFFERED": "1"
      }
    }
  }
}

๐Ÿ› ๏ธ Complete MCP Tool Reference

Keitai MCP exposes 28 purpose-built tools:

Tool Name

Parameters

Description

keitai_press_key

key, long_press, count, delay_ms

Press a hardware key (UP, DOWN, CENTER, BACK, F1, F2, 0-9, STAR, POUND, FAV1-3).

keitai_press_sequence

keys, interval_ms

Execute a sequence of keypresses (e.g. ["DOWN", "DOWN", "CENTER"]).

keitai_input_text

text

Types alphanumeric text into the currently active text field.

keitai_tap

x, y

Tap coordinates (0โ€“480, 0โ€“854).

keitai_swipe

x1, y1, x2, y2, duration_ms

Perform swipe gesture.

keitai_wake

none

Wake the Keitai screen if it is asleep.

keitai_sleep

none

Put the Keitai screen to sleep.

keitai_take_screenshot

save_path, return_image, max_width

Capture live screen as MCP ImageContent and optional PNG file.

keitai_inspect_ui

focused_only, clickable_only, max_depth, output_format

Dump UI hierarchy tree with clear [โ˜…FOCUSED] markers.

keitai_get_focused_element

none

Returns the currently focused element's bounds, text, ID, and class.

keitai_find_element

query, search_by

Locate UI elements matching text, resource-id, or class.

keitai_install_apk

apk_path, grant_permissions, reinstall

Install APK with automated permissions and 32-bit validation.

keitai_uninstall_app

package_name, keep_data

Uninstall an application package.

keitai_launch_app

package_name, activity

Launch an application by package or specific activity name.

keitai_stop_app

package_name

Force-stop an application (am force-stop).

keitai_clear_app

package_name

Reset app data and cache (pm clear).

keitai_list_installed_apps

third_party_only, filter_query

List installed applications on the device.

keitai_get_device_info

none

Hardware specs, clamshell state, battery, RAM, storage, focused app.

keitai_get_battery

none

Battery percentage, temperature in ยฐC, voltage, and health.

keitai_get_clamshell_state

none

Physical clamshell lid state (OPEN or CLOSED).

keitai_get_network_info

none

Wi-Fi connection IP address, MAC address, and status.

keitai_exec_shell

command, timeout_seconds

Safely execute arbitrary ADB shell command with structured output.

keitai_read_logcat

package_name, tag, priority, lines

Read filtered Android logcat entries.

keitai_clear_logcat

none

Clear the logcat buffer.

keitai_get_recent_crashes

package_name

Retrieve fatal exceptions, ANRs, and crash ring buffer logs.

keitai_push_file

local_path, remote_path

Transfer file from host to phone.

keitai_pull_file

remote_path, local_path

Transfer file from phone to host.

keitai_list_files

remote_path

List files and folders in a device directory.


๐Ÿ“– MCP Resources & Prompts

Resources

  • keitai://f03l/specs: Complete technical hardware and software specifications of Fujitsu arrows Keitai F-03L.

  • keitai://dev/guidelines: Comprehensive guide on developing Android applications for Japanese flip phones.

  • keitai://dev/keycodes: Complete keycode catalog and mapping reference table.

Prompts

  • plan_keitai_navigation(target_action): Guides an agent through inspecting the screen and executing D-Pad steps to reach an element.

  • diagnose_keitai_crash(package_name): Diagnoses application crashes on Android 8.1 / armeabi-v7a.


๐ŸŽ›๏ธ CLI Reference

Keitai MCP also includes a command-line interface:

# View help
keitai-mcp --help

# Show device status panel
keitai-mcp info

# Capture a screenshot
keitai-mcp screenshot -o screen.png

# Send a key event
keitai-mcp key UP
keitai-mcp key CENTER
keitai-mcp key BACK --count 2

# Inspect current UI tree
keitai-mcp ui
keitai-mcp ui --clickable-only

# List installed 3rd party apps
keitai-mcp apps
keitai-mcp apps --all --query docomo

๐Ÿ“ฑ Hardware Profile: Fujitsu F-03L

Specification

Details

Model

Fujitsu arrows ใ‚ฑใƒผใ‚ฟใ‚ค F-03L (Docomo)

OS

Android 8.1.0 Oreo (API Level 27)

SoC

Qualcomm Snapdragon 210 (MSM8909) Quad-core ARM Cortex-A7 @ 1.1 GHz

Architecture

32-bit ARM (armeabi-v7a)

RAM

1 GB LPDDR3 (~913 MB visible to OS)

Storage

8 GB ROM (~1.6 GB available user space) + microSDXC slot

Main Display

3.4-inch TFT LCD, 480 ร— 854 pixels, 240 dpi, Non-touch

Sub-Display

0.8-inch OLED (96 ร— 32 pixels) on outer lid

Keypad

5-way D-Pad, Numeric 0โ€“9, *, #, F1, F2, CLR, CALL, ENDCALL, Quick 1/2/3

Lid Switch

gpio_lid sensor (mLidState=1 for Open, 0 for Closed)

For in-depth developer instructions, see KEITAI_DEVELOPMENT_GUIDE.md.


๐Ÿงช Testing

Keitai MCP has full unit and integration test coverage:

# Run test suite
pytest -v

If your Fujitsu F-03L is plugged in, pytest automatically runs the live integration tests (tests/test_live_device.py). If no device is connected, live tests are cleanly skipped.


๐Ÿค Contributing

Contributions, issues, and feature requests are welcome! See CONTRIBUTING.md for setup and guidelines.


๐Ÿ“„ License

This project is licensed under the MIT License.

keitai-mcp

Tool Schema Changelog

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

Loading tool schema changelogโ€ฆ

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Enables AI agents to interact with Android devices through UI manipulation, screen capture, touch gestures, text input, and app management via ADB. Provides comprehensive mobile automation capabilities including element detection, navigation, and application control for Android device testing and interaction.
      9
      61 PyPI
      2
      -
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables an agent to control a real Android phone by reading structured UI elements and performing actions such as tapping, swiping, typing, and extracting fields from known app screens.
      1
      -
    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to automate Android and iOS devices, including emulators and physical devices, by capturing screenshots, reading UI accessibility trees, performing touch and text input, and managing app lifecycle and logs.
      18
      4
      MIT
    • A
      license
      C
      quality
      B
      maintenance
      Enables AI agents to control Android phones, emulators, redroid containers, iOS devices, and cloud-hosted devices through a perceive-act-verify loop of screen reading, taps, gestures, typing, and app launching. Exposes 138 tools for driving screens, elements, and files over adb, Portal APIs, and ios-portal without running ARM-only code on the device.
      94
      9 npm
      1
      MIT