Android Security Analyzer

io.github.ako2345Published by GitHub account ako2345v1.0.0Updated Oct 24, 2026

MCP server for static security analysis of Android source code

VerifiedStreamable HTTPWeb executableDeveloper ToolsSecurity & Monitoring

Overview

AI-generated overview

Remote MCP server that statically scans Android project source files for security issues and returns a scored report with fixes.

What you can do
  • Analyze Android project files (manifest, Gradle, Java/Kotlin, XML configs) and get a structured security report with findings, severity, confidence, CWE/OWASP mappings and recommendations
  • List the implemented security checks with their rule IDs, categories, severity levels and descriptions
  • Explain a single finding by rule ID, including why it is a risk, how to fix it and false-positive considerations
  • Check server health, version and rule engine statistics
When to use it
Useful when reviewing Android app source for common security mistakes such as exported components, debug flags, cleartext traffic, insecure WebView or SSL settings, weak crypto, hardcoded secrets and risky Gradle release configs, without building the project or installing an Android SDK.
Requirements
A remote Streamable HTTP endpoint; no local install, account, API key or header is declared. The README also documents running it locally with Node.js and Wrangler, and deploying to Cloudflare Workers requires wrangler authentication.
Before you install
Project source files, including any hardcoded secrets, are sent to a third-party hosted endpoint for analysis. Results are regex/pattern-based heuristics, not full SAST, so false positives and missed issues are expected, and APK/AAB or inter-procedural analysis is not supported. Treat findings as a starting point, not a security sign-off.

Installation

In SourceWeft

  1. Open Android Security Analyzer in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.ako2345%2Fandroid-security-analyzer/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "android-security-analyzer": {
      "type": "http",
      "url": "https://android-security-analyzer.ako-labs.workers.dev/mcp"
    }
  }
}

README

Android Security Analyzer

MCP server for static security analysis of Android application source code. Runs on Cloudflare Workers as a remote MCP server over Streamable HTTP.

What it does

Analyzes Android project source files — without building the project — and returns a structured security report. The analysis covers:

  • Manifest analysis — exported components, dangerous permissions, cleartext traffic, debug flags, backup settings, SDK versions
  • Gradle/build config — release build misconfigurations, outdated SDKs, suspicious dependencies, hardcoded secrets
  • Source code (Java/Kotlin) — insecure WebView, SSL/TLS bypass, weak crypto, SQL injection patterns, process execution, insecure file storage, PendingIntent issues
  • XML configuration — network security config weaknesses, overly broad file provider paths
  • Secret scanning — API keys, tokens, passwords, private keys, cloud credentials, high-entropy strings

All analysis is regex/pattern-based and runs natively in the Workers runtime with no external tools, Java, or Android SDK required.

Architecture

POST /mcp ──► McpServer (JSON-RPC 2.0) ──► Tool Router                                              │              ┌───────────────────────────────┘              ▼         Orchestrator              │    ┌─────────┼─────────┬─────────────┬──────────────┐    ▼         ▼         ▼             ▼              ▼ Manifest  Gradle   Source Code   XML Config    Secret Analyzer  Analyzer  Analyzer     Analyzer     Scanner    │         │         │             │              │    └─────────┴─────────┴─────────────┴──────────────┘              │              ▼     Scoring + Deduplication ──► AnalysisReport

Key design decisions:

  • Stateless — no sessions, no Durable Objects
  • Minimal MCP JSON-RPC 2.0 implementation (no heavy SDK dependencies)
  • Data-driven rule engine with extensible rule registry
  • Independent analyzers with unified Finding type
  • Lightweight XML parsing via fast-xml-parser
  • Input validation via zod
  • Bundle size: ~66KB gzipped

MCP Tools

ToolDescription
analyze_android_projectFull security analysis of project files
list_android_security_checksList all implemented security rules
explain_findingDetailed explanation of a specific rule
healthServer status and rule engine stats

Install

Hosted server (recommended for Cline / MCP clients): no local install needed. The server runs at:

https://android-security-analyzer.ako-labs.workers.dev/mcp

Add this URL to your MCP client configuration (see Connecting from an MCP client below).

Local development:

bash
npm install

Development

bash
npm run dev

This starts a local Wrangler dev server. The MCP endpoint is available at http://localhost:8787/mcp.

Deploy

bash
npm run deploy

Deploys to Cloudflare Workers. Requires wrangler authentication (npx wrangler login).

Testing

bash
npm test              # Run all testsnpm run test:watch    # Watch modenpm run typecheck     # TypeScript type checking

Local MCP Testing

Initialize the connection

Unix:

bash
curl -X POST http://localhost:8787/mcp \  -H "Content-Type: application/json" \  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'

Windows (PowerShell):

powershell
(Invoke-WebRequest -Method Post -Uri "http://localhost:8787/mcp" -ContentType "application/json" -Body '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' -UseBasicParsing).Content

List available tools

Unix:

bash
curl -X POST http://localhost:8787/mcp \  -H "Content-Type: application/json" \  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'

Windows (PowerShell): ответ приходит в result.tools; чтобы увидеть список как JSON, используйте сырой ответ:

powershell
(Invoke-WebRequest -Method Post -Uri "http://localhost:8787/mcp" -ContentType "application/json" -Body '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' -UseBasicParsing).Content

Либо через объект: (Invoke-RestMethod ...).result.tools | ConvertTo-Json -Depth 5

Check health

Unix:

bash
curl -X POST http://localhost:8787/mcp \  -H "Content-Type: application/json" \  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"health","arguments":{}}}'

Windows (PowerShell):

