DroidMcp
The SDK entry point. Built via DroidMcp.builder / Builder, it owns a ToolRegistry and both transports: an always-on InProcessTransport for on-device LLMs (listTools / callTool) and an optional HttpTransport for desktop MCP clients (startServer).
Also surfaces the 1.0 hardening controls: runtime per-tool gating (setToolEnabled / setDisabledTools), token rotation (rotateToken), per-client pairing (pairClient / revokeClient / pairedClients), and the TLS fingerprint (tlsFingerprint) to pin in a pairing QR.
Types
Properties
The HTTP server's effective bearer token, or null if the server is disabled or open (no auth).
SHA-256 fingerprint of the server's TLS certificate to pin in the pairing QR, or null if the server is plaintext. See TlsConfig.certFingerprintSha256.
Functions
Names currently gated off.
Whether the HTTP server is currently running.
The registered tools serialised to a JSON catalogue; see InProcessTransport.listToolsJson.
Mint a revocable token for a named client. Re-pairing an existing label replaces its token. Returns the new token, or null when there's no authenticated HTTP server.
Snapshot of paired clients (excludes the primary).
Revoke a paired client's token. @return true if a client with that label existed.
Rotate the primary bearer token, invalidating the old one (paired clients keep theirs). Returns the new token, or null if the HTTP server is disabled or running without auth. Re-issue the pairing QR after calling.
Replace the full set of gated-off tools in one call.
Gate a single tool on or off at runtime. A disabled tool disappears from tools/list and is rejected by tools/call (both transports) without being unregistered, so the host can drive a per-tool checkbox grid without rebuilding the server. No-op for unknown names.
Start the HTTP server. Throws if the server was not enabled via Builder.enableHttpServer.
Stop the HTTP server if running; no-op when the server is disabled.