Android Source Explorer MCP Server logo

Android Source Explorer MCP Server

Community
mrmike

MCP server for exploring AOSP internals and Jetpack libraries

Publishermrmike
Repositoryandroid-source-explorer-mcp
LanguagePython
Forks
5
Stars
100
Available tools
0
Transport typestdio
Categories
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    Android Source Explorer MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    100 stars and 5 forks from the linked repository.

Android Source Explorer MCP Server

MCP server for exploring AOSP internals and Jetpack libraries.

Purpose

When building Android applications, AI tools often rely on outdated training data or incomplete summaries of the Android Framework. This MCP server provides on-demand, precise access to the actual source code (AOSP and AndroidX), enabling the AI to understand complex framework internals like the Activity lifecycle, ViewModel restoration, or Compose internals directly from the truth.


Installation & Setup

Prerequisites

  • uv (Recommended) or Python 3.11+
  • Git

Recommended Installation (via uv)

The easiest way to install and keep android-source-explorer up to date is using uv. It handles dependencies (including native ones like Tree-sitter and Cryptography) reliably across platforms.

bash
uv tool install git+https://github.com/mrmike/android-source-explorer-mcp

This will make the android-source-explorer command available globally in your PATH.

Initial Sync

After installation, you need to perform an initial sync to fetch the Android source code:

bash
# Sync API 36 (Android 16) and common AndroidX packages
android-source-explorer sync --api-level 36 --androidx "compose,lifecycle,activity"

# (Optional) Download LSP servers for cross-file features
android-source-explorer sync --lsp

Check sync status:

bash
android-source-explorer status

Keeping Sources Up-to-Date

To check for and download the latest available Android Framework revisions (AOSP tags) and newer stable versions of your synced AndroidX packages, run:

bash
# Update all synced framework APIs and AndroidX packages, then rebuild the index
android-source-explorer update

# (Optional) Clean up older versions of updated AndroidX packages
android-source-explorer update --clean

# Update only a specific API level or AndroidX package
android-source-explorer update --api-level 36
android-source-explorer update --androidx activity-compose

Configuration

Add the MCP server to your configuration file (e.g., Claude Desktop, Cursor, Gemini CLI).

Global Usage (Recommended)

If installed via uv tool install, the tool is available globally.

Basic Setup:

json
{
  "mcpServers": {
    "android-sources": {
      "command": "android-source-explorer",
      "args": ["serve"]
    }
  }
}

With LSP Features Enabled:

json
{
  "mcpServers": {
    "android-sources": {
      "command": "android-source-explorer",
      "args": ["serve"],
      "env": {
        "ANDROID_SOURCE_LSP": "true"
      }
    }
  }
}

Development Usage

If you cloned the repository and want to run it from the source:

json
{
  "mcpServers": {
    "android-sources": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/android-source-explorer", "android-source-explorer", "serve"]
    }
  }
}

How It Works

1. Hybrid Architecture (Tree-sitter + LSP)

The server uses a dual-engine approach to balance speed and intelligence:

  • Tree-sitter (Surgical Engine): Provides near-instant (sub-10ms) AST parsing of single files. It precisely extracts method bodies (including Javadoc and annotations), class members, and inheritance hierarchies without the overhead of a full compiler.
  • LSP (Global Engine): Optionally leverages the Eclipse JDT LS (Java) and Kotlin Language Server for cross-file navigation. This enables finding references across millions of lines of code and resolving types that span multiple libraries.

2. Local Sync Strategy

To ensure all lookups are instant and offline-ready, the server uses a sync or update command to manage sources in a local cache (~/.android-sources/):

  • AOSP: Fetches framework sources directly from android.googlesource.com using git sparse-checkouts.
  • AndroidX: Downloads -sources.jar files from the Google Maven repository (dl.google.com/dl/android/maven2/).
  • Hybrid Indexing: Prioritizes your local $ANDROID_HOME sources if available, supplemented by the downloaded cache.
  • Automatic Updates: The update command queries remote endpoints (AOSP Git tags & Google Maven indexes) for updates, downloads newer revisions/versions, and rebuilds the class index.

Available Tools

ToolEngineDescription
search_classesIndexSearch for classes by glob pattern or substring.
lookup_classFSRetrieve the full source code for a specific class.
lookup_methodTree-sitterExtract a precise method body + its Javadoc/annotations.
list_class_membersTree-sitterList all method and field signatures in a class.
get_class_hierarchyTree-sitterGet the inheritance chain (superclass + interfaces).
search_in_sourceFS/RegexSearch for text/regex across the entire source tree.
goto_definition*LSPResolve the cross-file definition of a symbol.
find_references*LSPFind all usages of a class/method across the whole tree.
get_type_info*LSPGet documentation and type info via hover data.

*Requires ANDROID_SOURCE_LSP=true


License

Apache License 2.0

Installation

TypingMind
{
  "mcpServers": {
    "android-source-explorer-mcp": {
      "command": "android-source-explorer",
      "args": [
        "serve"
      ]
    }
  }
}

Use Android Source Explorer MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Android Source Explorer MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Android Source Explorer MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Android Source Explorer MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "android-source-explorer-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Android Source Explorer MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Android Source Explorer MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Android Source Explorer MCP Server to help me with this task?
Android Source Explorer MCP Server
Sure. I read it.
Here is what I found using Android Source Explorer MCP Server.

Frequently asked questions

What is the Android Source Explorer MCP Server MCP server used for?

Android Source Explorer MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Android Source Explorer MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Android Source Explorer MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Android Source Explorer MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Android Source Explorer MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Android Source Explorer MCP Server MCP to TypingMind?

Android Source Explorer MCP Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Android Source Explorer MCP Server MCP provide in TypingMind?

Android Source Explorer MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Android Source Explorer MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Android Source Explorer MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