Android Code Search MCP Server
This server provides tools to search and browse Android source code from cs.android.com across projects including android, androidx, android-studio, and android-llvm.
search_android_code: Search code using regex and special operators like
file:,class:, andfunction:. Filter by project and control the number of results and context lines returned.get_file_content: Retrieve the full content of a specific source file by specifying the project, repository, branch, and file path.
suggest_symbols: Get autocomplete suggestions for classes, methods, or file names based on a partial query.
list_projects: List all available Android source projects that can be searched.
Allows searching and browsing Android source code via cs.android.com, featuring regex search support, symbol suggestions, and retrieval of full file contents.
Enables searching and browsing of Android Studio repository source code through the Android Code Search interface.
Provides capabilities to search and retrieve source code from LLVM projects hosted on the Android code search platform.
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., "@Android Code Search MCP Serversearch for the implementation of Activity.java in android"
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.
Android Code Search MCP Server
English | 简体中文
A Model Context Protocol (MCP) server for searching and browsing Android source code via cs.android.com.
Preview

Related MCP server: Android Development MCP Server
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-mcpCursor
{
"mcpServers": {
"cs-android": {
"command": "npx",
"args": ["-y", "cs-android-mcp"]
}
}
}Other MCP Clients
Any MCP-compatible client can use the stdio transport:
npx -y cs-android-mcpOr install globally:
npm install -g cs-android-mcp
cs-android-mcpAvailable Tools
search_android_code
Search for code in Android source repositories.
Parameter | Required | Description |
| Yes | Search query (supports regex, |
| No | Filter by project: |
| No | Number of results (default: 10, max: 50) |
| No | Context lines around matches (default: 1) |
get_file_content
Get the full content of a source file.
Parameter | Required | Description |
| Yes | Project name |
| Yes | Repository path |
| Yes | Branch name |
| Yes | File path |
suggest_symbols
Get symbol suggestions for partial queries.
Parameter | Required | Description |
| Yes | Partial query |
| No | Max suggestions (default: 7) |
list_projects
List all available Android source projects.
License
MIT
Available Tools
4 toolsget_file_contentC
Get the full content of a source file from Android repositories
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | Project name: android, androidx, android-studio, android-llvm | |
| repository | Yes | Repository name (e.g., platform/superproject/main, platform/frameworks/support) | |
| branch | Yes | Branch name (e.g., main, master, androidx-main) | |
| path | Yes | File path within the repository |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It mentions retrieving 'full content' but doesn't specify file size limits, encoding, error handling, or authentication requirements. For a tool that accesses source files, this lack of detail is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of accessing Android repositories and the lack of annotations and output schema, the description is insufficient. It doesn't explain what 'full content' entails (e.g., raw text, binary handling), potential errors, or return format, leaving critical gaps for effective tool use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, clearly documenting all four parameters with enums and examples. The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline of 3 for adequate but not enhanced parameter explanation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get the full content') and resource ('source file from Android repositories'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'search_android_code' or 'suggest_symbols', which might also involve file content retrieval in some contexts.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'search_android_code' or 'suggest_symbols'. It doesn't mention prerequisites, limitations, or specific scenarios where this tool is preferred over others, leaving the agent to infer usage from context alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_projectsB
List available Android source projects that can be searched
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('List') but lacks details on what 'available' means (e.g., permissions, filtering criteria), how results are returned (e.g., format, pagination), or any constraints (e.g., rate limits, authentication needs). This leaves significant gaps for a tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without any redundant information. It is appropriately sized and front-loaded, with every word contributing to understanding the tool's function.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of listing projects (which may involve permissions or scoping) and the lack of annotations and output schema, the description is incomplete. It does not explain what 'available' entails, how results are structured, or any behavioral aspects, leaving the agent with insufficient context for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description does not need to add parameter semantics, and it appropriately avoids unnecessary details, earning a baseline score of 4 for this context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('List') and resource ('available Android source projects'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'search_android_code' or 'suggest_symbols' beyond mentioning 'that can be searched', which is somewhat vague rather than a clear distinction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no explicit guidance on when to use this tool versus alternatives. It mentions 'that can be searched', which might imply a prerequisite for search operations, but this is not a clear usage instruction or comparison with siblings like 'search_android_code' or 'suggest_symbols'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_android_codeC
Search for code in Android source repositories (cs.android.com). Returns matching files and code snippets.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query. Supports regex and special operators like file:, class:, function:, etc. | |
| project | No | Filter by project: android, androidx, android-studio, android-llvm | |
| pageSize | No | Number of results to return (default: 10, max: 50) | |
| contextLines | No | Number of context lines around matches (default: 1) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'Returns matching files and code snippets,' which gives basic output information, but lacks details on permissions, rate limits, error handling, or pagination behavior. For a search tool with no annotation coverage, this is a significant gap in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise and front-loaded, consisting of just two sentences that directly state the tool's purpose and output. Every sentence earns its place with no wasted words, making it highly efficient and easy to understand.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (search with multiple parameters), no annotations, and no output schema, the description is incomplete. It doesn't explain the return format (e.g., structure of results), error conditions, or behavioral traits like rate limits. For a search tool, this leaves significant gaps in understanding how to use it effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond what the schema provides, such as explaining the search query syntax in more detail or clarifying the 'project' filter's impact. Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Search for code in Android source repositories (cs.android.com).' It specifies the verb ('search') and resource ('code in Android source repositories'), and distinguishes itself from sibling tools like 'get_file_content' (which retrieves specific file content) and 'list_projects' (which lists projects). However, it doesn't explicitly differentiate from 'suggest_symbols' (which might also involve searching), keeping it from a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'suggest_symbols' or 'get_file_content', nor does it specify scenarios where this search tool is preferred over others. The only implied usage is for searching code in Android repositories, but without explicit context or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
suggest_symbolsC
Get symbol suggestions for a partial query (classes, methods, files)
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Partial query to get suggestions for | |
| maxResults | No | Maximum number of suggestions (default: 7) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but lacks critical behavioral details such as whether this is a read-only operation, if it requires authentication, potential rate limits, or what the output format looks like (e.g., structured list of symbols). This leaves significant gaps for an agent to understand how to handle the tool's behavior effectively.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core purpose without any wasted words. It directly states the action and scope, making it easy to parse and understand quickly, which is ideal for concise tool descriptions.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete for a tool with two parameters. It doesn't explain the return values (e.g., what a 'symbol suggestion' looks like), error conditions, or behavioral constraints, which are crucial for an agent to use the tool correctly in a broader context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, with both parameters ('query' and 'maxResults') clearly documented in the input schema. The description adds minimal value beyond the schema by implying the query is for 'partial' input and specifying symbol types, but it doesn't provide additional syntax, format details, or examples that aren't already covered by the schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Get') and resource ('symbol suggestions') with specific scope ('classes, methods, files'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from its siblings like 'search_android_code', which might also involve code-related searches, leaving room for ambiguity in sibling tool selection.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'search_android_code' or 'list_projects'. It mentions the context ('partial query') but offers no explicit when-to-use or when-not-to-use instructions, leaving the agent to infer usage based on the tool name and parameters alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose: get_file_content retrieves file contents, list_projects enumerates available projects, search_android_code performs code searches, and suggest_symbols provides symbol suggestions. There is no overlap in functionality, making tool selection straightforward for an agent.
Tool names follow a consistent verb_noun pattern (get_file_content, list_projects, search_android_code, suggest_symbols), with all using snake_case. The minor deviation is 'suggest_symbols' using a verb that is slightly less action-oriented than others, but overall naming is highly consistent and predictable.
With 4 tools, the server is well-scoped for Android code search functionality. Each tool serves a specific and necessary role in the domain (browsing, listing, searching, and suggesting), and there are no extraneous tools. The count is appropriate for the server's purpose.
The tool set covers core Android code search operations: listing projects, searching code, retrieving file contents, and suggesting symbols. A minor gap is the lack of advanced search filters or metadata operations, but the basic workflow is fully supported without dead ends.
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 Connectors
Provides tools for searching Google Workspace documentation and much more.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Get up-to-date, version-specific documentation and code examples from official sources directly in…
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceEnables 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.10232619
- AlicenseNot gradedqualityDmaintenanceProvides Android development assistance following NowInAndroid best practices, including architecture patterns, code generation for feature modules/ViewModels/repositories, and searchable documentation for Jetpack Compose and modularization.MIT
- AlicenseAqualityDmaintenanceEnables Android Automotive developers to explore and implement Vehicle Hardware Abstraction Layer (vHAL) properties with intelligent tools for property analysis, source code lookup, implementation guidance, and automated code generation for automotive systems like climate control and seat management.81MIT
- AlicenseBqualityCmaintenanceProvides 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.11100Apache 2.0
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/steveday763/cs_android_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server