Skip to main content
Glama
algorithmaide-mcp

algorithmaide-mcp

by vw2x

algorithmaide-mcp

中文文档

Special thanks to Junge (军哥) for open-sourcing AlgorithmAide.

algorithmaide-mcp is an MCP server for real-device Android reversing workflows. It wraps AlgorithmAide config writes, AppSwitch/logList sync, LSPosed scope sync, Frida script injection, and runtime log queries into a stable MCP toolset.

Upstream And Downloads

  • This MCP targets AlgorithmAide Pro (com.junge.algorithmAidePro).

  • AlgorithmAide Pro APK: 关注公众号 算法助手Plus 下载 APK。

  • LSPosed_mod.zip: please prepare a CLI-enabled LSPosed_mod package for this workflow.

  • Magisk APK: please install official Magisk before running this MCP.

Related MCP server: android-adb-mcp

Verified Scope

This project is currently verified only on:

  • Android 10 (API 29)

  • Root with Magisk (su 0 sh -c ... works)

  • LSPosed_mod 1.9.3_mod(7296) with CLI enabled

  • Device sample: Pixel 4

Important compatibility notes:

  • Non-mod LSPosed is currently not supported because CLI is unavailable.

  • Other Android versions and environments may work, but you must validate them yourself.

  • LSPosed_mod CLI scope updates are already built into this MCP (sync_lsposed_scope and high-level workflow tools).

Before real use, run:

npm run device:preflight -- --target-package <your.package>
npm run device:smoke:suite -- --target-package <your.package>

Quick Start

Clone and install dependencies:

git clone https://github.com/vwww-droid/algorithmaide-mcp.git algorithmaide-mcp
cd algorithmaide-mcp
npm install

Configure mcp profile:

{
  "mcpServers": {
    "algorithmaide": {
      "command": "node",
      "args": [
        "/absolute/path/to/algorithmaide-mcp/bin/algorithmaide-mcp.js"
      ]
    }
  }
}

Common Commands

npm run device:preflight -- --target-package com.mb.hawkeye
npm run device:smoke -- --target-package com.mb.hawkeye
npm run device:smoke:suite -- --target-package com.mb.hawkeye
npm run release:selfcheck
npm test

Build Notes (LSPosed_mod)

If you need reproducible LSPosed_mod builds for this workflow, use the pinned-version one-click script from your companion project:

  • /Users/admin/Projects/Reverses/LSPosed_mod/build-last.sh

This script sets Java from .java-version, builds required libxposed artifacts, then runs zipAll, and should produce a usable LSPosed_mod package.

Tool Overview

Frequently used tools:

  • read_target_state

  • apply_algorithm_aide_config

  • add_custom_hooks

  • inject_frida_script

  • query_agent_logs

  • query_frida_logs

Full tool contracts: docs/tool-contracts.md

Documentation

Contributing

Issues and PRs are welcome.

When opening an issue, include:

  • Device and system info (Android version, root solution, LSPosed version)

  • Target package

  • Commands you ran

  • JSON output from device:preflight and device:smoke:suite

License

MIT

Available Tools

23 tools
add_custom_hooksC

Add or replace custom hook entries, then sync config, AppSwitch, LSPosed, and optionally relaunch the target.

Inputs: targetPackage (required), hookEntries (required), serial, enabledScriptName, +8 more.

add_r0capture_hooksC

Generate the built-in r0capture-style network hooks and apply them with the verified workflow.

Inputs: targetPackage (required), serial, launchTargetApp, dryRun, +2 more.

apply_algorithm_aide_configC

Write files/config/.json safely and verify the config provider readback.

Inputs: targetPackage (required), serial, configJson, configPatch, +4 more.

apply_hook_profileC

Load a saved profile and apply it with the verified workflow.

Inputs: profileName (required), targetPackage (required), serial, launchTargetApp, +2 more.

collect_exported_logsC

Compatibility tool for pulling legacy exported log files only.

Inputs: targetPackage (required), serial, outputDir, newestHookOnly, +1 more.

collect_runtime_logsD

Collect runtime logs, prioritizing the SQLite database and frida.log.

Inputs: targetPackage (required), serial, outputDir, sources, +2 more.

