Apktool MCP Server

by zinja-coder
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Provides tools for Android APK reverse engineering, including decoding APKs, examining smali code, analyzing manifests, inspecting resources, building modified APKs, and signing APKs for installation.

  • Integration with Kali Linux for running the APKTool MCP server in a security-focused environment, specifically mentioning Claude Desktop for Debian-based Linux.

  • Features a demo video on YouTube showcasing the APKTool MCP server's capabilities for reverse engineering Android applications.

apktool-mcp-server (Part of Zin's Reverse Engineering MCP Suite)

Image generated using AI tools.


🤖 What is apktool-mcp-server?

apktool-mcp-server is a MCP server for the Apk Tool that integrates directly with Model Context Protocol (MCP) to provide live reverse engineering support with LLMs like Claude.

Think: "Decompile → Context-Aware Code Review → AI Recommendations" — all in real time.

Watch the demo!

Other MCP Servers For Android Reverse Engineering

Current MCP Tools

The following MCP tools are available:

  • build_apk() — Build an APK from a decoded APKTool Project.
  • list_workspace_projects() — List all APKTool project direcotries in workspace.
  • get_manifest() — Get the AndroidManifest.xml content from a decoded APK project.
  • get_apktool_yml() — Get apktool.yml information from a decoded APK project.
  • list_smali_directories() — List all smali directories in a project.
  • list_smali_files() — List smali files in a specific smali directory, optinally filtered by package prefix.
  • get_smali_file() — Get content of a specific smali file by class name.
  • modify_smali_file() — Modify the content of a specific smali file.
  • list_resources() — List resources in a project, optionally filtered by resource type.
  • get_resource_file() — Get Content of a specific resource file.
  • modify_resource_file() — Modify the content of a specific resource file.
  • search_in_file() — Search for a pattern in files with specified extensions.
  • check_apktool_version() — Check the installed APKTool version.
  • sign_apk() — Sign an APK file.
  • install_apk() — Install and APK on a connected device using ADB. // to be migrated to upcoming ADB MCP Server
  • extract_dex() — Extract DEX files from original APK (if available in project).
  • list_packages() — List installed packages on a connected Android device using ADB. // to be migrated to upcoming ADB MCP Server
  • analyze_permissions() — Analyze permissions declared in AndroidManifest.xml.
  • clean_project() — Clean a project directory to prepare for rebuilding.
  • create_project() — Create a new empty APKTool project structure.
  • delete_project() — Delete an APKTool project directory
  • compare_smali_files() — Compare two smali files and show differences.
  • get_available_devices() — Get list of available Android devices connected via ADB // to be migrated to upcoming ADB MCP Server
  • decode_apk() — Decode an APK file using APKTool, extracting resources and smali code.

🗒️ Sample Prompts

🔍 Basic Code Understanding

  • “List all smali directories for the dvac project.”
  • “Show me all the smali files under the package prefix com.vulnerable.component in the dvac project.”
  • “Get the smali code for the class com.vulnerable.component.MainActivity.”
  • “Compare MainActivity.smali with its previous version and show differences.”
  • “Search for usage of startActivity in smali files of dvac project.”

🛡️ Vulnerability Detection

  • “Analyze declared permissions in the dvac AndroidManifest.xml and flag dangerous ones.”
  • “Search for hardcoded URLs or IPs in all .xml and .smali files in the project.”
  • “Find all uses of PendingIntent.getActivity in smali files.”
  • “Check for exported activities or receivers in dvac’s AndroidManifest.xml.”
  • “List all smali files that access android.permission.SEND_SMS or READ_CONTACTS.”

🛠️ Reverse Engineering Helpers

  • “Decode this APK: dvac.apk and create a project called dvac.”
  • “Create a new APKTool project called test-harness.”
  • “Clean the dvac project before rebuild.”
  • “Extract DEX files from dvac project for external analysis.”
  • “Modify MainActivity.smali to insert a log line at the beginning of onCreate().”

📦 Static Analysis

  • “Get the complete AndroidManifest.xml from dvac project.”
  • “Show the contents of apktool.yml for the dvac project.”
  • “List all resource files of type layout.”
  • “Search for the word password in all resource and smali files.”
  • “Check which permissions are used and compare them against typical over-permissioning risks.”

🤖 AI Code Modification

  • “Modify the onCreate() method in MainActivity.smali to add a toast message.”
  • “Replace all http:// links with https:// in strings.xml.”
  • “Add the android:exported=false attribute to all activities in the AndroidManifest.xml.”
  • “Patch the method validateLogin in LoginManager.smali to always return true.”
  • “Add logging statements to every method in MainActivity.smali.”

📄 Documentation & Metadata

  • “List all decoded APKTool projects in the workspace.”
  • “Show me the apktool.yml config to review the version, original APK metadata, and compression settings.”
  • “Get all available Android devices connected via ADB. (To be migrated to ADB MCP Server.)”
  • “Get metadata about the project dvac from its apktool.yml.”
  • “Check which APKTool version is currently installed on the server.”

🛠️ Getting Started

1. Downlaod from Releases: https://github.com/zinja-coder/apktool-mcp-server/releases

# 0. Download the apktool-mcp-server-<version>.zip https://github.com/zinja-coder/apktool-mcp-server/releases # 1. unzip apktool-mcp-server-<version>.zip ├apktool-mcp-server/ ├── apktool_mcp_server.py ├── requirements.txt ├── README.md ├── LICENSE ```bash # 2. Navigate to apktool-mcp-server directory cd apktool-mcp-server # 3. This project uses uv - https://github.com/astral-sh/uv instead of pip for dependency management. ## a. Install uv (if you dont have it yet) curl -LsSf https://astral.sh/uv/install.sh | sh ## b. OPTIONAL, if for any reasons, you get dependecy errors in apktool-mcp-server, Set up the environment uv venv source .venv/bin/activate # or .venv\Scripts\activate on Windows ## c. OPTIONAL Install dependencies uv pip install httpx fastmcp # The setup for apktool-mcp-server is done.

🤖 2. Claude Desktop Setup

Make sure Claude Desktop is running with MCP enabled.

For instance, I have used following for Kali Linux: https://github.com/aaddrick/claude-desktop-debian

Configure and add MCP server to LLM file:

nano ~/.config/Claude/claude_desktop_config.json

And following content in it:

{ "mcpServers": { "apktool-mcp-server": { "command": "/<path>/<to>/uv", "args": [ "--directory", "</PATH/TO/>apktool-mcp-server/", "run", "apktool_mcp_server.py" ] } } }

Then, navigate code and interact via real-time code review prompts using the built-in integration.

To report bugs, issues, feature suggestion, Performance issue, general question, Documentation issue.

  • Kindly open an issue with respective template.
  • Tested on Claude Desktop Client, support for other AI will be tested soon!

🙏 Credits

This project is a MCP Server for Apktool, an amazing open-source Android reverse engineering tool created and maintained by @iBotPeaches. All core APK decoding and resource processing logic belongs to them. I have only extended it to support my MCP server with AI capabilities.

📎 Original README (Apktool)

The original README.md from Apktool is included here in this repository for reference and credit.

Also huge thanks to @aaddrick for developing Claude desktop for Debian based Linux.

And in last, thanks to @anthropics for developing the Model Context Protocol and @FastMCP team.

📄 License

apktool-mcp-server and all related projects inherits the Apache 2.0

Disclaimer

The tools apktool-mcp-server and all related tools under this project are intended strictly for educational, research, and ethical security assessment purposes. They are provided "as-is" without any warranties, expressed or implied. Users are solely responsible for ensuring that their use of these tools complies with all applicable laws, regulations, and ethical guidelines.

By using apktool-mcp-server, you agree to use them only in environments you are authorized to test, such as applications you own or have explicit permission to analyze. Any misuse of these tools for unauthorized reverse engineering, infringement of intellectual property rights, or malicious activity is strictly prohibited.

The developers of apktool-mcp-server shall not be held liable for any damage, data loss, legal consequences, or other consequences resulting from the use or misuse of these tools. Users assume full responsibility for their actions and any impact caused by their usage.

Use responsibly. Respect intellectual property. Follow ethical hacking practices.


Built with ❤️ for the reverse engineering and AI communities.

-
security - not tested
A
license - permissive license
-
quality - not tested

An MCP server that integrates with Apktool to provide live reverse engineering support for Android applications using Claude and other LLMs through the Model Context Protocol.

  1. 🤖 What is apktool-mcp-server?
    1. Other MCP Servers For Android Reverse Engineering
      1. Current MCP Tools
      2. 🗒️ Sample Prompts
      3. 🛠️ Getting Started
      4. 🤖 2. Claude Desktop Setup
      5. To report bugs, issues, feature suggestion, Performance issue, general question, Documentation issue.
      6. 🙏 Credits
      7. 📄 License
      8. ⚖️ Legal Warning
    ID: jtugu4w3w9