An MCP server that provides APK analysis capabilities using the Android Asset Packaging Tool (aapt)
Project description
AAPT-MCP
A tool for analyzing Android APK files using the Android Asset Packaging Tool (AAPT) with MCP integration.
Description
AAPT-MCP is a tool that leverages the Android Asset Packaging Tool (AAPT) to analyze APK files and provide detailed insights about their contents, size, and structure. It uses MCP (Model Control Protocol) to process and analyze the APK data through an LLM (Large Language Model).
Features
- APK content listing using AAPT
- Detailed size analysis of APK contents
- Categorization of files by type (resources, native libraries, dex files, etc.)
- Identification of largest files and directories
- Optimization recommendations
- Potential issues detection
Prerequisites
- Python 3.7+
- Android SDK (for AAPT tool)
- MCP server
Installation
- Clone the repository:
git clone https://github.com/yourusername/aapt-mcp.git
cd aapt-mcp
- Install dependencies:
pip install -r requirements.txt
- Ensure AAPT is in your system PATH:
- AAPT is part of the Android SDK build tools
- Add the Android SDK build tools directory to your system PATH
Usage
- Run the MCP server:
python main.py
- The tool provides two main functions:
aapt_tool: Lists contents of an APK fileanalyze_table: Analyzes the APK contents and provides detailed insights
Output Format
The analysis provides:
- Total APK Size
- Size Breakdown by category
- Top 5 Largest Files
- Optimization Recommendations
- Potential Issues
Example
from mcp.server.fastmcp import FastMCP
# Initialize the tool
aapt = FastMCP("aapt-mcp")
# Analyze an APK
result = aapt.analyze_table("path/to/your.apk")
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Android Asset Packaging Tool (AAPT)
- MCP Framework
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aapt_mcp_server-1.0.0.tar.gz.
File metadata
- Download URL: aapt_mcp_server-1.0.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61de91c666b92910fd8b3cf55c21604ce345874c2a7d9b2f908c631f2f402d47
|
|
| MD5 |
89530fbe17d23e25b97f66ed8b90bf5a
|
|
| BLAKE2b-256 |
61eae8452de0691abec64f53ee121b850f8ab0c701483d8170189952badcb9d9
|
File details
Details for the file aapt_mcp_server-1.0.0-py3-none-any.whl.
File metadata
- Download URL: aapt_mcp_server-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44046ca5341f509cd3c7760b2f2e1dea15b1416188a66f3e4ccf3204f7699d52
|
|
| MD5 |
1e02c3b4f33f8edb8052566d9df4cb2a
|
|
| BLAKE2b-256 |
68f6b211552207720a756c22ff78b4c77ffde1ba945e304f3acd2e9cdec69808
|