Builder

class Builder

Fluent builder for DroidMcp. Add tools, optionally enable the HTTP server, TLS, and an audit sink, then call build. All setters return this for chaining.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

Add a single tool to the registry.

Link copied to clipboard

Add every tool in toolList (e.g. a module provider's all(context)).

Link copied to clipboard

Assemble the DroidMcp instance: build the registry, wire transports, return it (does not start the server).

Link copied to clipboard
fun enableHttpServer(port: Int = 8080, token: String? = null, requireAuth: Boolean = true, readOnly: Boolean = false, context: Context? = null): DroidMcp.Builder

Enable the HTTP transport (Ktor) for desktop MCP clients.

Link copied to clipboard

Serve the HTTP transport over TLS using config's keystore. Build a config with SelfSignedCert.loadOrCreate(...) from the opt-in droid-mcp-tls module, or supply your own keystore. The server binds TlsConfig.httpsPort instead of the plaintext port; clients pin DroidMcp.tlsFingerprint. No effect unless the HTTP server is enabled.

Link copied to clipboard

Record every HTTP tools/call to sink (e.g. the Room-backed sink from droid-mcp-audit). Has no effect unless the HTTP server is enabled. In-process calls are not audited — the host owns that path.