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:
npx -y 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 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:
mkdir ~/my-project
cd ~/my-project
npx -y 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
Installing Claude Code directly via npm install -g @anthropic-ai/claude-code in Termux fails due to:
-
Blocked lifecycle scripts: Newer
npmversions blockpostinstallscripts by default. -
Missing Android binaries: The installer lacks builds for Android's
bioniclibc, supporting only standard Linux (linux-arm64) and other desktop/server platforms.
Step 3: The Fix — Running Ubuntu in Termux (No Root Required)
You can bypass this by running Ubuntu via proot-distro inside Termux:
pkg update && pkg install -y proot-distro
proot-distro install ubuntu
proot-distro login ubuntu
Once inside the Ubuntu environment, install Node.js and Claude Code:
apt update && apt install -y curl
curl -fsSL 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.
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:
claude mcp add --transport stdio sentinel-ir -- npx -y 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:
claude
You will be greeted by Claude Code's pixel mascot ("Clawd") and guided through a quick one-time onboarding:
- Choose your preferred terminal theme (e.g., Dark mode).
- Select your authentication method—either a standard Claude.ai subscription (Pro / Max) or an Anthropic Console API account with usage credits.
- Open the authentication link in your phone's browser, approve access, and paste the verification code back into Termux.
- Trust the
/data/data/com.termux/files/home/my-projectworkspace when prompted.
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.
Is Your Code Used to Train AI? The Security-First Guide to Claude Code + sentinel-ir-mcp
With everyone talking about Claude Code right now, it is completely fair for security-conscious developers to ask: Does my proprietary code end up training Anthropic’s models, and can the AI snoop through my private files?
The short answer is no, not when configured properly. By pairing Claude Code with a local "sentinel-ir-mcp" server, you can introduce an additional security layer between your local codebase and your AI tooling.
Think of "sentinel-ir-mcp" as a strict security gate standing between your private files and the AI agent.
Here is the security breakdown, including the relevant privacy policies, technical limitations, and commands to configure your environment.
- Your Code Is NOT Used to Train Models
How Anthropic handles your data depends on your account type and settings:
- API Keys, Team & Enterprise Plans: Under Anthropic's Commercial Terms, customer inputs and outputs are not used for model training by default. Standard retention and Zero Data Retention options depend on account eligibility and configuration.
- Personal Accounts (Claude Pro / Max): These fall under Consumer Terms. Users can manage model-training permissions through "Anthropic's privacy settings" (https://claude.ai/settings/data-privacy-controls).
- The "/feedback" Warning: Avoid submitting sensitive code through "/feedback", bug reports, or sharing features. Explicit feedback submissions may be retained separately for service improvement.
- Your Raw Code and Secrets Need Protection
The local "sentinel-ir-mcp" server provides an additional inspection layer before source information is made available through its MCP tools.
Its security-oriented features include:
- Local Execution: Source analysis runs locally rather than requiring your project files to be uploaded to an external analysis service.
- Intermediate Representation (IR): Instead of relying exclusively on raw source code, the server can provide compact structural information, including risk signals, forbidden operations, and relevant code locations.
- File Exclusions: Configure restricted paths and file patterns to prevent the MCP server from processing sensitive files.
- Symlink Protection: Symbolic links are skipped during directory scanning.
- SHA-256 Audit Trail: Local audit records can provide integrity fingerprints for analyzed content.
Important distinction: A local MCP server does not automatically control everything Claude Code can access. Claude Code has its own permissions, tools, and filesystem access. The MCP server's restrictions apply to its own operations, not necessarily to the entire AI agent.
- How to Configure Your Environment
The following setup adds restrictions to the local MCP server and reduces non-essential Claude Code traffic.
Step 1: Configure sentinel-ir-mcp exclusions
Run these commands inside your project directory:
cd your-project-folder
npx -y sentinel-ir-mcp@0.4 setup \
--client claude-code \
--exclude secrets \
--exclude ".env*" \
--exclude "*.pem"
These exclusions configure the MCP server's scanning scope. They should not be interpreted as a global filesystem restriction for Claude Code.
Step 2: Disable non-essential traffic
Add the following environment variables to your shell profile ("~/.bashrc" or "~/.zshrc"):
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
export DISABLE_TELEMETRY=1
export DISABLE_ERROR_REPORTING=1
export DISABLE_FEEDBACK_COMMAND=1
These settings should be checked against the current Claude Code documentation because supported environment variables and their behavior can change between releases.
Step 3: Reduce local session caching
Edit:
"~/.claude/settings.json"
Set the cleanup period to one day:
{
"cleanupPeriodDays": 1
}
This controls local session cleanup. It does not change Anthropic's server-side data retention policies.
- What This Setup Actually Protects
It is important to distinguish between three separate security boundaries:
Security layer| What it controls
Anthropic privacy settings| Whether submitted data can be used for model training
Claude Code permissions| What the AI agent can access and execute
sentinel-ir-mcp| What the MCP server itself can inspect and expose
No single configuration replaces the others.
A local MCP server is an additional security component, not a complete sandbox or a guarantee that proprietary source code never reaches a cloud service.
Bottom Line: Security Before Convenience
You do not have to abandon advanced AI development tools to take source-code privacy seriously.
Combining commercial data-protection terms, carefully configured Claude Code permissions, and a local "sentinel-ir-mcp" analysis layer provides a more controlled development environment.
The important thing is understanding exactly where each security boundary begins and ends.
Experiment first. Headline second. Security claims should always match what the software actually enforces.
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.







Top comments (0)