LeakCanary MCP Server wrapper for VS Code, Android Studio, and Cursor - detects and analyzes Android memory leaks
Strong tool naming (all verb-first, clear intent) and comprehensive descriptions (avg 180 chars, well above 10-char minimum). All 10 tools have explicit input schemas with typed properties and descriptions. However, output schemas are entirely undocumented, responses are returned as TextContent with no structured field definitions, forcing LLMs to parse unstructured text. Error handling is present but generic (no recovery guidance or error classification). Parameters lack enums for constrained values (e.g., priority levels, classifications). No tool annotations (readOnlyHint/destructiveHint) despite clear read/write semantics.
Analyze a specific memory leak in detail by its signature hash. Use this tool when the user asks to: analyze a leak, explain a leak, inspect a leak, deep dive into a leak, understand why something is leaking, or get details about a specific leak signature. Reads leak data from logcat first, and falls back to the app's stored LeakCanary database if logcat is empty. Returns full reference chain walkthrough, root cause classification, and severity assessment.
Clear the LeakCanary logcat buffer on the connected device. Use this tool when the user asks to: clear leaks, reset leaks, start fresh, clear logcat, remove old leaks, or wants to only see new leaks on the next scan. After clearing, the next detect_leaks or list_leaks call will only show newly detected leaks.
Detect Android memory leaks using LeakCanary. Use this tool when the user asks about: memory leaks, leak detection, LeakCanary, check leaks, find leaks, current leaks, leak analysis, memory issues, retained objects, OOM, out of memory, activity leaks, fragment leaks, or anything related to Android memory leak detection. Reads leak data from logcat first, and falls back to the app's stored LeakCanary database if logcat is empty (e.g., after a reboot or buffer clear). Classifies root causes (singleton, listener, context, library), assigns P0/P1/P2 priority, and returns a structured report.
Export a Markdown leak report file for sharing with your team. Use this tool when the user asks to: export leaks, generate report, create report, share leak report, save leak data, write report, or export to markdown/file. Fetches current leaks, analyzes them, and writes a formatted Markdown report with all traces, classifications, priorities, fix suggestions, and history data.
No output schemas documented. All tools return TextContent with unstructured text. LLMs cannot parse structured fields (signature, priority, retained_size) without explicit schema definitions, forcing regex parsing and increasing hallucination risk.
No tool annotations (readOnlyHint/destructiveHint). Tools like clear_leaks and export_report modify state but lack destructiveHint. Agents cannot distinguish safe-to-retry tools from irreversible operations.
Parameters lack enums for constrained values. 'classification' and 'priority' accept free-form strings instead of enums (e.g., P0|P1|P2, singleton|listener|context|library). LLMs hallucinate invalid values.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 58 | 2026-07-28+ | v2 |
Get live memory statistics for an Android app from the device. Use this tool when the user asks about: app memory usage, PSS, USS, heap allocation, native heap, how much memory the app is using, memory pressure, memory footprint, or wants broader memory context alongside leak data. Runs 'adb shell dumpsys meminfo <package>' and returns parsed memory stats.
Get Android heap memory summary and statistics from LeakCanary. Use this tool when the user asks about: heap stats, heap summary, memory stats, heap size, memory usage, bitmap count, class count, instance count, heap dump info, or device memory statistics. Extracts heap-level data from the latest LeakCanary dump including class count, instance count, heap size, bitmap stats, and device info.
Get memory leak history and past leak records. Use this tool when the user asks about: leak history, past leaks, previous leaks, recurring leaks, resolved leaks, leak trends, leak tracking, or when leaks were first seen. Retrieves persisted leak records across sessions showing new, recurring, or resolved leaks with timestamps and occurrence counts.
Compare current leaks against previous scans to show what changed. Use this tool when the user asks: 'what changed', 'new leaks', 'fixed leaks', 'leak diff', 'regression check', 'compare leaks', 'any new leaks since last scan', 'resolved leaks', or 'leak status update'. Returns a diff report showing NEW leaks (not seen before), RECURRING leaks (seen again), and RESOLVED leaks (in history but not in current scan).
List all connected Android devices and emulators. Use this tool when the user asks: 'what devices are connected', 'list devices', 'show emulators', 'which device', 'adb devices', or before using device_id on other tools. Returns device serial IDs and their connection state.
List all Android memory leaks detected by LeakCanary in a compact summary format. Use this tool when the user asks: 'list all leaks', 'show all leaks', 'what are the current leaks', 'how many leaks', 'leak overview', 'leak summary', 'all memory leaks', 'show me the leaks'. Reads leak data from logcat first, and falls back to the app's stored LeakCanary database if logcat is empty (e.g., after a reboot or buffer clear). Returns a concise list with leaking class, signature, classification, priority, and retained size for each leak. Use this for a quick overview before diving into specific leaks with analyze_leak or search_leak.
Error responses lack recovery guidance. Generic 'Error: <message>' responses do not tell LLMs what to do next (retry, ask user, call discovery tool). No error classification (retryable vs fatal).
No pagination support. list_leaks and list_devices return unbounded results. Large leak lists will exhaust context window. Missing limit/offset parameters and total count in responses.