MCP Catalogs
首页

android-source-explorer-mcp

by mrmike·91·综合分 49

一个为AI辅助开发提供Android源码直接访问的MCP服务器。

developer-toolsai-llmfile-system
4
Forks
1
活跃 Issue
2 个月前
最近提交
2 天前
收录于

概述

Android源码探索MCP服务器使AI工具能够实时访问最新的Android源码,解决了训练数据过时的常见问题。它采用混合架构,结合Tree-sitter实现快速的AST解析和可选的LSP功能进行跨文件导航。服务器在本地缓存AOSP和AndroidX源码,确保快速查找和离线功能。

试试问 AI

装完之后,这里有 3 个你可以让 AI 做的事:

:理解Android框架内部机制,如Activity生命周期和ViewModel恢复
:实时查找Jetpack库和AndroidX组件的文档
:在数千万行源码中交叉引用代码实现

什么时候选它

当开发Android应用程序且需要直接从源代码获取精确、最新信息,而不是可能过时的文档时,选择此工具。

什么时候不要选它

如果你不从事Android开发,或者需要在最新AOSP变更同步到本地之前实时访问它们,则避免使用。

此 server 暴露的工具

从 README 抽取出 9 个工具
  • search_classes

    Search for classes by glob pattern or substring

  • lookup_class

    Retrieve the full source code for a specific class

  • lookup_method

    Extract a precise method body + its Javadoc/annotations

  • list_class_members

    List all method and field signatures in a class

  • get_class_hierarchy

    Get the inheritance chain (superclass + interfaces)

  • search_in_source

    Search for text/regex across the entire source tree

  • goto_definition

    Resolve the cross-file definition of a symbol

  • find_references

    Find all usages of a class/method across the whole tree

  • get_type_info

    Get documentation and type info via hover data

可对比工具

android-docs-mcpaosp-source-mcpjetpack-docs-mcp

安装

安装

前置要求

  • uv (推荐) 或 Python 3.11+
  • Git

推荐安装方式 (通过uv)

uv tool install git+https://github.com/mrmike/android-source-explorer-mcp

初始同步

# 同步API 36 (Android 16)和常用AndroidX包
android-source-explorer sync --api-level 36 --androidx "compose,lifecycle,activity"

配置

{
  "mcpServers": {
    "android-sources": {
      "command": "android-source-explorer",
      "args": ["serve"]
    }
  }
}

android-source-explorer-mcp 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。