Android Code Search MCP Server

Search and browse Android source code via cs.android.com

README.md

Android Code Search MCP Server

English | 简体中文

A Model Context Protocol (MCP) server for searching and browsing Android source code via cs.android.com.

Preview

Preview

Features

  • Code Search: Search through Android source code with regex support
  • File Content: Retrieve full source file contents
  • Symbol Suggestions: Get autocomplete suggestions for classes, methods, files
  • Multiple Projects: Search across Android, AndroidX, Android Studio, and LLVM projects

Installation

Claude Code

claude mcp add cs-android -- npx -y cs-android-mcp

Other MCP Clients

Any MCP-compatible client can use the stdio transport:

npx -y cs-android-mcp

Or install globally:

npm install -g cs-android-mcp
cs-android-mcp

Available Tools

search_android_code

Search for code in Android source repositories.

Parameter Required Description
query Yes Search query (supports regex, file:, class:, function: operators)
project No Filter by project: android, androidx, android-studio, android-llvm
pageSize No Number of results (default: 10, max: 50)
contextLines No Context lines around matches (default: 1)

get_file_content

Get the full content of a source file.

Parameter Required Description
project Yes Project name
repository Yes Repository path
branch Yes Branch name
path Yes File path

suggest_symbols

Get symbol suggestions for partial queries.

Parameter Required Description
query Yes Partial query
maxResults No Max suggestions (default: 7)

list_projects

List all available Android source projects.

License

MIT

Tools 4

search_android_codeSearch for code in Android source repositories.
get_file_contentGet the full content of a source file.
suggest_symbolsGet symbol suggestions for partial queries.
list_projectsList all available Android source projects.

Try it

Search for the implementation of the Activity class in the android project.
Find all occurrences of 'onPause' in the AndroidX repository.
Get the full source code for the file located at frameworks/base/core/java/android/app/Activity.java.
List all available Android projects I can search through.
Suggest symbols matching 'View' to help me find relevant UI classes.

Frequently Asked Questions

What are the key features of Android Code Search?

Regex-supported code search across Android source repositories. Full source file content retrieval. Autocomplete suggestions for classes, methods, and files. Multi-project support including Android, AndroidX, Android Studio, and LLVM.

What can I use Android Code Search for?

Quickly referencing Android framework implementation details while coding. Debugging Android system behavior by inspecting source code directly. Exploring AndroidX library internals to understand API usage. Finding specific class definitions or method signatures across the Android codebase.

How do I install Android Code Search?

Install Android Code Search by running: claude mcp add cs-android -- npx -y cs-android-mcp

What MCP clients work with Android Code Search?

Android Code Search works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Android Code Search docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare