- Busymate AI
- Developers
Developers
Give your AI chatbot real tools with MCP
MCP is the open standard for connecting AI to your systems: register your server, choose who may use each tool, switch it on. Ship your mate on web, iOS, Android and desktop, and manage every workspace from any MCP client.
Quick start
Pick how you want to connect. Each sample is complete.
<!-- Floating "mate" launcher for Your product. Anonymous chat works immediately on the allowed origins.
Define getIdentity ABOVE the widget script, on EVERY page that loads the widget.
The one source for sign-in: https://busymate.ai/docs/identity -->
<script>
window.BusymateAI = {
// Busymate gives you the nonce: sign that one, never one of your own.
getIdentity: async ({ nonce }) => {
const r = await fetch("https://YOUR-PRODUCT-DOMAIN/api/bmai/identity", {
method: "POST", credentials: "include", cache: "no-store",
headers: { "content-type": "application/json" },
body: JSON.stringify({ nonce }),
});
if (r.status === 401 || r.status === 403) return null; // signed out -> guest chat
if (!r.ok) throw new Error("AI identity mint failed (" + r.status + ")");
const identity = await r.json();
return { token: identity.token, nonce: identity.nonce }; // new on every call; never cache either value
},
};
// Call after YOUR product completes login, an access-token/session
// rotation, or an account switch — upgrades the live conversation in
// place, same thread. Do not send an identity postMessage directly.
window.assistantIdentityChanged = () =>
window.BusymateAI?.identityChanged?.() ?? Promise.resolve(false);
// Call after YOUR product completes logout. Without this the signed-out
// visitor keeps a verified chat and the previous transcript until the tab
// closes — a privacy defect, not a missing nicety.
window.assistantSignedOut = () =>
window.BusymateAI?.signedOut?.("signed_out");
</script>
<script
src="https://your-assistant.busymate.ai/embed/v1.js"
data-assistant="your-assistant"
data-label="Ask mate"
async></script>claude mcp add --transport http busymate-ai https://busymate.ai/mcpcurl https://busymate.ai/api/v1/conversations \
-H "Authorization: Bearer bmai_sk_..."Add your mate to your website
One script tag on any page you allow — the launcher and guest chat work right away.
Put AI support inside your iOS app
Install the versioned Swift package for account identity, chat and tap-triggered microphone permission.
Put AI support inside your Android app
Install the versioned Android library for account identity, chat and tap-triggered microphone permission.
Connect your MCP server as tools
Your own MCP server becomes your mate's actions, on each customer's behalf.
Manage every workspace from your terminal
Drive the platform from Claude, Claude Code, Cursor or any MCP client over OAuth.
Offer your pages' actions as tools
WebMCP: your pages list their own actions as tools — book, order, check a status — with confirmation built in.
How it fits together
Your app stays the source of truth. Your mate receives a short-lived signed token that says who is present, and calls your tools as a separate, scoped actor.
Your app
Keeps identity and account data; signs a two-minute token that says who is signed in.
Your mate
Applies your workspace's settings: content, models, tool access levels, confirmation steps, handoff.
Your MCP server
Answers tools for one user at a time, taking the user from the signed-in bearer token — never from tool arguments.
7 ways to connect, one mate: Web embed · Signed-in customers · iOS · Android · Desktop · REST API · Your MCP server
Recognize the customer already signed in
So your mate can trust who is asking, one authenticated endpoint on your backend signs a short-lived token (an ES256 JWT) with your stable customer id and a few safe display fields. The token lives at most 120 seconds, carries a one-time nonce and jti, and names your workspace. The private key and your product session never reach the browser or the chat. The one source for sign-in, with every claim and the checker: busymate.ai/docs/identity.
import { SignJWT, importJWK } from "jose";
// POST https://YOUR-PRODUCT-DOMAIN/api/bmai/identity — requires YOUR OWN logged-in product session.
app.post("/api/bmai/identity", requireSession, async (req, res) => {
// Fresh on EVERY mint. Never persist the launch token/nonce in localStorage,
// sessionStorage, cookies, React state, or module state: every chat
// launch consumes this pair exactly once.
const { nonce } = req.body ?? {}; // the nonce Busymate gave the page; sign exactly this one (https://busymate.ai/docs/identity)
if (typeof nonce !== "string" || nonce.length < 16) return res.status(400).json({ error: "invalid_nonce" });
const key = await importJWK(JSON.parse(process.env.AI_LAUNCH_PRIVATE_JWK), "ES256");
const token = await new SignJWT({
tenant_id: process.env.BMAI_TENANT_ID, // the workspace id shown in Console → For developers → Customer sign-in
nonce, // equals the sibling field below
name: req.user.displayName, // optional low-sensitivity display claim
})
.setProtectedHeader({ alg: "ES256", kid: process.env.AI_LAUNCH_KEY_ID })
.setIssuer(process.env.BMAI_ISSUER) // the Issuer you registered in Console → For developers → Customer sign-in
.setAudience("busymate-ai")
.setSubject(req.user.id) // IMMUTABLE internal account id; never email/phone/session id
.setJti(crypto.randomUUID()) // one-time (replay-protected)
.setIssuedAt()
.setExpirationTime("120s") // <= registered max age (120s)
.sign(key);
res.set("Cache-Control", "no-store");
res.status(201).json({ token, nonce, expiresIn: 120 });
});The token says who is there, not what they may do. Keep balances, devices, settings and every change behind tools that answer for one user only.
One script for an embedded launcher
The SDK asks your backend for identity when it needs one, works for guests, refreshes after login and logout, opens external links outside the frame, and needs no third-party cookies.
<!-- Floating "mate" launcher for Your product. Anonymous chat works immediately on the allowed origins.
Define getIdentity ABOVE the widget script, on EVERY page that loads the widget.
The one source for sign-in: https://busymate.ai/docs/identity -->
<script>
window.BusymateAI = {
// Busymate gives you the nonce: sign that one, never one of your own.
getIdentity: async ({ nonce }) => {
const r = await fetch("https://YOUR-PRODUCT-DOMAIN/api/bmai/identity", {
method: "POST", credentials: "include", cache: "no-store",
headers: { "content-type": "application/json" },
body: JSON.stringify({ nonce }),
});
if (r.status === 401 || r.status === 403) return null; // signed out -> guest chat
if (!r.ok) throw new Error("AI identity mint failed (" + r.status + ")");
const identity = await r.json();
return { token: identity.token, nonce: identity.nonce }; // new on every call; never cache either value
},
};
// Call after YOUR product completes login, an access-token/session
// rotation, or an account switch — upgrades the live conversation in
// place, same thread. Do not send an identity postMessage directly.
window.assistantIdentityChanged = () =>
window.BusymateAI?.identityChanged?.() ?? Promise.resolve(false);
// Call after YOUR product completes logout. Without this the signed-out
// visitor keeps a verified chat and the previous transcript until the tab
// closes — a privacy defect, not a missing nicety.
window.assistantSignedOut = () =>
window.BusymateAI?.signedOut?.("signed_out");
</script>
<script
src="https://your-assistant.busymate.ai/embed/v1.js"
data-assistant="your-assistant"
data-label="Ask mate"
async></script>Open the full-page chat at your address
When a signed-in user opens your mate's address or your custom domain, pass the sign-in token in the URL fragment. The page clears it before the exchange.
// Full-page open with identity in the URL FRAGMENT — never sent in the
// request line, referrer, or logs; the destination strips it before exchange.
function newLaunchNonce() {
const bytes = new Uint8Array(32);
crypto.getRandomValues(bytes);
return btoa(String.fromCharCode(...bytes))
.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
}
const nonce = newLaunchNonce();
const accessToken = await getProductAccessToken(); // YOUR existing auth helper
if (!accessToken) throw new Error("Sign in before opening an identified chatbot");
const returnTo = new URL(location.href); returnTo.search = ""; returnTo.hash = "";
const response = await fetch("https://YOUR-PRODUCT-DOMAIN/api/bmai/identity", {
method: "POST", credentials: "include", cache: "no-store",
headers: { "content-type": "application/json", authorization: "Bearer " + accessToken },
body: JSON.stringify({ nonce, returnTo: returnTo.href }),
});
if (response.status === 401) throw new Error("Sign in before opening an identified chatbot");
if (!response.ok) throw new Error("AI identity mint failed (" + response.status + ")");
const identity = await response.json();
if (typeof identity.token !== "string" || typeof identity.nonce !== "string") {
throw new Error("AI identity mint returned an invalid response");
}
if (identity.nonce !== nonce) throw new Error("AI identity nonce mismatch");
const url = new URL("https://your-assistant.busymate.ai/");
url.hash = new URLSearchParams({
bmai_token: identity.token,
bmai_nonce: identity.nonce,
}).toString();
location.assign(url);Install the official iOS SDK
Pin the Swift package version. Connect your authenticated backend and add native microphone permission with the platform guide and example app. iOS installation, configuration and demo
// Swift Package: https://github.com/serebano/busymate-ai-sdk-ios.git (exact 1.0.5)
// Full lifecycle + demo: https://busymate.ai/docs/guides/ios-sdk
import WebKit
import BusymateAI
@MainActor
func installAssistant(
on webView: WKWebView,
account: @escaping () -> String?,
mint: @escaping @MainActor (BusymateBridge.MintRequest) async throws -> BusymateBridge.MintToken?
) {
BusymateBridge.install(on: webView, config: .init(
assistant: "your-assistant",
origins: ["https://your-assistant.busymate.ai"],
account: account,
mint: mint
))
// mint calls YOUR authenticated backend with request.nonce; never cache tokens.
// Backend endpoint: https://YOUR-PRODUCT-DOMAIN/api/bmai/identity
webView.load(URLRequest(url: URL(string: "https://your-assistant.busymate.ai/?channel=ios")!))
}
// Microphone: declare NSMicrophoneUsageDescription; install and retain
// BusymateMicrophone before load, and forward WKUIDelegate media permission.
// Call BusymateBridge.accountChanged() on login/logout/account changes.Install the official Android SDK
Pin the Android library version. Install before loading chat and follow the Activity lifecycle, microphone and renderer recovery guide. Android installation, configuration and demo
// Gradle installation + lifecycle: https://busymate.ai/docs/guides/android-sdk
// Source: https://github.com/serebano/busymate-ai-sdk-android/tree/1.0.5
import android.webkit.WebView
import ai.busymate.bridge.BusymateBridge
fun installAssistant(
webView: WebView,
account: () -> String?,
mint: (Map<String, Any?>, (BusymateBridge.MintResult) -> Unit) -> Unit
) {
BusymateBridge.install(webView, BusymateBridge.Config(
assistant = "your-assistant",
origins = listOf("https://your-assistant.busymate.ai"),
account = account,
mint = mint
))
// mint calls YOUR authenticated backend with request["nonce"], then done(result).
// Backend endpoint: https://YOUR-PRODUCT-DOMAIN/api/bmai/identity
webView.loadUrl("https://your-assistant.busymate.ai/?channel=android")
}
// Microphone: declare INTERNET + RECORD_AUDIO; construct and retain
// BusymateMicrophone in Activity.onCreate BEFORE STARTED/loadUrl; forward
// WebChromeClient.onPermissionRequest. See the guide for renderer recovery.
// Call BusymateBridge.accountChanged() on login/logout/account changes.Install the official desktop SDKs
Official SDKs for macOS, Windows, Electron, Linux and Tauri load hosted chat in an isolated WebView, answer identity requests through the privileged host layer and open safe URLs externally. Pin the SDK version and connect your authenticated backend as on mobile. Desktop installation, configuration and example apps
// Official desktop SDK for your platform — macOS, Windows, Electron, Linux or Tauri:
// https://github.com/serebano/busymate-ai-sdk-electron (and -macos, -windows, -linux, -tauri).
// Every SDK takes these settings and installs the identity bridge before the first load.
const chatOptions = {
url: "https://your-assistant.busymate.ai/?channel=desktop_sdk", // the window's top-level page
assistant: "your-assistant",
account: () => productAuth.currentUserId(), // null when signed out
// YOUR authenticated backend signs { token, nonce } for request.nonce.
mint: (request) => productAuth.mintAssistantIdentity(request),
};Give your mate tools without giving it your customer database
List complete schemas at discovery. Give every tool one of three access levels, mark the changes that need a confirmation card, and re-check authorization on every call.
Public
Anyone chatting may call it. Prices, status, features.
Signed-in customers (identified)
Needs a signed-in user. Order status, account answers.
On the customer's behalf (delegated)
Acts on the signed-in user's behalf through a scoped actor token or the user's own OAuth grant.
Every change is confirmed on the server. Tools you list in confirm_tools stop at a confirmation card before they run; so does any tool name your mate does not recognize. Widget frames never run a change.
MCP endpoint ............ https://YOUR-DOMAIN/mcp
RFC 8707 resource ....... https://YOUR-DOMAIN/mcp (the token is audience-bound to this)
AS metadata (RFC 8414) .. https://YOUR-DOMAIN/.well-known/oauth-authorization-server
Resource meta (RFC 9728) https://YOUR-DOMAIN/.well-known/oauth-protected-resource
Client registration ..... Dynamic (RFC 7591) — public client, no secret
PKCE .................... S256 required (RFC 7636)
Authorization response .. iss parameter checked (RFC 9207)
Grants .................. authorization_code + refresh_token
Delegated tools/call .... no bearer -> 401; user derived from the bearer,
NEVER from an account id in tool arguments
Customer experience ..... the Authorize account tools card, once per customer; none for your own
product's connector with Ask customers OFF (actor token; a 401 -> card)// POST https://YOUR-DOMAIN/mcp
// Authorization: Bearer <the per-user OAuth token mate obtained>
{
"jsonrpc": "2.0",
"id": 12,
"method": "tools/call",
"params": { "name": "get_my_account", "arguments": {} }
}
// Your server verifies the bearer, derives the user from its signed subject,
// and returns ONLY that user's data.What the platform speaks
The same protocol set applies whether the platform is the client to your server or the server for your MCP client.
- OAuth 2.1 with PKCE (S256); public clients register dynamically (RFC 7591).
- Discovery through authorization-server metadata (RFC 8414) and protected-resource metadata (RFC 9728).
- Grants: authorization_code and refresh_token; the authorization response carries the issuer (RFC 9207).
- Resource indicators (RFC 8707) when the platform is the OAuth client to your MCP server.
- Token exchange (RFC 8693) where configured.
Read, reply, and get notified — over REST
One workspace-scoped API key authenticates the REST endpoints and the MCP server alike; API keys and webhooks come with the Growth plan and up. List and read conversations, post a reply from your team, or subscribe to a webhook instead of polling.
List your conversations
Create a key in Console → For developers → Developer keys, then send it as a Bearer token.
curl https://busymate.ai/api/v1/conversations \
-H "Authorization: Bearer bmai_sk_..."Delivery headers
X-Busymate-Timestamp- unix seconds the delivery was sent
X-Busymate-Signature- the timestamp and an HMAC-SHA256 signature over timestamp-plus-body
X-Busymate-Delivery- a stable id — use it as an idempotency key, delivery is at-least-once
Full reference: the API guide, the webhooks guide, the OpenAPI document.
When it hands off
A customer asks for a person, a tool fails, a refund is above your limit, a keyword appears, or any event you define.
How your team is told
One Inbox; assignment by hand, in turns or to whoever has the fewest open chats; alerts in the app, by Web Push, APNs and personal Telegram.
Your team takes over
Watch the conversation, join with the context, reply in the same chat; your mate makes no changes while a person is active.
Insights
Repeat questions, missing knowledge and failed paths, grouped from real conversations with links to the evidence.
Keep your own user base and authentication
Configure the workspace login and account URLs in the Console. A guest who chooses Sign in leaves the frame, authenticates on your product, and returns to the exact originating URL. Your backend then supplies a one-time sign-in token; Busymate AI never receives the user's password or your signing key.
A change only ever touches the signed-in user's own data. Account tools take the customer from the delegated actor, re-check authorization on every call, and ask for confirmation on the changes you configure.
Set up branding, SEO, your web address and suggested questions.
Register your sign-in: issuer, JWKS, audience, claims and token age.
Connect MCP, set each tool's access level, prove that reads are self-scoped and writes are confirmed.
Set the handoff rules, staff the Inbox, set hours and response targets.
Test guests, signed-in users, logout and account switch, replayed tokens, and a swapped workspace id.
Check the full-page chat, the embed, iOS, Android, desktop, accessibility and external links.
Go live only with the version you checked; watch connection and domain health.
Let assistants use your site, not just read it
WebMCP is the W3C Web Machine Learning Community Group's draft for pages that list their own actions as tools. Three ways in, from the smallest change to the fullest control.
Name the action with a verb
book_appointment, check_order_status, start_return — one tool, one job.
Take values people say
“next Tuesday at ten”, “Express” — never an internal id your mate has to guess.
Register with the page
Offer the tools this page can run; unregister them when the page moves on.
Mark what has consequences
A booking, a payment, a return: flag it, and the customer confirms before it runs.
Confirmation stays with the customer. Tools run in the visitor's own browser, on your origin. A tool you mark as consequential stops at a confirmation the customer sees; exposedTo limits which origins may see a tool at all.
The smallest change: a name and a one-line description on a form you already have. The browser turns it into a tool; the form stays visible and keeps working for everyone.
<form action="/book" toolname="book_appointment"
tooldescription="Book an appointment for a date, a time and a service."
toolautosubmit>
<input name="date" type="date" toolparamdescription="The day, e.g. next Tuesday">
<input name="time" type="time" toolparamdescription="The start time">
<select name="service" toolparamdescription="Which service to book">
<option>Consultation</option>
<option>Follow-up</option>
</select>
<button type="submit">Book</button>
</form>Full control: the browser API. Feature-detect it — browsers without WebMCP simply get the page as it is today. Chrome 149 and Edge 150 carry it as an origin trial; Firefox and Safari are reviewing the proposal.
// The browser API (draft). Load the polyfill BEFORE this file so every browser has it
// (it stands down where the browser is native):
// <script src="https://busymate.ai/webmcp/polyfill-1.0.1.js" integrity="sha384-pLZ5lO3gwZIn8Nim+hDrUQY+bvpliRtZhrS1O1OGRFB3lvoW0sZ71DUFHIk3m+DG" crossorigin="anonymous"></script>
const ctx = document.modelContext ?? navigator.modelContext;
if (!ctx) throw new Error("no WebMCP registry: the polyfill did not load");
ctx?.registerTool({
name: "start_return",
description: "Start a return for a delivered order. Asks the customer to confirm first.",
inputSchema: { type: "object", properties: { orderNumber: { type: "string", description: "The order number, as printed on the receipt" } }, required: ["orderNumber"] },
annotations: { consequentialHint: true },
execute: async ({ orderNumber }) => startReturn(orderNumber),
}, { exposedTo: ["self"] });Where your mate is already installed, one call lists your tools for it and for every other AI agent that visits — on the browser API where it exists, and over your mate's own bridge everywhere else.
// One call, both transports: the browser's own WebMCP where it exists,
// and the SDK bridge everywhere else (Safari, Firefox, app WebViews).
BusymateAI.registerPageTools([
{
name: "check_order_status",
description: "Look up an order by its number and say where it is.",
inputSchema: {
type: "object",
properties: { orderNumber: { type: "string", description: "The order number, as printed on the receipt" } },
required: ["orderNumber"],
additionalProperties: false,
},
annotations: { readOnlyHint: true },
execute: async ({ orderNumber }) => (await fetch(`/api/orders/${orderNumber}`)).json(),
},
]);Manage every workspace from any MCP client
Management tools over MCP with OAuth 2.1. The client opens a browser sign-in on first connection; nothing is pasted.
https://busymate.ai/mcp| Client | How it connects |
|---|---|
| Claude | Add the connector from Claude's connector directory and sign in — nothing to paste. |
| ChatGPT and Codex | Planned: the app is not listed in OpenAI's directory yet. |
| Claude Code (CLI) | Run the command below — the browser handles OAuth sign-in. |
| Cursor | Paste the mcp.json entry below into Cursor's MCP settings. |
| Other MCP clients | Give the client the endpoint above; OAuth 2.1 discovery + PKCE handle the rest. |
Discovery documents
- Authorization-server metadata (RFC 8414)
- https://busymate.ai/.well-known/oauth-authorization-server/mcp
- Protected-resource metadata (RFC 9728)
- https://busymate.ai/.well-known/oauth-protected-resource/mcp
The account you sign in with decides which workspaces the client may manage. Every change asks for confirmation.
Claude Code
claude mcp add --transport http busymate-ai https://busymate.ai/mcpManage the platform from any MCP client
Cursor, Claude Desktop and any client that reads an mcp.json accept this entry; clients that take a remote URL take the endpoint above.
{
"mcpServers": {
"busymate-ai": {
"type": "http",
"url": "https://busymate.ai/mcp"
}
}
}- LinkPlatformSecurity hardening for signed-in actions.
- LinkInboxIn the Inbox, Ask your mate now answers how to connect any channel or source with its real steps and link, or says it is not available yet. A hidden password or key in the Inbox now stays on our servers until someone with access chooses to see it.
- LinkChatIn the mobile apps, taking over an AI chat works for every chat, and Resolve tells you to take it over first instead of saying Busymate AI isn't responding.