capacitor-mobile-claw
On-device AI agent engine for mobile apps — embedded Node.js worker with Claude LLM, file tools, code execution, git, and extensible MCP device tools
claude mcp add --transport stdio rogelioruiz-capacitor-mobile-claw npx -y capacitor-mobile-claw
How to use
Mobile Claw is an on-device AI agent runtime packaged as a Capacitor plugin. It runs a Claude-based agent loop directly on the device, with capabilities for file manipulation, code execution, and Git tooling, all accessible through a unified MCP (Mobile Capabilities Protocol) interface. The engine supports on-device memory via LanceDB, background scheduling via MobileCron, and a set of extensible MCP tools that can be wired into the agent so it can perform tasks without cloud Relay. Users interact with the agent through the provided reference app or by integrating the engine into their own app, listening for streaming agent events and sending prompts or messages to the agent. It also supports custom MCP tools and memory-related tools that the agent can call as part of its reasoning and task execution.
How to install
Prerequisites:\n- Node.js >= 22.x\n- npm or yarn\n- Android Studio for Android builds or Xcode 15+ for iOS builds\n- An Anthropic API key or Claude Max subscription for the agent to call the LLM\n\nInstall steps:\n1) Clone the repository and install plugin dependencies:\nbash\ngit clone https://github.com/rogelioRuiz/capacitor-mobile-claw.git\ncd capacitor-mobile-claw\n\nnpm install\n\n2) Build the plugin:\nbash\nnpm run build\n\n3) Set up and install the reference app (example):\nbash\ncd examples/reference-app\nnpm install\n\n4) Android setup (first time only, idempotent):\nbash\nnpm run setup:android\n\n5) Build the Android APK from the CLI:\nbash\nnpm run build:android\n\n6) Install on device: (Android)\nbash\nadb install -r android/app/build/outputs/apk/debug/app-debug.apk\n\n7) iOS setup (first time only, idempotent):\nbash\nnpm run setup:ios\n\n8) Build for iOS simulator from CLI:\nbash\nnpm run build:ios\n\n9) Optional: open Xcode project for device builds:\nbash\nnpx cap open ios\n
Additional notes
Notes and tips:\n- You must provide an Anthropic API key via settings in the reference app, or place credentials in examples/reference-app/.sentinel-creds.json as { "apiKey": "sk-..." } to run full tests.\n- Environment variables: ensure ANDROID_HOME and JAVA_HOME are set for Android builds; on macOS you may export:\n export ANDROID_HOME=$HOME/Library/Android/sdk\n export JAVA_HOME=$(/usr/libexec/java_home)\n- For iOS, ensure Xcode 15+ is installed; the Swift/SQLite patches may be applied automatically during npm install.\n- The plugin runs entirely on-device; no cloud relay is used for LLM calls, file tools, code execution, or memory operations.\n- If you plan to customize MCP tools, you can register additional tools via the provided API in the reference app and expose them to the agent.\n- When debugging, check the reference app logs for agent events, such as streaming text_delta events, tool invocations, and memory recalls.\n- Ensure you have a compatible Android/iOS runtime and device/emulator with sufficient resources for running an on-device AI agent.\n- The repository supports memory and background scheduling integrations; consider enabling memory stores and cron jobs to improve continuity across sessions.
Related MCP Servers
wcgw
Shell and coding agent on mcp clients
mobile
A Model Context Protocol (MCP) server that provides mobile automation capabilities.
local-skills
Universal MCP server enabling any LLM or AI agent to utilize expert skills from your local filesystem. Reduces context consumption through lazy loading. Works with Claude, Cline, and any MCP-compatible client.
docmole
Dig through any documentation with AI - MCP server for Claude, Cursor, and other AI assistants
mcp-client-gen
Turn any MCP server into a type-safe TypeScript SDK in seconds - with OAuth 2.1 and multi-provider support
mcp-claude-hackernews
An integration that allows Claude Desktop to interact with Hacker News using the Model Context Protocol (MCP).