Logo di Droid MCP

Droid MCP

Community
stixez

Android SDK and MCP server: 157 tools for calendar, contacts, SMS, files, camera, sensors, notifications and UI automation, for on-device LLMs and MCP clients such as Claude Code and Cursor.

Autorestixez
Repositorydroid-mcp
LinguaKotlin
Fork
7
Stelle
40
Strumenti disponibili
0
Tipo di trasportostreamable-http
Categorie
LicenzaApache-2.0
Link
  • Collega gli strumenti ai flussi di lavoro IA

    Droid MCP mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    40 stelle e 7 fork nel repository collegato.


droid-mcp turns Android phone capabilities into tools a language model can call, using the Model Context Protocol. Use it in two ways:

  • On-device: your app runs a local model and calls the tools directly. No server involved.
  • Over MCP: your app runs a small HTTP server on the phone, and Claude Code, Cursor or any other MCP client that speaks Streamable HTTP connects over Wi-Fi.

With the matching modules, a model can for example:

  • summarize today's calendar and unread messages, then reply to one of them
  • find a photo from last weekend and read the text in it
  • open an app and tap through its screens with the accessibility tools
  • check battery, storage and connectivity, and turn on Do Not Disturb

Highlights:

  • Pick only what you need. 53 independent modules. Each adds only its own permissions to your manifest.
  • Safe by default. Bearer auth, Origin and session checks, an SSRF guard, sandboxed file access, read-only mode, per-tool gating, and optional user confirmation for risky calls.
  • Current MCP. Protocol 2025-11-25: typed results (outputSchema) on every tool, resources, prompts, live list_changed updates, image content, progress, elicitation and cancellation.
  • Your permission UX. The library never asks for permissions. Your app decides when and how.

Quick start

Add JitPack and the modules you want:

kotlin
// settings.gradle.kts
dependencyResolutionManagement {
    repositories { maven { url = uri("https://jitpack.io") } }
}

// build.gradle.kts
dependencies {
    implementation("com.github.stixez.droid-mcp:droid-mcp-core:0.12.1")
    implementation("com.github.stixez.droid-mcp:droid-mcp-calendar:0.12.1")
    implementation("com.github.stixez.droid-mcp:droid-mcp-contacts:0.12.1")
    // or everything except the opt-in modules:
    // implementation("com.github.stixez.droid-mcp:droid-mcp-all:0.12.1")
}

Build it and call a tool:

kotlin
val mcp = DroidMcp.builder()
    .addTools(CalendarTools.all(context))
    .addTools(ContactsTools.all(context))
    .build()

val result = mcp.callTool("read_calendar", mapOf("start_date" to "2026-10-01"))
if (result.isSuccess) println(result.data)   // {events=[...], count=3}
else println(result.errorMessage)

Netty and BouncyCastle ship the same license files in several jars. Exclude them:

kotlin
android {
    packaging {
        resources {
            excludes += setOf(
                "META-INF/INDEX.LIST",
                "META-INF/io.netty.versions.properties",
                "META-INF/LICENSE.md",
                "META-INF/NOTICE.md",
                "META-INF/license/**",
                "META-INF/versions/9/OSGI-INF/MANIFEST.MF", // droid-mcp-tls only
            )
        }
    }
}

Use it with an on-device model

Give the model the tool catalogue, then run whatever it picks:

kotlin
val toolsJson = mcp.listToolsJson()           // names, descriptions, JSON Schemas

val result = mcp.callTool("send_message", mapOf("to" to "+15551234567", "body" to "On my way"))

Tool calls run on Dispatchers.IO with a timeout (5 minutes by default, Builder.toolTimeout()), so calling from the main thread is fine. Long tools can report progress: mcp.callTool(name, params) { update -> … }.

Use it from a desktop MCP client

Start the server on the phone:

kotlin
val mcp = DroidMcp.builder()
    .addTools(DeviceTools.all(context))
    .addTools(CalendarTools.all(context))
    .enableHttpServer(context = context)      // port 8080, token auto-generated
    .build()

mcp.startServer()
val token = mcp.serverToken                   // show it, or put it in a pairing QR

Then add the phone to your client, for example Claude Code (~/.claude/settings.json):