powershell
(Invoke-WebRequest -Method Post -Uri "http://localhost:8787/mcp" -ContentType "application/json" -Body '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"health","arguments":{}}}' -UseBasicParsing).Content

Run analysis (minimal example)

Unix:

bash
curl -X POST http://localhost:8787/mcp \  -H "Content-Type: application/json" \  -d '{    "jsonrpc": "2.0",    "id": 4,    "method": "tools/call",    "params": {      "name": "analyze_android_project",      "arguments": {        "projectName": "TestApp",        "files": [          {            "path": "app/src/main/AndroidManifest.xml",            "content": "<manifest><application android:debuggable=\"true\" android:allowBackup=\"true\"></application></manifest>"          }        ]      }    }  }'

Windows (PowerShell):

powershell
$body = @{  jsonrpc = "2.0"  id = 4  method = "tools/call"  params = @{    name = "analyze_android_project"    arguments = @{      projectName = "TestApp"      files = @(        @{          path = "app/src/main/AndroidManifest.xml"          content = "<manifest><application android:debuggable=`"true`" android:allowBackup=`"true`"></application></manifest>"        }      )    }  }} | ConvertTo-Json -Depth 10(Invoke-WebRequest -Method Post -Uri "http://localhost:8787/mcp" -ContentType "application/json" -Body $body -UseBasicParsing).Content

Connecting from an MCP client

Add to your MCP client configuration:

json
{  "mcpServers": {    "android-security-analyzer": {      "url": "http://localhost:8787/mcp"    }  }}

For production (hosted):

json
{  "mcpServers": {    "android-security-analyzer": {      "url": "https://android-security-analyzer.ako-labs.workers.dev/mcp"    }  }}

Security Rules

The analyzer implements 53 security rules across 5 categories:

CategoryPrefixRulesExamples
ManifestMAN-*17debuggable, allowBackup, exported components, permissions
GradleGRD-*9release config, SDK versions, dependencies, secrets
SourceSRC-*17WebView, SSL/TLS, crypto, injection, file storage
XML ConfigXML-*4network security config, file provider paths
SecretSEC-*7API keys, tokens, passwords, cloud credentials

Each finding includes:

  • Stable rule ID
  • Severity (critical/high/medium/low/info) and confidence (high/medium/low)
  • File path and line number (when determinable)
  • Evidence snippet
  • CWE and OWASP Mobile Top 10 mappings
  • Actionable recommendation

Scoring

Risk score (0-100) is computed from finding severities:

  • Critical: 9 points
  • High: 6 points
  • Medium: 3 points
  • Low: 1 point
  • Info: 0 points

The raw sum is normalized against an expected maximum of 50 points.

Limitations

  • Not a SAST replacement — pattern/regex-based heuristics, not full AST/dataflow analysis
  • No build required — analyzes raw source, so build-time transforms are not visible
  • False positives possible — especially for secret scanning and some code patterns
  • Workers constraints — 128MB memory limit, CPU time limits, no filesystem access
  • No APK/AAB analysis — source code only
  • No inter-procedural analysis — patterns are matched per-file, not across call graphs

Project Structure

src/├── index.ts                          # Worker entry point├── server/│   ├── mcp.ts                        # MCP JSON-RPC 2.0 handler│   └── tools/                        # MCP tool implementations│       ├── analyzeAndroidProject.ts│       ├── listAndroidSecurityChecks.ts│       ├── explainFinding.ts│       └── health.ts├── core/│   ├── types.ts                      # TypeScript types & Zod schemas│   ├── scoring.ts                    # Risk score computation│   ├── registry.ts                   # Rule registry│   └── orchestrator.ts              # Analysis orchestrator├── analyzers/│   ├── manifestAnalyzer.ts│   ├── gradleAnalyzer.ts│   ├── sourceAnalyzer.ts│   ├── xmlConfigAnalyzer.ts│   └── secretScanner.ts├── parsers/│   ├── xml.ts                        # XML parser wrapper│   ├── gradle.ts                     # Gradle file parser│   ├── source.ts                     # Source code pattern matcher│   └── files.ts                      # File classifier├── rules/│   ├── manifestRules.ts│   ├── gradleRules.ts│   ├── sourceRules.ts│   ├── xmlRules.ts│   └── secretRules.ts├── mappings/│   ├── cwe.ts                        # CWE descriptions│   └── owaspMobile.ts               # OWASP Mobile Top 10└── utils/    ├── lines.ts                      # Line number utilities    ├── paths.ts                      # Path classification    └── text.ts                       # Text utilitiestest/├── fixtures/                         # Sample Android project files├── unit/                             # Unit tests per module└── integration/                      # Full analysis integration tests

Adding New Rules

  1. Define the rule in the appropriate file under src/rules/
  2. Add detection logic in the corresponding analyzer under src/analyzers/
  3. Add CWE mapping in src/mappings/cwe.ts if needed
  4. Add a test case
  5. The rule is automatically registered via src/core/registry.ts

License

MIT

Source: README.md at commit a14bd0d

Tools

4

analyze_android_project

Analyzes an Android project's source code for security vulnerabilities. Accepts project files (AndroidManifest.xml, build.gradle, Java/Kotlin sources, XML configs) and returns a structured security report with findings, severity scores, and recommendations.

ParametersfilesrequiredoptionsprojectNamerequired

list_android_security_checks

Returns the list of all implemented security checks/rules with their IDs, categories, severity levels, and descriptions.

Parameterscategory

explain_finding

Explains a specific security finding by its rule ID. Returns why it is a risk, how to fix it, and false positive considerations.

ParametersfindingIdrequired

health

Returns the server health status, version, and rule engine statistics.

Takes no parameters.

Version history

1
  1. v1.0.0LatestSep 16, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.