Apktool MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
decode_apk

Decode an APK file using APKTool

build_apk

Build an APK file from a decoded APKTool project.

Args: project_dir: Path to the APKTool project directory output_apk: Optional output APK path debug: Build with debugging info force_all: Force rebuild all files

Returns: Dictionary with operation results

list_workspace_projects

List all APKTool project directories in the workspace.

Returns: Dictionary with list of project directories

get_manifest

Get the AndroidManifest.xml content from a decoded APK project.

Args: project_dir: Path to the APKTool project directory

Returns: Dictionary with manifest content or error

get_apktool_yml

Get apktool.yml information from a decoded APK project.

Args: project_dir: Path to the APKTool project directory

Returns: Dictionary with apktool.yml content or error

list_smali_directories

List all smali directories in a project.

Args: project_dir: Path to the APKTool project directory

Returns: Dictionary with list of smali directories

list_smali_files

List smali files in a specific smali directory, optionally filtered by package prefix.

Args: project_dir: Path to the APKTool project directory smali_dir: Which smali directory to use (smali, smali_classes2, etc.) package_prefix: Optional package prefix to filter by (e.g., "com.example")

Returns: Dictionary with list of smali files

get_smali_file

Get content of a specific smali file by class name.

Args: project_dir: Path to the APKTool project directory class_name: Full class name (e.g., com.example.MyClass)

Returns: Dictionary with smali file content

modify_smali_file

Modify the content of a specific smali file.

Args: project_dir: Path to the APKTool project directory class_name: Full class name (e.g., com.example.MyClass) new_content: New content for the smali file create_backup: Whether to create a backup of the original file

Returns: Dictionary with operation results

list_resources

List resources in a project, optionally filtered by resource type.

Args: project_dir: Path to the APKTool project directory resource_type: Optional resource type to filter by (e.g., "layout", "drawable")

Returns: Dictionary with list of resources

get_resource_file

Get content of a specific resource file.

Args: project_dir: Path to the APKTool project directory resource_type: Resource type (e.g., "layout", "drawable") resource_name: Name of the resource file

Returns: Dictionary with resource file content

modify_resource_file

Modify the content of a specific resource file.

Args: project_dir: Path to the APKTool project directory resource_type: Resource type (e.g., "layout", "values") resource_name: Name of the resource file new_content: New content for the resource file create_backup: Whether to create a backup of the original file

Returns: Dictionary with operation results

search_in_files

Search for a pattern in files with specified extensions.

Args: project_dir: Path to the APKTool project directory search_pattern: Text pattern to search for file_extensions: List of file extensions to search in max_results: Maximum number of results to return

Returns: Dictionary with search results

check_apktool_version

Check the installed APKTool version.

Returns: Dictionary with APKTool version information

sign_apk

Sign an APK file.

Args: apk_path: Path to the unsigned APK file output_path: Optional path for the signed APK keystore_path: Path to keystore file (uses debug.keystore if not specified) keystore_pass: Keystore password (uses "android" if not specified) key_alias: Key alias (uses "androiddebugkey" if not specified) key_pass: Key password (uses keystore_pass if not specified)

Returns: Dictionary with operation results

install_apk

Install an APK on a connected device using ADB.

Args: apk_path: Path to the APK file to install device_id: Optional device ID for multiple connected devices

Returns: Dictionary with operation results

extract_dex

Extract DEX files from original APK (if available in project).

Args: project_dir: Path to the APKTool project directory output_dir: Optional directory to extract DEX files to

Returns: Dictionary with operation results

list_packages

List installed packages on a connected Android device using ADB.

Args: device_id: Optional device ID for multiple connected devices

Returns: Dictionary with list of packages

analyze_permissions

Analyze permissions declared in AndroidManifest.xml.

Args: project_dir: Path to the APKTool project directory

Returns: Dictionary with permissions analysis

clean_project

Clean a project directory to prepare for rebuilding.

Args: project_dir: Path to the APKTool project directory backup: Whether to create a backup of build directories before cleaning

Returns: Dictionary with operation results

create_project

Create a new empty APKTool project structure.

Args: project_name: Name of the project package_name: Java package name (e.g., com.example.app)

Returns: Dictionary with operation results

delete_project

Delete an APKTool project directory.

Args: project_dir: Path to the APKTool project directory force: Force deletion without additional checks

Returns: Dictionary with operation results

compare_smali_files

Compare two smali files and show differences.

Args: file1_path: Path to first smali file file2_path: Path to second smali file

Returns: Dictionary with differences between files

get_available_devices

Get list of available Android devices connected via ADB.

Returns: Dictionary with list of devices

ID: jtugu4w3w9