get_hook_log_contextB

Expand one structured hook log entry into a short surrounding time-window context.

Inputs: targetPackage (required), entryId (required), serial, outputDir, +5 more.

import_hook_jsonB

Low-level config import for compatibility. Prefer apply_algorithm_aide_config for normal use.

Inputs: targetPackage (required), configJson (required), serial, dryRun.

inject_frida_scriptC

Enable one Frida script for a target package and sync config, AppSwitch, and LSPosed in one step.

Inputs: targetPackage (required), scriptName (required), serial, scriptContent, +6 more.

inspect_hook_candidateC

Summarize one dynamic candidate into short hits, short context, jadx-ai-mcp hints, and draft add_custom_hooks suggestions.

Inputs: targetPackage (required), serial, query, entryId, +10 more.

list_hook_packsB

List built-in hook templates that can be applied to a target app.

Inputs: no named parameters.

list_hook_profilesA

List locally saved hook configuration profiles.

Inputs: no named parameters.

query_agent_logsC

Build a short unified log view from sqlite hits, short context, and frida.log supplements.

Inputs: targetPackage (required), serial, query, entryId, +12 more.

query_frida_logsC

Pull frida.log and view a short keyword or time-window slice.

Inputs: targetPackage (required), serial, outputDir, limit, +6 more.

query_hook_logsC

Pull runtime logs and query recent hook records from algorithmAidePro.db and frida.log.

Inputs: targetPackage (required), serial, outputDir, limit, +6 more.

read_target_stateC

Read the current target state, including config, AppSwitch, log sources, and LSPosed scope.

Inputs: targetPackage (required), serial, dryRun.

replace_frida_scriptC

Replace a Frida script under /data/system/junge//frida and verify the write.

Inputs: targetPackage (required), scriptName (required), scriptContent (required), serial, +1 more.

reset_target_configC

Reset the target config to an empty template and apply it through the verified workflow.

Inputs: targetPackage (required), serial, dryRun.

run_verified_workflowC

Run the minimal verified loop: stop apps, write state, start AlgorithmAide, sync LSPosed, then optionally launch the target.

Inputs: targetPackage (required), serial, configJson, configPatch, +8 more.

save_hook_profileC

Save a hook configuration profile locally.

Inputs: profileName (required), configJson (required), description, tags.

search_hook_logsC

Search the structured hook log database by keyword across class, method, details, and call stack fields.

Inputs: targetPackage (required), query (required), serial, fields, +5 more.

sync_appswitch_stateC

Sync AppSwitch.json and logList.json, then verify both storage layers.

Inputs: targetPackage (required), serial, enabled, dryRun.

sync_lsposed_scopeC

Sync the LSPosed scope for AlgorithmAide and return the readback.

Inputs: targetPackage (required), serial, includeSystemFramework, dryRun.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 23 tools

    Disambiguation3/5

    Several tool pairs have overlapping purposes (e.g., multiple log querying tools, add/inject/replace hooks), which may confuse an agent about which to use. However, descriptions help differentiate most tools.

    Naming Consistency4/5

    All tools follow a consistent verb_noun snake_case pattern, but some verbs are vague (e.g., 'get' vs 'query' vs 'read') and import_hook_json breaks the config naming pattern.

    Tool Count4/5

    23 tools is reasonable for the specialized domain of Frida hook management. The count slightly exceeds the ideal 3-15 range but is still manageable.

    Completeness4/5

    The tool surface covers most lifecycle operations: config, hooks, profiles, logs, and workflows. Minor gaps include lack of explicit hook removal and a dedicated disable function.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that wraps Android ADB functionality into AI assistant tools, enabling device management, shell execution, file operations, app management, media capture, and log analysis via natural language.
      23 npm
      3
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      MCP server that provides AI coding agents real Android development tools—Gradle, adb, logcat, lint, crash triage—through a local, permissioned interface. Enables agents to inspect projects, run safe Gradle tasks, capture logs/screenshots, and triage crashes.
      1
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server that lets AI agents drive the LuckyStar/LS_KTool Android memory-debugging stack, exposing tools for memory read/write, scanning, pointer operations, and device/process management via the Model Context Protocol.
      MIT