Skip to main content
Glama
Android Code Search MCP Server

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 Source Explorer 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

Inputs: project (required), repository (required), branch (required), path (required).

list_projectsB

List available Android source projects that can be searched

Inputs: no named parameters.

search_android_codeC

Search for code in Android source repositories (cs.android.com). Returns matching files and code snippets.

Inputs: query (required), project, pageSize, contextLines.

suggest_symbolsC

Get symbol suggestions for a partial query (classes, methods, files)

Inputs: query (required), maxResults.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 4 tools

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables searching and reading Android Open Source Project (AOSP) source code via cs.android.com, with support for regex search, file content retrieval, and symbol suggestions.
      162 npm
      4
      Apache 2.0
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI tools to retrieve and navigate actual AOSP and AndroidX source code on demand for accurate framework internals, with tools for class/method lookup, member listing, hierarchy, and source search. Optional LSP features add cross-file definitions, references, and type information.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables on-demand, precise exploration of AOSP and AndroidX source code, including class and method lookup, inheritance inspection, regex search, and optional cross-file navigation via LSP.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables precise, offline-ready exploration of AOSP internals and Jetpack/AndroidX sources, including class and method lookup, hierarchy inspection, regex search, and optional cross-file definition/reference navigation.
      -