Get the FREE Ultimate OpenClaw Setup Guide →

android

一个基于 MCP Kotlin SDK 的 Android 服务器应用,使用 SSE (Server-Sent Events) 传输协议。

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio alguojian-android-mcp-server uvx android-mcp-server \
  --env PORT="Server port (default 8080)"

How to use

This Android MCP Server provides a complete MCP Model Context Protocol server implemented with the MCP Kotlin SDK and served over Server-Sent Events (SSE). It runs inside an Android app and exposes an SSE endpoint for real-time communication, along with HTTP endpoints for status and MCP protocol interactions. The app includes tools such as device information retrieval, current time queries, system information resources, and device analysis prompts. To use it, deploy the app to an Android device or emulator, configure the desired port (default 8080) and server name in the app, and start the server from the UI. You can then access the endpoints from the host machine or other devices on the same network: the main page at http://<device-ip>:8080/, SSE at http://<device-ip>:8080/sse, and status at http://<device-ip>:8080/status. The MCP protocol is fully supported through these endpoints, and logs are displayed in the app for real-time monitoring.

How to install

Prerequisites:

  • Android Studio Hedgehog (2023.1.1) or newer
  • Android SDK (API 24 / Android 7.0) or newer
  • Kotlin 2.1.0
  • Gradle 8.4

Steps:

  1. Clone the repository: git clone <repository-url> cd mcp-kotlin

  2. Open the project in Android Studio:

    • Start Android Studio
    • Choose "Open an existing project"
    • Select the project directory
  3. Sync Gradle:

    • Android Studio will prompt to sync; wait for dependencies to download
  4. Run the app:

    • Connect an Android device or start an emulator
    • Click the "Run" button to install and start the app
  5. Quick test:

    • Build the project: Build → Clean Project; Build → Rebuild Project
    • Launch the app on a device/emulator and start the server from the UI
    • Test MCP endpoints from a browser or client: /, /sse, /status

Additional notes

Tips and common considerations:

  • Ensure the device and client are on the same network if testing from a host machine.
  • The server defaults to port 8080; you can change it in the app UI before starting.
  • Logs are shown in real time within the app; review them if the server fails to start or endpoints return errors.
  • If you run into TLS or network issues, verify network permissions for the app and ensure the device firewall allows inbound connections on the chosen port.
  • If you need to customize tools or resources, modify setupTools() and setupResources() in McpServerManager.kt as documented in the repo.

Related MCP Servers

Sponsor this space

Reach thousands of developers