streamable-httpupdated 5mo ago
MCP server for static security analysis of Android application source code. Runs on Cloudflare Workers as a remote MCP server over Streamable HTTP.
What can you do with Android Security Analyzer?
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
| Tool | Description |
|---|---|
analyze_android_project |
Full security analysis of project files |
list_android_security_checks |
List all implemented security rules |
explain_finding |
Detailed explanation of a specific rule |
health |
Server 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:
npm install
Development
npm run dev
This starts a local Wrangler dev server. The MCP endpoint is available at http://localhost:8787/mcp.
Deploy
npm run deploy
Deploys to Cloudflare Workers. Requires wrangler authentication (npx wrangler login).
Testing
npm test # Run all tests
npm run test:watch # Watch mode
npm run typecheck # TypeScript type checking
Local MCP Testing
Initialize the connection
Unix:
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):
(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:
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, ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ ΡΡΡΠΎΠΉ ΠΎΡΠ²Π΅Ρ:
(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:
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):
(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:
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):
$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:
{
"mcpServers": {
"android-security-analyzer": {
"url": "http://localhost:8787/mcp"
}
}
}
For production (hosted):
{
"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:
| Category | Prefix | Rules | Examples |
|---|---|---|---|
| Manifest | MAN-* | 17 | debuggable, allowBackup, exported components, permissions |
| Gradle | GRD-* | 9 | release config, SDK versions, dependencies, secrets |
| Source | SRC-* | 17 | WebView, SSL/TLS, crypto, injection, file storage |
| XML Config | XML-* | 4 | network security config, file provider paths |
| Secret | SEC-* | 7 | API 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 utilities
test/
βββ fixtures/ # Sample Android project files
βββ unit/ # Unit tests per module
βββ integration/ # Full analysis integration tests
Adding New Rules
- Define the rule in the appropriate file under
src/rules/ - Add detection logic in the corresponding analyzer under
src/analyzers/ - Add CWE mapping in
src/mappings/cwe.tsif needed - Add a test case
- The rule is automatically registered via
src/core/registry.ts
License
MIT
Install
Add Android Security Analyzer to your client. Pick the one you use.
claude mcp add --transport http android-security-analyzer https://android-security-analyzer.ako-labs.workers.dev/mcpcodex mcp add android-security-analyzer --url https://android-security-analyzer.ako-labs.workers.dev/mcp{
"mcpServers": {
"android-security-analyzer": {
"url": "https://android-security-analyzer.ako-labs.workers.dev/mcp"
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
{
"servers": {
"android-security-analyzer": {
"type": "http",
"url": "https://android-security-analyzer.ako-labs.workers.dev/mcp"
}
}
}Add to `.vscode/mcp.json` in your workspace.
{
"mcpServers": {
"android-security-analyzer": {
"url": "https://android-security-analyzer.ako-labs.workers.dev/mcp"
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"android-security-analyzer": {
"serverUrl": "https://android-security-analyzer.ako-labs.workers.dev/mcp"
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
Score
39 / 100
Incomplete
- Documentation25/25
- Maintenance13/25
- Trust6/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 170 days ago
- Has a release history
- Repository is not archived
- No licence detected
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 6 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint β no local install
Version history
| Versions | Published |
|---|---|
| 1.0.0Latest | Mar 14, 2026 |