Skip to main content
The Android Assistant SDK puts a governed agent inside your own app: a streaming client to Metabind’s Agent proxy, an MCP client for your project’s tools, and rendering of Interactive Tool results as real native Jetpack Compose — not web views — through BindJS. Use the drop-in MetabindAssistantView for a complete chat surface, or build your own with the lower-level APIs.

SDK on GitHub

metabind-android — the Android SDK. The Assistant SDK is the :metabindai module.

Demo app

samples/assistant-demo — a complete Compose chat app built on MetabindAssistantView.

Requirements

Installation

Add the Assistant SDK dependency, which pulls in the MCP client (ai.metabind:mcpappshost-android) and the BindJS renderer (ai.metabind:bindjs-android) transitively:
See the repository README for the Maven repository configuration.

What you configure

  • A Metabind API key, sent as a Bearer token to both the Agent proxy and the MCP server.
  • Your project’s orgId and projectId: the internal IDs, not the slugs, because the Agent proxy accepts only IDs. The SDK derives your project’s MCP server URL from these. To look them up, see Find your organization and project IDs.
  • Optionally, the agentHost and mcpHost constructor parameters, which default to https://agent.metabind.ai and https://mcp.metabind.ai.

Drop in the chat surface

The SDK ships MetabindAssistantView, a complete chat UI:
MetabindAssistantView handles message bubbles, streaming indicators, tool rendering, input, and auto-scrolling. It follows your app’s Material3 theme.
Retain the MetabindAssistant instance at an appropriate scope — inside a ViewModel, for example — and call close() when you discard it.

MetabindAssistant

MetabindAssistant manages the conversation. For custom UIs, observe its state directly:

ChatMessage

Stream a conversation turn

MetabindAgentProvider calls the Agent proxy — which holds the LLM key and runs the tool loop server-side — and streams results back as a Flow<LLMStreamEvent>:
The Android SDK is Agent-proxy only — there’s no bring-your-own-key Anthropic provider. See LLM provider configuration for how the proxy works.

Discover and fetch tool UIs

Use MCPAppsClient to list your project’s tools and fetch the UI resource for a tool that renders one:
MCPAppsClient also exposes callTool(name, arguments) for invoking tools.

Native rendering of tool output

If you use MetabindAssistantView, tool rendering is automatic. For custom UIs, render each tool call with MetabindToolView, the same renderer MetabindAssistantView uses. It takes a ToolUIContent, which has two variants:
  • ToolUIContent.BindJS — rendered as Compose through bindjs-android
  • ToolUIContent.Html — rendered in a WebView
toolUIContent is keyed by tool call ID, the same ID as the TOOL message the call produced. See MetabindToolView.kt for the optional parameters.

Build a custom chat UI

If MetabindAssistantView doesn’t fit your design, build your own around MetabindAssistant. Observe assistant.messages, call assistant.send(text), and render each TOOL message’s UI by passing assistant.toolUIContent[message.id] to MetabindToolView. The finance demo is a complete custom UI built this way, and Custom host UI has a short example. The MetabindAssistantView source shows the drop-in surface built on the same APIs.

Next steps

Demo app

The reference Compose chat app, end to end.

LLM provider configuration

How the Agent proxy holds keys and runs the tool loop.

BindJS reference

The component language the tool UIs are written in.

iOS SDK

The iOS equivalent.