MCP ExplorerExplorer

Android Mcp Sdk

@kaeawcon 9 months ago
4 Apache-2.0
FreeCommunity
AI Systems
Android MCP SDK enables hosting MCP servers in Android apps with Kotlin integration.

Overview

What is Android Mcp Sdk

The android-mcp-sdk is an Android library that integrates the MCP Kotlin SDK, enabling Android applications to host MCP (Model Context Protocol) servers.

Use cases

Use cases include enabling Android apps to serve file-like data, providing callable functions for LLMs, and offering pre-created prompt templates for enhanced interaction with MCP clients.

How to use

To use the android-mcp-sdk, initialize the MCP server in your Application class and start the server in a background thread. The library provides a singleton manager for thread-safe server management.

Key features

Key features include successful integration of MCP Kotlin SDK, dependency configuration, organized project structure, successful compilation, a thread-safe singleton manager, and readiness for AndroidX Startup integration.

Where to use

The android-mcp-sdk is used in Android applications that require hosting MCP servers, particularly for providing resources, tools, and prompts to MCP clients.

Content

Android MCP SDK

An Android library that integrates the MCP Kotlin SDK to enable Android applications to host MCP (Model Context Protocol) servers.
The overall goal is to enable Android apps to provide MCP servers access to AI tools in development environments.

⚠️ DEBUG BUILDS ONLY: This library is intended for debug builds and development environments only.
The library will crash if included in release builds to prevent accidental deployment.

Quick Start

Add the library to your Android project:

dependencies {
    debugImplementation("dev.jasonpearson:mcp-android-sdk:1.0.0")  // Debug builds only!
}

That’s it! The MCP server automatically initializes via AndroidX Startup. Launch you app and query
adb for device information to obtain the SSE URL, drop that into your favorite MCP client and interact
with your app via an AI agent.

Features

  • ✅ Full MCP specification support (tools, resources, prompts)
  • ✅ Built-in Android-specific tools and resources
  • ✅ WebSocket and HTTP/SSE transport layers
  • ✅ AndroidX Startup automatic initialization and startup
  • ✅ DI framework integration (Hilt, Koin, Dagger)
  • ✅ Thread-safe singleton management
  • ✅ Comprehensive lifecycle management
  • Release build protection - Crashes if accidentally included in production

Safety Features

This library includes multiple safety mechanisms to prevent accidental inclusion in production
builds:

  • Gradle Configuration: Use debugImplementation instead of implementation
  • Runtime Checks: Automatically detects and crashes on release builds
  • Clear Error Messages: Provides detailed instructions when misused
  • Development Focus: All features designed for debug/development workflows

Documentation

📚 Read the full documentation →

License

Apache 2.0 License

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers