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:
- 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 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
agentHostandmcpHostconstructor parameters, which default tohttps://agent.metabind.aiandhttps://mcp.metabind.ai.
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.
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>:
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, render each tool call with MetabindToolView, the same renderer MetabindAssistantView uses. It takes a ToolUIContent, which has two variants:
ToolUIContent.BindJS— rendered as Compose throughbindjs-androidToolUIContent.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
IfMetabindAssistantView 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.