Skip to main content
Glama
android-sqlite-inspector

android-sqlite-inspector

by hortusys
README.md
# Android SQLite Inspector

MCP server that inspects and queries SQLite databases on Android devices via ADB.

## Prerequisites

- Node.js 18+
- ADB installed and in PATH
- A **debuggable** Android app (debug builds)

## Installation

```bash
npm install
npm run build
```

## Configuration

Set via environment variables:

| Variable | Description | Default |
|----------|-------------|---------|
| `ANDROID_PACKAGE` | App package name | `com.hortusys` |
| `ANDROID_DEVICE` | ADB device serial (for multiple devices) | _(auto-detect)_ |
| `ADB_PATH` | Custom path to ADB binary | `adb` |

## Claude Code Setup

Add to `~/.claude/settings.json`:

```json
{
  "mcpServers": {
    "android-sqlite-inspector": {
      "command": "node",
      "args": ["/Users/andromeda/StudioProjects/android-sqlite-inspector/dist/index.js"],
      "env": {
        "ANDROID_PACKAGE": "com.hortusys"
      }
    }
  }
}
```

## Available Tools

| Tool | Description |
|------|-------------|
| `list_databases` | List all `.db` files in the app's databases directory |
| `list_tables` | List all tables in a database |
| `describe_table` | Show column schema for a table |
| `query` | Execute a SELECT query (returns JSON) |
| `execute` | Execute INSERT/UPDATE/DELETE (pushes changes back to device) |

## How It Works

1. Each read operation pulls a fresh copy of the database from the device via `adb shell run-as <package> cat databases/<db>`
2. Queries run locally using `better-sqlite3`
3. Write operations (`execute`) pull the db, modify locally, then push back via ADB

TDQS

A4/5.0

Scored across 12 tools

Disambiguation4/5

Most tools target distinct actions and resources, but the query variants (query, multi_query, query_paginated, export) overlap in purpose and could be confused if descriptions are not read carefully. The read-only vs. write distinction between query and execute is clear, and schema_diff/room_info are well-separated from the rest.

Naming Consistency4/5

The list_* tools follow a clear, consistent pattern, and describe_table, schema_diff, and export are also descriptive. However, room_info breaks the verb-noun pattern, and the query variants mix styles (query, multi_query, query_paginated) though they remain readable.

Tool Count5/5

Twelve tools is well-scoped for an Android SQLite inspector, covering discovery, schema inspection, querying, and modification without unnecessary bloat. Each tool has a meaningful role in the workflow.

Completeness5/5

The tool surface covers the full inspection lifecycle: device discovery, package/database/table enumeration, schema details, read/write operations, pagination, batch queries, Room metadata, schema diffing, and export. No obvious dead ends or critical missing operations are apparent for the stated purpose.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues