android
一个基于 MCP Kotlin SDK 的 Android 服务器应用,使用 SSE (Server-Sent Events) 传输协议。
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:
-
Clone the repository: git clone <repository-url> cd mcp-kotlin
-
Open the project in Android Studio:
- Start Android Studio
- Choose "Open an existing project"
- Select the project directory
-
Sync Gradle:
- Android Studio will prompt to sync; wait for dependencies to download
-
Run the app:
- Connect an Android device or start an emulator
- Click the "Run" button to install and start the app
-
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
burp-ai-agent
Burp Suite extension that adds built-in MCP tooling, AI-assisted analysis, privacy controls, passive and active scanning and more
FantasyPremierLeague
Fantasy Premier League Kotlin/Compose Multiplatform sample
mcp
MCP Server for Burp
paiml -agent-toolkit
Pragmatic AI Labs MCP Agent Toolkit - An MCP Server designed to make code with agents more deterministic
mcp-kotlin-sdk
Kotlin implementation of the Model Context Protocol (MCP)
k8s-ai
AI-Powered Kubernetes Management System: A platform combining natural language processing with Kubernetes management. Users can perform real-time diagnostics, resource monitoring, and smart log analysis. It simplifies Kubernetes management through conversational AI, providing a modern alternative