{"slug": "running-claude-code-and-a-local-mcp-server-sentinel-ir-mcp-on-android-via-termux", "title": "Running Claude Code and a Local MCP Server (sentinel-ir-mcp) on Android via Termux", "summary": "A developer documented a method for running Anthropic's Claude Code CLI on Android by installing Ubuntu through proot-distro inside Termux, bypassing the glibc/bionic libc mismatch that blocks Anthropic's prebuilt linux-arm64 binaries. The setup wires Claude Code to a local sentinel-ir-mcp server over stdio, letting the agent run analyze_code, analyze_directory and analyze_file tools against a project folder, and the MCP server deliberately refuses to grant access to the entire Termux home directory.", "body_md": "Want a full-featured AI coding agent right in your pocket on Android, connected to your own local Model Context Protocol (MCP) server? While Anthropic's official Claude Code CLI doesn't natively support Android out of the box, you can get the entire stack running smoothly inside Termux in just a few minutes.\n\nIn this guide, we will walk through the complete setup step-by-step—including how to bypass the exact installation roadblocks you hit on Android and how to wire up sentinel-ir-mcp so Claude can inspect your code safely without burning tokens.\n\nStep 1: Set Up Your Project and Verify the MCP Server in Termux\n\nBefore installing the AI client, create a dedicated workspace and verify that the MCP server (sentinel-ir-mcp) runs properly in your Termux Node.js environment.\n\nRun the built-in health check:\n\nbash\n\nnpx -y [sentinel-ir-mcp@0.4](mailto:sentinel-ir-mcp@0.4) doctor\n\nAs long as you have Node.js 20+ installed, doctor will verify the handshake and confirm that all three tools (analyze_code, analyze_directory, and analyze_file) work properly.\n\nSecurity Safeguard Note: If you run npx -y [sentinel-ir-mcp@0.4](mailto:sentinel-ir-mcp@0.4) setup directly inside your Termux home folder (~), the tool will intentionally block you with: Refusing to give the agent access to your whole home folder. By design, it prevents AI agents from scanning personal configs or sensitive files outside a specific project directory.\n\nCreate a dedicated project folder and generate the setup command inside it:\n\nbash\n\nmkdir ~/my-project\n\ncd ~/my-project\n\nnpx -y [sentinel-ir-mcp@0.4](mailto:sentinel-ir-mcp@0.4) setup --client claude-code\n\nThe setup wizard will output the exact registration command you will need for Claude Code.\n\nStep 2: Why Direct Claude Code Installation Fails in Termux\n\nIf you try to install Claude Code directly inside Termux using npm install -g @anthropic-ai/claude-code, you will hit two roadblocks:\n\nAnthropic ships prebuilt binaries for standard Linux (linux-arm64), which relies on glibc rather than Android's bionic libc.\n\nStep 3: The Fix — Running Ubuntu in Termux (No Root Required)\n\nYou can bypass the Android binary limitation cleanly using proot-distro, which runs a full Ubuntu userland inside Termux without requiring root access—while still giving you direct filesystem access to your Termux project folders.\n\nInstall and log into Ubuntu:\n\nbash\n\npkg update && pkg install -y proot-distro\n\nproot-distro install ubuntu\n\nproot-distro login ubuntu\n\nOnce your prompt changes to root@localhost:~#, you are inside Ubuntu. Now install Node.js and Claude Code:\n\nbash\n\napt update && apt install -y curl\n\ncurl -fsSL [https://nodesource.com](https://nodesource.com) | bash -\n\napt install -y nodejs\n\nnpm install -g @anthropic-ai/claude-code\n\nStep 4: Create a Sample File and Connect sentinel-ir-mcp\n\nNavigate to your Termux project folder (accessible directly from Ubuntu via its full path), create a sample JavaScript file with risky capabilities to test the analyzer, and register your MCP server.\n\nbash\n\ncd /data/data/com.termux/files/home/my-project\n\ncat << 'EOF' > test.js\n\nconst fs = require('fs');\n\nconst { exec } = require('child_process');\n\nfunction runCommand(cmd) {\n\n  exec(cmd);\n\n}\n\nmodule.exports = { runCommand };\n\nEOF\n\nNow register sentinel-ir-mcp with Claude Code using the command generated in Step 1:\n\nbash\n\nclaude mcp add --transport stdio sentinel-ir -- npx -y [sentinel-ir-mcp@0.4](mailto:sentinel-ir-mcp@0.4) /data/data/com.termux/files/home/my-project\n\nStep 5: Launch Claude Code and Authenticate\n\nEverything is wired up. Start the Claude Code CLI:\n\nbash\n\nclaude\n\nYou will be greeted by Claude Code's pixel mascot (\"Clawd\") and guided through a quick one-time onboarding:\n\nPutting It to the Test\n\nOnce inside the interactive prompt, ask Claude to inspect your workspace:\n\n\"Use sentinel-ir (analyze_directory) to scan this project and summarize any capability risks.\"\n\nUnder the hood, Claude calls your local sentinel-ir-mcp server over stdio. Instead of ingesting raw source code, it receives a compact structural Intermediate Representation (IR) and immediately flags the critical risk from child_process (cp.exec)—giving you a fast, token-efficient, and sandboxed AI development workflow right on your phone.\n\nIndependent Engineering Projects\n\nBuilt as independent engineering experiments across AI, software analysis, security, and autonomous systems.\n\nEvaluated by reproducible evidence, not by the number of layers.\n\nExplore the projects:\n\nSentinel Ecosystem: AutoDoc-Sentinel, Sentinel-IR, Sentinel-IR-MCP and related tools.\n\nAgentix Lite: Independent security and system-observation project.\n\nFind the projects: GitLab repositories | NPM packages\n\nSupport the work: ⭐ Star the repositories on GitLab.\n\nConnect: Follow me here on DEV Community or explore the Playground.\n\nEach project is distributed under its own license. Check the corresponding repository or NPM package for licensing terms.\n\nCopyright © 2026 jackymenCZ. All rights reserved. Written for the community.", "url": "https://wpnews.pro/news/running-claude-code-and-a-local-mcp-server-sentinel-ir-mcp-on-android-via-termux", "canonical_source": "https://dev.to/jackymencz/running-claude-code-and-a-local-mcp-server-sentinel-ir-mcp-on-android-via-termux-5c16", "published_at": "2026-11-12 18:13:54+00:00", "updated_at": "2026-11-12 18:22:59.847385+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "agent-protocols", "developer-tools"], "entities": ["Anthropic", "Claude Code", "Termux", "proot-distro", "sentinel-ir-mcp", "Ubuntu", "Node.js"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/running-claude-code-and-a-local-mcp-server-sentinel-ir-mcp-on-android-via-termux", "markdown": "https://wpnews.pro/news/running-claude-code-and-a-local-mcp-server-sentinel-ir-mcp-on-android-via-termux.md", "text": "https://wpnews.pro/news/running-claude-code-and-a-local-mcp-server-sentinel-ir-mcp-on-android-via-termux.txt", "jsonld": "https://wpnews.pro/news/running-claude-code-and-a-local-mcp-server-sentinel-ir-mcp-on-android-via-termux.jsonld"}}