> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metabind.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add a Native AI Assistant to Your iOS App

> Drop-in SwiftUI assistant powered by Claude, GPT, or Gemini. Your tools, your brand, your app — no WebView, no rebuild for layout changes.

The Metabind Assistant SDK is a Swift Package that ships an MCP-aware AI client, conversation state, an LLM provider abstraction, and the native SwiftUI renderer for BindJS. Drop it into your app and you have a fully functional in-product AI assistant — calling your tools, rendering results as real SwiftUI views, governed end-to-end.

<Frame>
  <img src="https://cdn-dev.metabind.ai/ON2i6QYpggXW0BKxzD0n/uvLQYehQp2WcJPP6JcmV/assets/1zeEQbbS6N3pvYoj8dUf/design-card-row%20(2).png" alt="Rendered Interactive Tool components — product detail cards, a purchasable item card with Buy Now, a 3D model viewer chip, and a product-comparison view — all returned by AI tool calls and rendered as native UI." />
</Frame>

<CardGroup cols={2}>
  <Card title="Start free" icon="rocket" href="https://metabind.ai/signup">
    No credit card. Free Assistant SDK. Free tier on the platform.
  </Card>

  <Card title="iOS SDK reference" icon="apple" href="/guides/assistant-sdk/ios-sdk">
    Full install, configuration, and custom-UI documentation.
  </Card>
</CardGroup>

<Note>
  Building for Android? Same SDK shape, Jetpack Compose renderer. Jump to the [Android SDK guide](/guides/assistant-sdk/android-sdk).
</Note>

## Install via Swift Package Manager

In Xcode: **File → Add Package Dependencies** → paste:

```
https://github.com/metabindai/metabind-ai-apple
```

Or in `Package.swift`:

```swift theme={null}
dependencies: [
  .package(url: "https://github.com/metabindai/metabind-ai-apple", from: "0.1.0")
]
```

Requirements: iOS 17+, Xcode 15+, Swift 5.9+.

## Configure with the Agent proxy (recommended)

The Agent proxy holds the LLM key server-side, runs the tool loop, and streams responses back as SSE — your iOS binary never ships a third-party API key.

```swift theme={null}
import MetabindAssistant

let assistant = MetabindAssistant(
  serverURL: URL(string: "https://mcp.metabind.ai/my-org/my-project")!,
  serverHeaders: ["Authorization": "Bearer \(projectToken)"],
  provider: MetabindAgentProvider(
    apiKey: projectToken,
    orgId: "my-org",
    projectId: "my-project"
  )
)
```

The proxy supports **Anthropic, OpenAI, and Google** — selected per-project in MCP App Studio. Switch providers without shipping a new app version.

## Drop in the chat surface

```swift theme={null}
import SwiftUI
import MetabindAssistant

struct AssistantScreen: View {
  let assistant: MetabindAssistant

  var body: some View {
    MetabindAssistantView(assistant: assistant)
      .navigationTitle("Assistant")
  }
}
```

That's a working in-app AI assistant. `MetabindAssistantView` handles user input, message rendering, streaming SSE deltas, and inline native rendering of Interactive Tool output. It respects your app's color scheme, dynamic type, and accessibility settings — because it's SwiftUI, not a WebView.

For a fully custom UI, use the lower-level API on `MetabindAssistant` — `assistant.send(...)`, `assistant.conversation`, `assistant.cancel()`, `assistant.isProcessing`. See [Custom host UI](/guides/assistant-sdk/custom-host-ui).

## What you don't write

| You write                                        | The SDK does                                        |
| ------------------------------------------------ | --------------------------------------------------- |
| Project URL + token from your backend            | MCP connection, auth, retries                       |
| LLM provider config (Agent proxy or BYOK)        | Tool calls, schema validation, conversation state   |
| `MetabindAssistantView` placement (or custom UI) | Streaming, message rendering, tool-result rendering |

* **No tool-calling loop.** In Agent proxy mode the proxy runs it; in BYOK mode the SDK does. Either way, not you.
* **No streaming code.** SSE deltas flow into conversation state and re-render the UI automatically.
* **No native renderer.** Interactive Tool output renders through BindJS without you wiring it up.
* **No schema validation.** Inputs and outputs are validated against the project's tool schemas before they reach the renderer.

