aosp-mcp
Provides tools for searching and reading Android (AOSP) source code via cs.android.com, supporting regex queries and file retrieval across Android platform repositories.
Enables searching and reading Android Studio source code, allowing querying of the Android Studio project repositories.
Allows searching and reading Android LLVM source code, supporting code search and file access within the Android LLVM project.
Click on "Install 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., "@aosp-mcpsearch for class 'Activity' in android.app"
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.
AOSP-MCP
A Bun-powered Model Context Protocol (MCP) server for searching and reading Android source code via
cs.android.com. Built for coding agents: compact ripgrep-style results, response caching, request coalescing, and
pagination designed around agent token budgets.
Works with Claude Code, Cursor, VS Code Copilot, Zed, Gemini CLI, Codex CLI, Windsurf, and any other MCP
client with stdio support.
Preview

Related MCP server: Code Search MCP
Features
Code search across AOSP, AndroidX/Jetpack, Android Studio, and Android LLVM, with regex and
file:/class:/function:/symbol:/content:/lang:operatorsFile reading with line numbers,
startLine/endLineranges, and continuation hints for large filesSymbol suggestions to resolve partial class/method/file names
Fast: server ready in ~46 ms under Bun (
bunx --bun) or ~130 ms under Node (bun run benchreproduces these two numbers on your machine; medians of 9 runs; bunx/npx package-resolution overhead is extra); measured separately at ~ 111 ms for the Node-only predecessor as shipped, making the bun-to-bun rewrite ~20% faster; TLS warm-up on boot; repeat queries served from the in-memory cache in under a millisecond (measured end-to-end over stdio); one fast retry on transient upstream failuresToken-efficient: concise-by-default search results, deduplicated matches, snippet caps, and short pagination handles; measured search and large-file payloads run 50-85% smaller (~70% typical) than the predecessor's
Installation
The recommended launcher is bunx (Bun 1.3+); npx (Node 20.3+) also works.
Claude Code
claude mcp add aosp -- bunx --bun -y @itznotabug/aosp-mcp{
"mcpServers": {
"aosp": {
"command": "bunx",
"args": [
"--bun",
"-y",
"@itznotabug/aosp-mcp"
]
}
}
}{
"servers": {
"aosp": {
"type": "stdio",
"command": "bunx",
"args": [
"--bun",
"-y",
"@itznotabug/aosp-mcp"
]
}
}
}{
"context_servers": {
"aosp": {
"command": "bunx",
"args": [
"--bun",
"-y",
"@itznotabug/aosp-mcp"
]
}
}
}[mcp_servers.aosp]
command = "bunx"
args = ["--bun", "-y", "@itznotabug/aosp-mcp"]
[mcp_servers.aosp.env]
AOSP_MCP_MAX_RESULT_CHARS = "9000"{
"mcpServers": {
"aosp": {
"command": "bunx",
"args": [
"--bun",
"-y",
"@itznotabug/aosp-mcp"
],
"trust": true
}
}
}Troubleshooting
"Executable not found" in GUI-launched editors (macOS): desktop apps often miss your shell PATH. Use the absolute path from
which bunx(typically~/.bun/bin/bunx) as the command.No Bun installed: use
npxwith-y @itznotabug/aosp-mcpin any snippet above.Clients that truncate large tool results: lower
AOSP_MCP_MAX_RESULT_CHARS(e.g.9000) to fit your client's limit, as in the Codex example.
Tools
search_android_code
Parameter | Required | Description |
| Yes | Search query (regex plus |
| No |
|
| No | Files per page (default 10, max 50) |
| No | Continuation token from a previous result (e.g. |
| No | Context lines around matches (default 1, max 10) |
| No |
|
get_file_content
Parameter | Required | Description |
| Yes | Project id |
| Yes | Repository, e.g. |
| Yes | Branch, e.g. |
| Yes | File path relative to the repository root |
| No | First line to return (1-based) |
| No | Last line to return (inclusive; reads cap at 2000 lines per call) |
suggest_symbols
Parameter | Required | Description |
| Yes | Partial symbol or file name |
| No | Max suggestions (default 7, max 20) |
list_projects
No parameters. Returns the searchable projects (also as structured content).
Configuration
Environment variable | Default | Description |
|
| Per-attempt upstream request timeout |
|
| Search/suggest cache TTL ( |
|
| File-content cache TTL ( |
|
| Character budget per file-read result (minimum 1000; does not cap search results) |
MCP resources (android://source?...) intentionally return complete files and bypass the character budget. Cached
entries are keyed by the full request, so a cache hit is always the answer to the same question; TTLs only bound how
long a just-changed branch head can serve a slightly older revision.
Development
bun install # dependencies
bun run dev # run the server from TypeScript source
bun test # test suite (100% coverage thresholds enforced)
bun run lint # Biome + the strict.grit lint plugin
bun run typecheck # tsc
bun run build # bundle to dist/
bun run smoke # stdio handshake against the built bundleTests run against captured live API fixtures (tests/fixtures/) with the network mocked, plus end-to-end MCP
client/server tests over an in-memory transport. Refresh fixtures deliberately with
bun scripts/fixtures.ts when the upstream response shape changes.
License
Apache 2.0. See NOTICE for attribution.
Based on cs_android_mcp.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAquality-maintenanceEnables AI assistants to search and explore Chromium and PDFium source code, check Gerrit code reviews with test results and bot errors, search issues, and analyze commit history through Google's official APIs.Last updated6232619
- Flicense-qualityDmaintenanceEnables LLMs to perform high-performance code search and analysis across multiple languages using symbol indexing, regex text search, and structural AST pattern matching. It also provides tools for technology stack detection and dependency analysis with persistent caching for optimized performance.Last updated4
- AlicenseBqualityCmaintenanceEnables searching and browsing Android source code across projects like Android, AndroidX, and Android Studio via cs.android.com. It provides tools for regex-based code searches, full file content retrieval, and symbol autocomplete suggestions.Last updated43324MIT
- AlicenseBqualityDmaintenanceProvides on-demand access to AOSP and Jetpack source code to help AI understand Android framework internals. It features a hybrid architecture using Tree-sitter and LSP for precise code extraction, cross-file navigation, and local source indexing.Last updated11100Apache 2.0
Related MCP Connectors
Search your Obsidian vault to quickly find notes by title or keyword, summarize related content, a…
Get up-to-date, version-specific documentation and code examples from official sources directly in…
Connect to Atlassian Jira, Confluence, and Compass to search, create, and manage your work.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ItzNotABug/aosp-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server