android-sqlite-mcp
This server lets AI agents inspect and query the embedded SQLite/Room databases of debuggable Android apps by extracting them to a local cache via ADB.
List packages: find installed Android apps, optionally filtered by a query string.
List databases: enumerate the SQLite files inside a given app's internal storage.
Pull databases: extract a database plus its WAL files into the local cache using
adb run-as.Check cache status: see which databases are cached and ready to query.
List tables: enumerate tables and views with approximate row counts.
Inspect schemas: retrieve the DDL (
CREATE TABLE) for a specific table or view.Run SQL: execute raw queries with optional parameters—
SELECTfor reads andINSERT/UPDATE/DELETEfor writes—against the local cache only (writes are never pushed back to the device).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@android-sqlite-mcp show me the tables in the app's database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Android SQLite MCP Server
A Model Context Protocol (MCP) server to connect AI agents directly to the embedded SQLite/Room databases of your Android applications.
What problem does this solve?
Accessing embedded databases (SQLite, Room, SQLDelight) on Android devices during development has historically been a cumbersome process. It requires running adb shell run-as commands, manually copying files, dealing with .db-wal (Write-Ahead Logging) files to prevent data loss, and then using external SQL clients to read the information.
This MCP server automates the entire process. It allows any AI agent (like Claude, Cursor, or Antigravity) to inspect tables, read schemas, and execute live SQL queries (SELECT, INSERT, UPDATE, DELETE) on your application's database, right from the chat window.
Related MCP server: android-sqlite-inspector
Features
📥 Secure Extraction: Uses
adb exec-out run-asto safely extract data without corruption and without requiring root access.🗄️ Smart Caching: Stores local copies organized in
~/.android-sqlite-mcp/cache/.🔍 Search and Inspection: Tools to search installed packages, list databases, view tables, and retrieve full DDL schemas.
⚡ Queries (CRUD): Executes raw SQL queries locally and returns the results in JSON format to the AI.
Technical Prerequisites
Node.js: Version 18 or higher.
Android Debug Bridge (ADB): Must be installed and configured in your system's
PATH(verify withadb version).Device/Emulator: A device or emulator must be connected (
adb devices).Debuggable App: The Android app must be compiled in debug mode (
android:debuggable="true").
Getting Started (Standard Configuration)
There is no need to manually download or build this repository. You can run the server on the fly using npx.
The standard format to register an MCP server in any client is the following:
{
"mcpServers": {
"android-sqlite": {
"command": "npx",
"args": ["-y", "android-sqlite-mcp"]
}
}
}AI Client Installation Guides
{
"mcpServers": {
"android-sqlite": {
"command": "npx",
"args": ["-y", "android-sqlite-mcp"]
}
}
}Local development and stability
package.json is the source of truth for the server version. To bump the patch
version and synchronize package-lock.json, run:
npm version patch --no-git-tag-versionUse minor or major instead of patch when appropriate. The MCP server reads
the version directly from its installed package.json; no source edit is needed.
Requires Node.js 22.15 or newer. Run npm test to compile and run regression tests.
To test this checkout (instead of the published npm package), build with npm run build
and configure the MCP entry with an absolute path:
{
"command": "node",
"args": ["D:\\android-mcp\\build\\index.js"]
}Tool arguments use appId and dbName. Legacy package_name is accepted as an
alias for appId; conflicting values are rejected. Queries operate on the local
cache only and never push writes back to Android. Results are capped at 1000 rows
and 1 MiB; truncated indicates omitted rows. SQLite operations run in a separate
process with a 15 second timeout and request cancellation. A timed-out write may
already have committed; inspect the cache before retrying writes.
ADB commands have a 15 second timeout. Set ANDROID_SERIAL when multiple devices
are connected. Use separate ANDROID_MCP_CACHE_DIR values for different devices;
new extractions record the device and reject replacing a cache from another device.
Older caches have no device identity until their first successful new extraction.
ANDROID_MCP_LOG_DIR optionally overrides the file log directory.
Extraction compares two consecutive copies of the DB and WAL and rejects detected
changes, then recovers/checks the snapshot in a temporary directory before publishing.
Stop app writes for a reliable snapshot: comparison cannot guarantee a transactionally
consistent snapshot of an actively changing Android database. Existing local SQLite
sidecars cause CacheConflict rather than being mixed with a new copy; close other
readers and use a fresh cache directory. Concurrent cache operations fail with
DatabaseBusy. If a server is forcibly killed, a .mcp-lock file may remain; remove
it only after verifying no process still uses that cached database.
claude mcp add android-sqlite npx -y android-sqlite-mcpGo to Cursor Settings > Features > MCP.
Click on "+ Add New MCP Server".
Fill in the details:
Type:
commandName:
android-sqliteCommand:
npx -y android-sqlite-mcp
Save and verify that the indicator changes to "Connected" (green).
Available Tools
7 toolsexecute_queryB
Executes a raw SQL query on a cached database. Can be used for SELECT or write operations (INSERT/UPDATE/DELETE).
Inputs: appId (required), query (required), dbName (required), params.
get_cache_statusA
Returns information about the currently cached Android SQLite databases ready to be queried.
Inputs: no named parameters.
get_schemaA
Returns the DDL schema (CREATE TABLE) for a specific table in a cached database.
Inputs: appId (required), dbName (required), tableName (required).
list_databasesA
Lists all SQLite database files available in the internal storage of a specific Android app on the connected device.
Inputs: appId (required).
list_packagesA
Lists installed Android application packages on the device, optionally filtered by a query.
Inputs: query.
list_tablesA
Lists all tables and views in a cached database along with their approximate row counts.
Inputs: appId (required), dbName (required).
pull_databaseA
Extracts an SQLite database and its WAL files from an Android device into the local cache using adb run-as.
Inputs: appId (required), dbName (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct stage in the workflow: discovering packages, listing databases, pulling a database, checking cache status, listing tables, getting schema, and executing queries. There is no overlap between tools, even between list_databases and get_cache_status which clearly distinguish remote vs. cached databases.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., list_packages, pull_database, get_schema, execute_query). The naming style is uniform and predictable, with no mixed conventions or vague verbs.
The server has 7 tools, well within the ideal range of 3-15. Each tool serves a distinct and necessary step in the pipeline from device discovery to SQL querying, with no redundancy or bloat.
The toolset covers the entire lifecycle of working with Android SQLite databases: discovery (list_packages, list_databases), extraction (pull_database), cache management (get_cache_status), introspection (list_tables, get_schema), and querying (execute_query). There are no obvious gaps for the stated purpose.
Maintenance
Related MCP Connectors
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
SQLite databases for AI agents: build custom apps, share data between agents, optimize agent runs
AI agents on real phones: run tasks, read the screen, tap, type and install apps.
Related MCP Servers
- AlicenseBqualityNot gradedmaintenanceEnables LLMs to control and manage Android devices via ADB, including app installation, UI interaction, and device monitoring.3512GPL 3.0
- AlicenseAqualityDmaintenanceInspects and queries SQLite databases on Android devices via ADB, supporting listing databases/tables, describing schemas, and executing SELECT/INSERT/UPDATE/DELETE queries.121 npmMIT
- AlicenseAqualityDmaintenanceEnables AI models to control Android devices via ADB through natural language commands, supporting screen analysis and automated actions.357 npmMIT
- AlicenseAqualityDmaintenanceEnables an agent to inspect and interact with Android emulators or physical devices via ADB, capturing UI snapshots, tapping nodes, typing text, and reading app logs.10MIT