json
{
  "mcpServers": {
    "phone": {
      "type": "http",
      "url": "http://<phone-ip>:8080/mcp",
      "headers": { "Authorization": "Bearer <token>" }
    }
  }
}

The phone advertises itself over mDNS (_mcp._tcp). Useful enableHttpServer options:

  • readOnly = true: only tools that change nothing.
  • allowedOrigins: browser-based clients such as MCP Inspector.
  • Builder.enableTls(...): HTTPS with a pinned self-signed certificate.

Pairing, sessions and TLS are covered in docs/PAIRING.md.

Resources and prompts

Give clients device data to attach, and ready-made prompts:

kotlin
DroidMcp.builder()
    .addTools(MediaTools.all(context))
    .addResourceProvider(MediaTools.resources(context))    // recent photos and videos
    .addResourceProvider(CalendarTools.resources(context)) // droidmcp://calendar/today
    .addBuiltInPrompts()                                    // message_contact, device_health_check, …

A prompt is listed only while the tools it uses are registered. Tools added later with mcp.registerTools(...), for example after the user grants a permission, reach connected clients through notifications/tools/list_changed. Details are in docs/TOOLS.md.

Confirm risky calls

Ask the user before a destructive tool runs, on either transport:

kotlin
DroidMcp.builder()
    .addTools(SmsTools.all(context))
    .confirmToolCalls { request ->            // every destructiveHint tool, by default
        withContext(Dispatchers.Main) { askUser(request.toolName, request.arguments) }
    }

If the user declines or doesn't answer in time, the result is tool_call_declined and the tool never runs. ToolCallConfirmer.viaClientElicitation() asks the desktop client's user instead.

Modules

Every module depends only on core. The full list of tools, parameters and permissions is in docs/TOOLS.md.

AreaModules
Personal datacalendar contacts sms calllog media files downloads clipboard
Devicedevice screen settings sensors health biometric keyguard flashlight vibration audio usb wallpaper ringtone dnd
Connectivitynetwork wifi bluetooth telephony nfc location web
Camera & visioncamera screenshot qr mlkit
Apps & intentsapps alarms intent print tts playback
Notificationsnotifications notifications-reply notification-watch
UI automationaccessibility ime overlay
Shell / root admin (opt-in)shizuku root: install and uninstall apps, grant permissions, write settings, run allowlisted commands. See docs/SHELL.md.
Hardening (opt-in)audit (Room-backed call log), tls (self-signed HTTPS), server-service (foreground service that keeps the server alive)

droid-mcp-all bundles everything except the opt-in modules, which pull extra dependencies (Shizuku, libsu, Room, BouncyCastle).

Permissions

Your app requests runtime permissions itself. Check each provider first:

kotlin
if (CalendarTools.hasPermissions(context)) builder.addTools(CalendarTools.all(context))
else requestPermissions(CalendarTools.requiredPermissions())

Some providers only register tools whose permission is granted, for example create_event needs WRITE_CALENDAR, so rebuild after a grant. A few modules need a grant in system Settings instead:

ModuleNeedsGranted in
playback, notifications-reply, notification-watchNotification access. Your service extends McpNotificationListenerServiceBase.Settings › Apps › Special access › Notification access
accessibilityYour service extends DroidMcpAccessibilityServiceSettings › Accessibility
imeYour service extends DroidMcpInputMethodService, enabled and selectedSettings › System › Keyboard
overlayDisplay over other appsSettings › Apps › Special access
screenshotMediaProjection consent, handed to MediaProjectionHolder from a mediaProjection foreground serviceConsent dialog
dndDo Not Disturb access (set_dnd_mode)Settings › Apps › Special access
settings, ringtoneModify system settings (set_brightness, set_ringtone)Settings › Apps › Special access
networkUsage access (get_data_usage)Settings › Apps › Special access
shizuku, rootShizuku running, or a rooted deviceSee docs/SHELL.md

[!NOTE] Android 10+ blocks activity launches from the background. Tools that open another app (launch_app, alarms, intents, toggle_wifi) need your app in the foreground or holding the overlay permission. Otherwise they return an error.

Security

The HTTP server:

  • requires a bearer token
  • rejects foreign Origin headers, non-JSON bodies, bodies over 4 MB and unknown protocol versions
  • ties every request to a session

