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
Invoke a tool directly in-process, bypassing JSON-RPC. Honours runtime gating.
Like callTool, delivering the tool's reportProgress updates to onProgress.
Names currently gated off.
Render a prompt in-process; see InProcessTransport.getPrompt.
Whether the HTTP server is currently running.
Prompts whose required tools are all enabled (in-process).
Every provider's advertised resources (in-process).
Every provider's URI templates (in-process).
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).
The contents at uri, or null when nothing handles it (in-process).
Add a resource provider at runtime; connected clients get notifications/resources/list_changed.
Register more tools after Builder.build — e.g. once the user grants the permission they need. Connected HTTP clients get notifications/tools/list_changed.
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.
Remove a resource provider added with Builder.addResourceProvider or registerResourceProvider.
Remove a tool at runtime (e.g. after its permission is revoked). @return true if it was registered.