MetabindAssistantView for a complete chat UI, or build your own with the lower-level APIs.
SDK on GitHub
metabind-ai-android — the Assistant SDK source.Demo app
metabind-assistant-demo-android — a complete Compose chat app built on the SDK.Requirements
| Requirement | Version |
|---|---|
| Android | 8.0 (API 26) or later |
| UI toolkit | Jetpack Compose |
| JDK | 21 |
Installation
Add the umbrella dependency, which pulls in the MCP client (mcpappshost-android) and the BindJS renderer (bindjs-android) transitively:
- build.gradle.kts
- build.gradle
What you configure
- A Metabind API key, sent as a
Bearertoken to both the Agent proxy and the MCP server. - Your project’s
orgIdandprojectId. - The Agent proxy host (
https://agent.metabind.ai) and your project’s MCP server URL (copy it from the Server tab in MCP App Studio).
Drop in the chat surface
The SDK shipsMetabindAssistantView, a complete chat UI:
MetabindAssistantView handles message bubbles, streaming indicators, tool rendering, input, and auto-scrolling. It follows your app’s Material3 theme.
MetabindAssistant
MetabindAssistant manages the conversation. For custom UIs, observe its state directly:
| Property | Type | Description |
|---|---|---|
messages | StateFlow<List<ChatMessage>> | Conversation history |
isLoading | StateFlow<Boolean> | True while streaming |
error | StateFlow<String?> | Error message, if any |
toolUIContent | StateFlow<Map<String, ToolUIContent>> | Tool UI payloads by call ID |
| Method | Description |
|---|---|
send(text) | Send a user message |
cancel() | Cancel current response |
reset() | Clear conversation |
close() | Release resources |
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>:
Discover and fetch tool UIs
UseMCPAppsClient 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 useMetabindAssistantView, tool rendering is automatic.
For custom UIs, ToolUIContent has two variants:
ToolUIContent.BindJS— render viaBindJSViewfrombindjs-androidToolUIContent.Html— render in a WebView
HomeScreen.kt for the full wiring.
Build a custom chat UI
IfMetabindAssistantView doesn’t fit your design, build your own around MetabindAssistant. Observe assistant.messages, call assistant.send(text), and render tool UIs via assistant.toolUIContent. The demo app’s HomeScreen.kt is a complete reference.
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.