Tools are also constrained: file tools and file resources are sandboxed to external storage (the file write tools are opt-in), web tools refuse private and loopback addresses, and intents use an action and URI-scheme allowlist. The server listens on every network the phone joins, so use it on networks you trust or enable TLS. The threat model is in docs/SECURITY.md.

droid-mcp itself sends no analytics. Google ML Kit, used by mlkit and qr, reports usage to Google under its own terms.

Requirements

  • Android 9 (API 28) or newer at runtime
  • compileSdk 36+, AGP 8.9.1+ and Kotlin 2.3+ in your app

Sample app

sample-app registers every module, the four resource providers and the built-in prompts, and has four tabs:

  • Tools: a test button per tool, plus shortcuts to grant special permissions.
  • Gating: switch tools on and off on the live server.
  • Activity: recent calls.
  • Audit: the persisted call log, with JSON export.

Start the server there and pair a desktop client with the QR code.

Documentation

ToolsEvery tool, its parameters and permissions
PairingConnecting clients: tokens, sessions, mDNS, QR, TLS
SecurityThreat model and trust boundaries
Shell toolsShizuku and root setup, safety policy
VersioningCompatibility promise and how CI enforces it
API referenceKDoc for every module
ReleasesRelease notes

Contributing

Contributions are welcome. For anything non-trivial, please open an issue first.

License

Apache License 2.0. See LICENSE.

Usa MCP Droid MCP con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso Droid MCP, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP si connette in TypingMind tramite l'URL di un server MCP ospitato in remoto.

Aggiungi l'URL di un server MCP

Usa questo metodo se Droid MCP è già ospitato in remoto o se il tuo team vuole un unico connettore condiviso accessibile a più utenti.

1

Apri Connettori MCP

In TypingMind, vai su Plugin, apri Connettori MCP e scegli Aggiungi URL.

  1. Apri TypingMind nel tuo browser.
  2. Vai a Plugin.
  3. Apri Connettori MCP.
  4. Fai clic su Aggiungi URL.
Modulo di TypingMind per aggiungere l'URL di un server MCP personalizzato
2

Incolla l'URL del server

Inserisci l'URL del server MCP fornito dal provider nel campo URL del server. Aggiungi un nome per la connessione, una descrizione, un'icona, header HTTP personalizzati o le impostazioni del client OAuth se richiesti dal server.

  1. Incolla l'URL del server MCP fornito dal provider nel campo URL del server.
  2. Inserisci un nome per la connessione a Droid MCP.
  3. Aggiungi una descrizione e un'icona per riconoscere più facilmente la connessione.
  4. Aggiungi header HTTP personalizzati o i dati del client OAuth se il server richiede l'autenticazione.
3

Crea la connessione

Fai clic su Crea connessione, poi torna all'elenco dei plugin e verifica che la nuova connessione MCP sia attiva.

  1. Fai clic su Crea connessione.
  2. Torna all'elenco dei connettori MCP.
  3. Verifica che la connessione Droid MCP risulti attiva.
  4. Aggiorna l'elenco dei plugin se la connessione non appare subito.
4

Cambia modello senza riconnetterti

Avvia una chat con il tuo modello preferito, abilita gli strumenti di Droid MCP dalla sezione Plugin e passa a un altro modello quando serve. La connessione MCP rimane disponibile nell'area di lavoro di TypingMind.

  1. Avvia una nuova chat in TypingMind.
  2. Seleziona il modello IA che vuoi usare.
  3. Abilita gli strumenti di Droid MCP dalla sezione Plugin.
  4. Chiedi al modello di usare lo strumento quando serve.
  5. Passa a un altro modello IA e riutilizza la stessa connessione MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Droid MCP per aiutarmi con questa attività?
Droid MCP
Certo. Ho letto.
Ecco cosa ho trovato con Droid MCP.

Domande frequenti

A cosa serve il server MCP Droid MCP?

Droid MCP è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare Droid MCP MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare Droid MCP con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP Droid MCP con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando Droid MCP, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego Droid MCP MCP a TypingMind?

Puoi collegare Droid MCP a TypingMind aggiungendo l'URL del suo server MCP ospitato in remoto. È utile se vuoi una connessione MCP remota disponibile dalla tua area di lavoro TypingMind.

Quali strumenti offre Droid MCP MCP in TypingMind?

Droid MCP mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare Droid MCP MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se Droid MCP richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