# Running Claude Code and a Local MCP Server (sentinel-ir-mcp) on Android via Termux

> Source: <https://dev.to/jackymencz/running-claude-code-and-a-local-mcp-server-sentinel-ir-mcp-on-android-via-termux-5c16>
> Published: 2026-11-12 18:13:54+00:00

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.

In 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.

Step 1: Set Up Your Project and Verify the MCP Server in Termux

Before 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.

Run the built-in health check:

bash

npx -y [sentinel-ir-mcp@0.4](mailto:sentinel-ir-mcp@0.4) doctor

As 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.

Security 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.

Create a dedicated project folder and generate the setup command inside it:

bash

mkdir ~/my-project

cd ~/my-project

npx -y [sentinel-ir-mcp@0.4](mailto:sentinel-ir-mcp@0.4) setup --client claude-code

The setup wizard will output the exact registration command you will need for Claude Code.

Step 2: Why Direct Claude Code Installation Fails in Termux

If you try to install Claude Code directly inside Termux using npm install -g @anthropic-ai/claude-code, you will hit two roadblocks:

Anthropic ships prebuilt binaries for standard Linux (linux-arm64), which relies on glibc rather than Android's bionic libc.

Step 3: The Fix — Running Ubuntu in Termux (No Root Required)

You 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.

Install and log into Ubuntu:

bash

pkg update && pkg install -y proot-distro

proot-distro install ubuntu

proot-distro login ubuntu

Once your prompt changes to root@localhost:~#, you are inside Ubuntu. Now install Node.js and Claude Code:

bash

apt update && apt install -y curl

curl -fsSL [https://nodesource.com](https://nodesource.com) | bash -

apt install -y nodejs

npm install -g @anthropic-ai/claude-code

Step 4: Create a Sample File and Connect sentinel-ir-mcp

Navigate 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.

bash

cd /data/data/com.termux/files/home/my-project

cat << 'EOF' > test.js

const fs = require('fs');

const { exec } = require('child_process');

function runCommand(cmd) {

  exec(cmd);

}

module.exports = { runCommand };

EOF

Now register sentinel-ir-mcp with Claude Code using the command generated in Step 1:

bash

claude 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

Step 5: Launch Claude Code and Authenticate

Everything is wired up. Start the Claude Code CLI:

bash

claude

You will be greeted by Claude Code's pixel mascot ("Clawd") and guided through a quick one-time onboarding:

Putting It to the Test

Once inside the interactive prompt, ask Claude to inspect your workspace:

"Use sentinel-ir (analyze_directory) to scan this project and summarize any capability risks."

Under 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.

Independent Engineering Projects

Built as independent engineering experiments across AI, software analysis, security, and autonomous systems.

Evaluated by reproducible evidence, not by the number of layers.

Explore the projects:

Sentinel Ecosystem: AutoDoc-Sentinel, Sentinel-IR, Sentinel-IR-MCP and related tools.

Agentix Lite: Independent security and system-observation project.

Find the projects: GitLab repositories | NPM packages

Support the work: ⭐ Star the repositories on GitLab.

Connect: Follow me here on DEV Community or explore the Playground.

Each project is distributed under its own license. Check the corresponding repository or NPM package for licensing terms.

Copyright © 2026 jackymenCZ. All rights reserved. Written for the community.