## Native rendering, not a WebView

<Frame>
  <img src="https://mintcdn.com/yapstudios/ZJLavl8Q7LnCwqCq/images/diagrams/rendered-card.svg?fit=max&auto=format&n=ZJLavl8Q7LnCwqCq&q=85&s=ac112567bb312cff16e5c23ef858c699" alt="A Metabind ProductCard renders inline in a chat conversation as a real native SwiftUI view — image, title, price, and shop button — not as a WebView." noZoom width="960" height="460" data-path="images/diagrams/rendered-card.svg" />
</Frame>

When the assistant calls one of your Interactive Tools, the result renders as SwiftUI inline in the conversation. A `ProductCard` is a SwiftUI view — it animates with your app's transitions, respects dynamic type, supports VoiceOver, and adopts your color scheme. The renderer is BindJS Swift; there is no JavaScript runtime on iOS, no embedded browser, no app-store release when you change a layout.

The same Interactive Tool definition that renders here renders as Jetpack Compose on Android and React on the web. One BindJS definition. Three native runtimes. Same governance everywhere.

## Your tools. Your brand. Your app.

Most "drop-in AI" SDKs route users to someone else's chat surface, someone else's brand, and someone else's tool ecosystem. The Assistant SDK is the opposite — the AI runs **inside your product**, calling tools **you built in Metabind**, rendered with **your components**, on **your typography and color**. Your users never leave your app. You don't expose them to a third-party host.

## Token and key handling

| Where it lives              | What                                                                                                                           |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Your backend (recommended)  | Mint per-user or per-session Metabind project tokens. The SDK uses them to authenticate to the MCP server and the Agent proxy. |
| Agent proxy, server-side    | The LLM provider key (Anthropic, OpenAI, or Google). Your client never sees it.                                                |
| BYOK direct mode (dev only) | Anthropic API key delivered to the SDK by your auth flow. For production, prefer the Agent proxy.                              |

<Warning>
  Don't hard-code an Anthropic API key in a production iOS app — anyone can extract it from the binary. Use the Agent proxy for production.
</Warning>

## Use the Assistant SDK when

* You're building an iOS, Android, or web product and want an in-product AI assistant.
* You want users to use AI inside *your* app, not be redirected to Claude or ChatGPT.
* You want native UI rendering of tool results — SwiftUI, Compose, React — not WebViews.
* You want Metabind to manage LLM key custody and the tool loop server-side.

A project's tools work in **both** the Assistant SDK and connected MCP hosts at the same time. Ship the SDK in your app, and let power users also connect Claude Desktop to the same project if they want to.

## Two platforms, one model

| Platform | Package                             | Renderer                             |
| -------- | ----------------------------------- | ------------------------------------ |
| iOS      | `metabind-ai-apple` (Swift Package) | SwiftUI via `bindjs-apple`           |
| Android  | `metabind-ai-android` (Maven)       | Jetpack Compose via `bindjs-android` |

Each SDK exposes the same shape — a `MetabindAssistant` configured with a server and an `LLMProvider`, plus a default `MetabindAssistantView` chat surface — adapted to the platform's idioms.

## Ship today

<CardGroup cols={2}>
  <Card title="Start free" icon="rocket" href="https://metabind.ai/signup">
    No credit card. Free Assistant SDK. Free tier on the platform.
  </Card>

  <Card title="iOS SDK reference" icon="apple" href="/guides/assistant-sdk/ios-sdk">
    Full install, configuration, mock mode for previews.
  </Card>

  <Card title="Android SDK" icon="android" href="/guides/assistant-sdk/android-sdk">
    Jetpack Compose renderer, Kotlin install, parity with iOS.
  </Card>

  <Card title="LLM provider configuration" icon="brain" href="/guides/assistant-sdk/llm-provider-configuration">
    Agent proxy vs. BYOK. Anthropic, OpenAI, Google selection.
  </Card>
</CardGroup>
