Skip to main content
Glama
steveday763

Android Code Search MCP Server

by steveday763

Android Code Search MCP Server

npm version npm downloads GitHub stars License: MIT

English | 简体中文

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

Preview

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-mcp

Cursor

{
  "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-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

Available Tools

4 tools
get_file_contentC

Get the full content of a source file from Android repositories

ParametersJSON Schema
NameRequiredDescriptionDefault
projectYesProject name: android, androidx, android-studio, android-llvm
repositoryYesRepository name (e.g., platform/superproject/main, platform/frameworks/support)
branchYesBranch name (e.g., main, master, androidx-main)
pathYesFile path within the repository

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query. Supports regex and special operators like file:, class:, function:, etc.
projectNoFilter by project: android, androidx, android-studio, android-llvm
pageSizeNoNumber of results to return (default: 10, max: 50)
contextLinesNoNumber of context lines around matches (default: 1)

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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)

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesPartial query to get suggestions for
maxResultsNoMaximum number of suggestions (default: 7)

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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

B3.4/5.0
Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivitySlowing
ResponsivenessSyncing

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

Related MCP Servers

  • A
    license
    A
    quality
    Not graded
    maintenance
    Enables 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.
    10
    23
    26
    19
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides 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
  • A
    license
    A
    quality
    D
    maintenance
    Enables 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.
    8
    1
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    Provides 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.
    11
    100
    Apache 2.0

Latest Blog Posts

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