AOSP RAG via Model Context Protocol

Source-grounded answers for Android code questions.

Lightrion AOSP RAG gives Claude Code, Cursor, and any MCP client direct access to Android Open Source Project source code through semantic search. Stop letting your coding agent guess what an Android API does — let it read the actual implementation.

Indexed AOSP 13 – 16
Chunks ~2.71M
Embeddings voyage-code-3 / 1024d
Status Free for the community
What it does

Four MCP tools, one canonical source of Android truth.

When you ask your AI coding agent “how does Android handle audio focus in cars,” it usually reaches into training data and approximates. With Lightrion, it searches the actual source, retrieves the relevant chunks, and grounds its answer in real code paths.

  • search_code

    Semantic search across the AOSP tree, ranked by relevance. Find every implementation of a concept, even when wording differs from the source — “audio focus,” “property service,” “USB host mode.”

  • get_chunk

    Retrieve the full content and metadata of a specific code chunk by ID. Useful when search returns a top result and you want the whole function, not just the snippet.

  • get_file

    Read any source file by its repository path, optionally bounded by line range. Lets the agent inspect imports, neighbouring methods, or read a class top to bottom.

  • list_versions

    Discover which AOSP releases are indexed and queryable. The agent uses this to decide which version to target for follow-up searches, without you hardcoding anything.

Indexed AOSP versions

Four releases, side by side.

Every tool accepts an optional version argument ("16", "15", "14", or "13"). When omitted, queries default to AOSP 16, the most recent release. The chunk_id space is per-version, so a chunk found via search_code(version="15") must be fetched with get_chunk(version="15").

  • AOSP 16 · default

    Release tag: android-16.0.0_r4

    732,264 indexed chunks across Java, Kotlin, C/C++, Rust, AIDL, Blueprint, SELinux policy, and init scripts.

  • AOSP 15

    Release tag: android-15.0.0_r36

    697,377 indexed chunks. Useful when you maintain code on the previous LTS branch or compare API behavior across releases.

  • AOSP 14

    Release tag: android-14.0.0_r75

    683,878 indexed chunks. Useful when supporting devices on older LTS branches or comparing API behavior across multiple AOSP releases.

  • AOSP 13

    Release tag: android-13.0.0_r84

    597,492 indexed chunks. Useful for long-lived Android 13 deployments — especially automotive platforms shipping on older AAOS baselines — and for tracing regressions back across releases.

All major AOSP releases from 13 to 16 are indexed and queryable. See the docs for the full usage pattern.

How to use

Three steps from sign-up to source-grounded answers.

  1. Request a key

    Fill out the short form below. You’ll receive a confirmation email from dan@lightrion.com within a minute. Click the link, and your API key arrives in a follow-up message right after.

  2. Register the MCP server with your tool

    For Claude Code:

    claude mcp add --transport http aosp-rag \
      https://aosp-rag.lightrion.com/mcp/ \
      --header "Authorization: Bearer lr_prod_..."

    Cursor, Cline, Zed, and any other MCP-compatible client follow the same pattern: a Streamable-HTTP endpoint plus a bearer-token header. See the docs for tool-specific instructions.

  3. Ask your agent about Android

    Then just talk to your coding agent as usual:

    > Using aosp-rag, find the implementation of audio focus
    > for car media playback in AOSP 16, and show me the top
    > result with surrounding context from the actual file.

    The agent calls search_code, picks the most relevant chunk, then calls get_file for the surrounding lines. You get an answer rooted in code you can verify.

Who it’s for

Built for engineers shipping on top of AOSP.

Automotive HMI teams, OEM platform engineers, security researchers, and anyone who has ever scrolled through cs.android.com at 11 p.m. looking for one function. If your AI coding tool has been wrong about an Android API one too many times, this is for you.

Request access

Get a free key.

A free tier will always exist for individual developers, researchers, and small projects. The AOSP source we index is open source, and access to it shouldn’t be gated for the people building on top of it. Higher quotas and team plans will come later for organizations that need them.

Rate-limited per key (60 requests/minute, 1,000/hour). By signing up you agree to the terms and privacy policy.

Already have an API key? Join the community on Discord →