Documentation · Last updated May 2026

Lightrion AOSP RAG — Documentation

This page covers how to configure your AI coding tool to query the Lightrion AOSP RAG service, what each tool does, which AOSP versions are available, and what to expect.

Overview

The service exposes an MCP server over Streamable HTTP at https://aosp-rag.lightrion.com/mcp/. All requests are authenticated with a bearer token issued to you during signup.

The server provides four tools: search_code, get_chunk, get_file, and list_versions. Any MCP-compatible client can call them.

Setup — Claude Code

Add the server to your Claude Code configuration with your API key:

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

Verify it’s connected:

claude mcp list

Then start a session and reference the server in your prompts:

Using the aosp-rag MCP server, search for "audio focus
in car media playback" and show the top three results.

Setup — Cursor

In Cursor settings, open the MCP servers panel and add a new server:

Setup — opencode

opencode configures MCP servers in opencode.json (or opencode.jsonc) under the mcp key. Add Lightrion as a remote server:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "aosp-rag": {
      "type": "remote",
      "url": "https://aosp-rag.lightrion.com/mcp/",
      "enabled": true,
      "oauth": false,
      "headers": {
        "Authorization": "Bearer lr_prod_..."
      }
    }
  }
}

Two things worth noting:

Once saved, verify the server is connected:

opencode mcp list

You should see aosp-rag with status connected.

To make opencode call the tools automatically when relevant, add a hint to your AGENTS.md file:

When the user asks about Android source code, use the aosp-rag tools.

Setup — other MCP clients

Any MCP client that supports the Streamable HTTP transport works, including Cline, Zed, and custom clients. Point the client at https://aosp-rag.lightrion.com/mcp/ and add an Authorization: Bearer <your_key> header.

The four tools

search_code

Semantic search across the AOSP source tree, ranked by relevance.

Arguments:

Returns: a list of chunks, each with chunk_id, file_path, language, symbol_name, start_line, end_line, a short preview of content, and a relevance score in the range 0–1. The response also echoes version and release_tag so the caller always knows which release was queried.

get_chunk

Retrieve a chunk’s full content and metadata by ID.

Arguments:

Returns: the chunk record, including the full content (not truncated as in search previews).

get_file

Read any source file by repository path, optionally bounded by line range.

Arguments:

Returns: the file content (or the requested range) with line numbers and language metadata.

list_versions

Discover which AOSP versions are available on the server. Takes no arguments.

Returns: the default version, plus per-version metadata: release_tag, n_chunks, n_points, and the underlying Qdrant collection name.

Use this when you want to discover which releases are queryable without hardcoding the version list — useful in scripts and agent workflows that should keep working as new releases are added.

AOSP versions available

The service currently indexes four releases. Each tool accepts an optional version argument to target a specific one.

All major AOSP releases from 13 to 16 are indexed and queryable. Drop us a line at support@lightrion.com if you need an older release prioritised.

Choosing a version

When you call any of the tools, pass version explicitly to target a release:

Using aosp-rag with version=15, search for "vehicle HAL"
and show me the top result.

If you omit version, the server uses its default (currently AOSP 16, the most recent release). The default may change in future major releases; pin version in scripts where reproducibility matters.

Important: chunk_ids are scoped per version. A chunk discovered via search_code(version="15") can only be retrieved with get_chunk(version="15"). The agent typically tracks this for you, but it’s worth knowing if you build custom workflows.

Example queries

Try these from your AI coding tool once configured:

Using aosp-rag, list_versions and tell me what's available.
Using aosp-rag with version=16, how does Android handle
audio focus in car media playback? Search for the relevant
code and walk me through the implementation.
Using aosp-rag, find CarPropertyService.setProperty in
AOSP 15 and AOSP 16, and compare the two implementations
to spot any API changes.
Using aosp-rag with version=15, what files implement the
AIDL interfaces for the vehicle HAL? Search for "IVehicle"
in AIDL files.
Using aosp-rag, find the SELinux policy rules for the
audio HAL. They're probably in .te files.

Rate limits

Each API key has a per-minute and per-hour rate limit. Defaults are 60 requests per minute and 1,000 requests per hour. Limits are returned in standard X-RateLimit-* response headers, and exceeded limits return HTTP 429 with a Retry-After header.

If you have a legitimate use case that requires higher limits, email support@lightrion.com and we’ll consider raising your quota.

Key management

Keys are issued once and not retrievable later. If you lose your key, request a new one from the home page (the old one will eventually be revoked).

To revoke a key, email security@lightrion.com with the first 12 characters of the key (e.g. lr_prod_aBcD).

Data and privacy

We log request metadata for analytics: HTTP method, path, status code, latency, the MCP tool name (e.g. search_code), and a coarse summary of arguments (string length, list size). We do not log the raw text of your queries or the content returned to you.

See the privacy policy for the full details.

Support

Feedback, bug reports, and questions all welcome: support@lightrion.com. Or just reply to the welcome email — it comes from dan@lightrion.com, which is a real address you can write to.

As an early user, you’re helping us shape the product. If something doesn’t work, doesn’t feel right, or surprises you in a good way, please tell us.

← Back to home