apk-docforge
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@apk-docforge @apk-docforge analyze the APK at ./app.apk and summarize findings"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
apk-docforge
apk-docforge is a local-first Python toolkit for documenting and auditing Android
APK artifacts. It combines deterministic static analysis, optional controlled
runtime observation on an authorized ADB device, provenance-aware downloads, a
FastAPI web interface, and an MCP stdio server.
Use it only with applications you own, are authorized to assess, or may inspect under their license. The project does not bypass authentication, payments, DRM, certificate pinning, licensing, or anti-tamper controls.
Highlights
APK, APKS, and XAPK intake with quarantine and SHA-256 provenance.
Static mapping of package structure, manifest data, permissions, resources, screens, network signals, SDKs, features, and security findings.
Evidence references plus explicit
observed,inferred, andunknownstatus.Search adapters for F-Droid and GitHub Releases, plus exact-host allowlisted official URLs.
Controlled dynamic analysis on an explicitly selected ADB device, with non-destructive navigation and blocked sensitive flows.
Local web UI, JSON API, and MCP-compatible stdio tools.
Deterministic Markdown output with an optional bounded DeepSeek addendum.
Related MCP server: APK Security Guard MCP Suite
Quick start
Requirements: Python 3.11 or newer and uv.
uv sync --locked --extra dev
uv run --locked apk-docforge serve
open http://127.0.0.1:8765/Run a static analysis directly:
uv run --locked apk-docforge analyze ./app.apk --out ./outputs/app --mode staticThe generated directory includes analysis_summary.json, report.md,
codex_ingestion_prompt.md, qa_report.json, and versioned JSON evidence.
Security defaults
The HTTP service is intentionally local-only:
servedefaults to127.0.0.1and rejects every other bind address.The ASGI layer also rejects HTTP clients whose socket address is not loopback.
Trusted hosts are exactly
127.0.0.1andlocalhost.Browser cross-origin access is limited to configured loopback origins.
Upload bodies are bounded before and during multipart parsing.
Downloads validate
Content-Length, enforce a streaming byte limit, and revalidate every redirect and final URL against the source policy.Nested artifacts, archive expansion, and manifest reads have independent limits.
Settings are written atomically to a regular
.envfile with mode0600.
Default limits are conservative and configurable through environment variables:
Setting | Default |
| 256 MiB |
| 512 MiB |
| 256 MiB |
| 10,000 |
| 1 GiB |
| 5 |
Copy .env.example for local configuration and keep the resulting file private:
cp .env.example .env
chmod 600 .envSee SECURITY.md for the threat model and vulnerability reporting process.
Commands
apk-docforge analyze ./app.apk --out ./outputs/app --mode static
apk-docforge search "TeamNewPipe/NewPipe" --sources github --limit 1
apk-docforge download --candidate-id 3 --out ./downloads
apk-docforge import-device --package com.example.app --out ./downloads
apk-docforge sources
apk-docforge serve
apk-docforge mcp-serverDynamic analysis is opt-in and requires an authorized device serial:
apk-docforge analyze ./app.apk \
--out ./outputs/app-dynamic \
--mode dynamic \
--device emulator-5554search persists candidates in the local SQLite index and prints the numeric ID
accepted by download.
Download policy
F-Droid downloads stay on the approved F-Droid host.
GitHub release assets stay on approved GitHub asset hosts.
Official URLs require HTTPS and an exact DNS host in
APK_DOCFORGE_OFFICIAL_URL_ALLOWLIST; IP literals are rejected.Redirect destinations and the final response URL are evaluated with the same policy before their response bodies are accepted.
Third-party APK mirrors and Google Play scraping remain disabled.
The Google Play Developer adapter is a reserved integration point only; it does not currently search or download artifacts, even when a credentials path is configured.
Optional DeepSeek documentation
Set a key only if you want the optional documentation addendum:
export APK_DOCFORGE_DOCUMENTATION_PROVIDER=deepseek
export DEEPSEEK_API_KEY=...APK binaries and full decompiled source are not sent. The provider receives bounded JSON summaries and evidence references. Without a key, the deterministic local report remains available.
API and MCP
The local API includes health, upload, search, download, analysis, report,
findings, features, screens, sources, and settings endpoints under /api.
Interactive OpenAPI documentation is available at http://127.0.0.1:8765/docs.
MCP smoke test:
printf '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}\n' \
| uv run --locked apk-docforge mcp-serverOptional containers
Docker services bind to loopback only and are disabled unless their profile is selected. MobSF is pinned to a published versioned image:
docker compose --profile mobsf up mobsfPostgreSQL and Redis are future integration services; the application uses SQLite by default. Set a non-empty password before starting the future profile:
export APK_DOCFORGE_POSTGRES_PASSWORD='replace-with-a-strong-secret'
docker compose --profile future up postgres redisDevelopment
uv sync --locked --extra dev
uv run --locked --extra dev ruff check .
uv run --locked --extra dev pytestCI runs the same lint, formatting, and test gates on Python 3.11 and 3.12.
Current limitations
Static depth depends on optional Android tools such as
apkanalyzer,jadx, andapktool.Dynamic mode installs one selected primary APK; split-package installation is not implemented.
Runtime navigation never enters credentials or triggers login, payment, publishing, sharing, deletion, subscription, or logout flows.
Traffic interception and Frida-based instrumentation are intentionally absent.
The API has no remote authentication because remote binding is unsupported.
Available Tools
9 toolsanalyze_artifactC
Run static apk-docforge analysis for a local APK/APKS/XAPK artifact.
Inputs: path (required), out, mode, device.
download_appC
Download a persisted allowed candidate by numeric candidate id with quarantine and provenance.
Inputs: candidate_id (required), out.
get_analysisC
Get analysis summary and output paths by analysis id or database id.
Inputs: analysis_id (required).
get_codex_promptC
Get the generated Codex ingestion prompt for an analysis.
Inputs: analysis_id (required).
get_reportB
Get the Markdown report for an analysis.
Inputs: analysis_id (required).
list_featuresB
List inferred and observed features for an analysis.
Inputs: analysis_id (required).
list_findingsB
List security findings for an analysis.
Inputs: analysis_id (required).
list_screensC
List static screens mapped for an analysis.
Inputs: analysis_id (required).
search_appsA
Search allowed app sources without downloading, then persist candidates locally.
Inputs: query (required), limit, sources.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool targets a distinct stage or artifact: search/download handle acquisition, analyze_artifact creates the analysis, and the get/list tools expose distinct outputs such as findings, features, screens, reports, or prompts. There are no overlapping tool purposes that would confuse an agent.
All tool names follow a consistent verb_noun pattern: search_*, download_*, analyze_*, get_*, and list_*. The get_ vs list_ split is also consistent: get_ returns a single item or document, while list_ returns a collection.
Nine tools is an appropriate size for an APK analysis pipeline. Every tool maps to a distinct workflow step or output artifact, and none feel redundant or extraneous.
The pipeline covers the full lifecycle needed for APK docforge work: search, download, analysis, report generation, prompt generation, and detailed findings/feature/screen listings. The only minor gap is the absence of a general list_analyses or candidate-management tool, which could limit discoverability but does not break the core workflow.
Maintenance
Related MCP Connectors
Remote MCP for Android CLI agent build gate, structured receipts, audit logs, and reviewer-ready evi
MCP server for static security analysis of Android source code
Scan Android and iOS apps for security issues: findings, MASVS mapping and pentest reports.
Scan any MCP server for tool-poisoning, security, auth & license. Trust score before install.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides a one-stop automated solution for Android APK security analysis by integrating tools like JEB, JADX, APKTOOL, FlowDroid, and MobSF into unified MCP standard API interfaces.11-
- FlicenseNot gradedqualityDmaintenanceIntegrates multiple Android APK security analysis tools into MCP standard APIs for automated static and dynamic analysis and vulnerability detection.-
- AlicenseNot gradedqualityDmaintenanceLocal static-analysis assistant for Android malware research that manages investigation cases, exposes MCP tools via a local server, and persists evidence-backed findings without cloud dependency.MIT
- FlicenseNot gradedqualityBmaintenanceEnables Android APK security auditing through natural language by decompiling APKs with Apktool and running static analysis heuristics for attack surface, permissions, secrets, crypto, native libraries, and more, with every analysis logged to disk as markdown reports.-