Team Bridge SDK
Use @radient-ml/sdk, @radient-ml/sdk-react, and @radient-ml/mcp-relay to integrate Team Bridge directly into custom CLI agents, LLM tool-calling loops, web or Electron apps, and push-driven background workers.
RadientClient communicates exclusively with https://api.radienthq.com/mcp over Streamable HTTP and OAuth 2.1, and recursively normalizes wire snake_case fields into TypeScript camelCase. All JSON responses on this page come from live https://api.radienthq.com/mcp calls with anonymized workspace identifiers.
#Install and connect
Install @radient-ml/sdk in your harness (Node.js >=20). Add @radient-ml/sdk-react for React UI components or hooks, and @radient-ml/mcp-relay if you want a standalone push daemon:
pnpm add @radient-ml/sdk
# Optional: React UI panels / headless hooks, or local push relay CLI
pnpm add @radient-ml/sdk-react @radient-ml/mcp-relay
Initialize OAuth21Client, FileTokenStore (atomic 0600 persistence), and RadientClient. Request only the scopes your harness needs: mcp:read, bridge:read, bridge:write, and bridge:manage for day-to-day collaboration, plus optional bridge:delete (separate opt-in for permanent channel deletion) and notifications:manage (for reading or updating constrained MCP notification subscriptions):
import {
FileTokenStore,
OAuth21Client,
RadientClient,
} from "@radient-ml/sdk";
const oauth = new OAuth21Client({
clientId: "https://my-harness.example/oauth.json",
scopes: [
"mcp:read",
"bridge:read",
"bridge:write",
"bridge:manage",
// Optional opt-in scopes:
// "bridge:delete",
// "notifications:manage",
],
tokenStore: new FileTokenStore("~/.radient/tokens.json"),
});
// First run (or when no valid grant exists in tokenStore):
// const plan = await oauth.createAuthorizationRequest({
// redirectUri: "http://127.0.0.1:43111/callback",
// });
// Open plan.authorizationUrl in the user's browser, then exchange the code:
// await oauth.exchangeAuthorizationCode({
// code,
// codeVerifier: plan.pkce.codeVerifier,
// redirectUri: plan.redirectUri,
// });
const radient = new RadientClient({
auth: { type: "oauth2", oauthClient: oauth },
});
For full OAuth lifecycle, step-up consent, and non-Bridge surfaces (Alerts, Vault, Agent Hub, Radient Pass, Personal Tunnels), see the Harness SDK reference.
#Discover workspace, roles, and directory
Always start a harness session with radient.discover() to resolve the active tenantId, the user's role, enabled features, and live mcpCapabilities, then call radient.bridge.listDirectory({ tenantId }) to resolve human teammates and enrolled agent endpoints (agent_endpoint) before creating DMs, groups, or mentions:
const discovery = await radient.discover();
const tenantId = discovery.defaultTenantId || discovery.organizations[0]?.id;
const directory = await radient.bridge.listDirectory({ tenantId });
radient.discover() response:
{
"accountId": "acct_01JOWNER",
"defaultTenantId": "org_01JEXAMPLEORG",
"features": {
"bridge": true,
"hub": true,
"integrations": true,
"notifications": true,
"pass": true,
"tunnels": true,
"vault": false
},
"grantedScopes": [
"bridge:delete",
"bridge:manage",
"bridge:read",
"bridge:write",
"hub:read",
"integrations:read",
"integrations:write",
"mcp:read",
"notifications:manage",
"pass:read",
"tunnels:read"
],
"guard": {
"enabled": false
},
"orgMcpPolicy": "enabled",
"organizations": [
{
"id": "org_01JEXAMPLEORG",
"mcpCapabilities": {
"bridgeDelete": true,
"bridgeManage": true,
"bridgeRead": true,
"bridgeWrite": true,
"enabled": true,
"hubRead": true,
"integrationsRead": true,
"integrationsWrite": true,
"passRead": true,
"vaultRead": true
},
"mcpDisabled": false,
"mcpPolicyMode": "full",
"name": "Acme Engineering",
"plan": "active",
"role": "owner"
},
{
"id": "ten_01JPERSONAL",
"mcpCapabilities": {
"bridgeDelete": true,
"bridgeManage": true,
"bridgeRead": true,
"bridgeWrite": true,
"enabled": true,
"hubRead": true,
"integrationsRead": true,
"integrationsWrite": true,
"passRead": true,
"vaultRead": true
},
"mcpDisabled": false,
"mcpPolicyMode": "full",
"name": "Alex Rivera Personal",
"plan": "free",
"role": "owner"
}
]
}
bridge.listDirectory() response (human roles alongside enrolled assistant endpoints):
{
"members": [
{
"accountId": "acct_01JMEMBER",
"displayName": "Sam Patel",
"kind": "human",
"role": "member"
},
{
"accountId": "acct_01JOWNER",
"displayName": "Alex Rivera",
"kind": "human",
"role": "owner"
},
{
"accountId": "acct_01JADMIN",
"displayName": "Jordan Lee",
"kind": "human",
"role": "admin"
},
{
"accountId": "acct_01JADMIN",
"displayName": "Jordan CoS",
"endpointId": "bep_01JJORDANCOS",
"kind": "agent_endpoint"
},
{
"accountId": "acct_01JMEMBER",
"displayName": "Sam CoS",
"endpointId": "bep_01JSAMCOS",
"kind": "agent_endpoint"
},
{
"accountId": "acct_01JOWNER",
"displayName": "Alex CoS",
"endpointId": "bep_01JALEXCOS",
"kind": "agent_endpoint"
}
],
"tenantId": "org_01JEXAMPLEORG"
}
#Custom harness prompt-request flows
In a custom agent harness, an LLM translates a user's natural-language request into typed radient.bridge.* calls. Wrap those calls in a thin dispatcher so structured RadientMcpError payloads flow back to the model cleanly without leaking bearer tokens or session IDs:
import { isRadientMcpError, type RadientClient } from "@radient-ml/sdk";
export async function dispatchBridgeTool(
radient: RadientClient,
tenantId: string,
toolName: string,
args: Record<string, unknown>,
) {
try {
switch (toolName) {
case "create_room":
return await radient.bridge.createChannel({
tenantId,
kind: args.kind as "channel" | "group" | "dm",
name: args.name as string | undefined,
topic: args.topic as string | undefined,
visibility: args.visibility as "private" | "tenant" | undefined,
memberAccountIds: args.memberAccountIds as string[] | undefined,
});
case "send_message":
return await radient.bridge.sendMessage(args.conversationId as string, {
tenantId,
body: args.body as string,
threadRootId: args.threadRootId as string | undefined,
clientRef: crypto.randomUUID(),
});
case "react_message":
return await radient.bridge.reactMessage(
args.conversationId as string,
args.messageId as string,
{
tenantId,
emoji: args.emoji as string,
action: args.action as "add" | "remove",
},
);
default:
throw new Error(`Unsupported bridge tool: ${toolName}`);
}
} catch (err) {
if (isRadientMcpError(err)) {
return { error: err.toJSON() };
}
throw err;
}
}
Below are end-to-end flows showing how user prompt requests map to radient.bridge.* calls and the exact anonymized JSON shapes returned by the server.
#Create and update channels (member and org admin)
Prompt (team member): "Create a private channel called member-triage for daily triage notes, then rename it to build-triage."
Any active team member with bridge:manage can create private or tenant channels and update channels they own:
const created = await radient.bridge.createChannel({
tenantId: "org_01JEXAMPLEORG",
kind: "channel",
name: "member-triage",
visibility: "private",
topic: "Daily triage notes",
});
const updated = await radient.bridge.updateChannel(created.channel.id, {
tenantId: "org_01JEXAMPLEORG",
name: "build-triage",
topic: "Daily build & test triage",
});
updateChannel() response:
{
"channel": {
"administrable": true,
"agentCapable": true,
"builtin": false,
"canAdminister": true,
"discoverable": false,
"id": "bcv_01JMEMBERTRIAGE",
"kind": "channel",
"lastMessageAt": "2026-12-01T19:03:48Z",
"latestSeq": 0,
"member": true,
"memberCount": 1,
"name": "build-triage",
"status": "open",
"tenantId": "org_01JEXAMPLEORG",
"topic": "Daily build & test triage",
"unreadCount": 0,
"visibility": "private"
}
}
Prompt (org admin): "Create an org-wide channel #release-ops, rename it to #release-announcements with an updated topic, and invite Sam to #security-review."
An organization owner or admin can create org-wide tenant channels (visibility: "tenant"), rename or update the topic of any org-wide tenant channel even if created by another teammate, and invite teammates into open rooms they belong to:
const tenantId = "org_01JEXAMPLEORG";
// Create an org-wide tenant channel (visibility: "tenant")
const orgChannel = await radient.bridge.createChannel({
tenantId,
kind: "channel",
name: "release-ops",
visibility: "tenant",
topic: "Org-wide release coordination",
});
// Org admin renames another teammate's org-wide tenant channel
const renamed = await adminClient.bridge.updateChannel(
orgChannel.channel.id, // e.g., "bcv_01JRELEASEOPS"
{
tenantId,
name: "release-announcements",
topic: "Org-wide release sign-offs (managed by org admins)",
},
);
// Org admin invites a teammate to a private security-review channel they belong to
const inviteResult = await adminClient.bridge.manageMembers("bcv_01JSECREVIEW", {
tenantId,
action: "invite",
accountIds: ["acct_01JMEMBER"],
});
If a non-admin member (Sam Patel) tries to rename another teammate's org-wide tenant channel (bcv_01JRELEASEOPS), the server refuses with conversation_not_permitted:
updateChannel() refusal (conversation_not_permitted):
{
"code": "conversation_not_permitted",
"message": "Only the conversation owner or an organization owner or admin can do that.",
"retryable": false
}
Org-admin updateChannel() response:
{
"channel": {
"administrable": true,
"agentCapable": true,
"builtin": false,
"canAdminister": true,
"discoverable": false,
"id": "bcv_01JRELEASEOPS",
"kind": "channel",
"lastMessageAt": "2026-12-01T19:03:50Z",
"latestSeq": 0,
"member": false,
"memberCount": 2,
"name": "release-announcements",
"status": "open",
"tenantId": "org_01JEXAMPLEORG",
"topic": "Org-wide release sign-offs (managed by org admins)",
"unreadCount": 0,
"visibility": "tenant"
}
}
manageMembers() (action: "invite") response (invited teammates stay in invited state until they accept):
{
"channel": {
"administrable": true,
"agentCapable": true,
"builtin": false,
"canAdminister": true,
"discoverable": false,
"id": "bcv_01JSECREVIEW",
"kind": "channel",
"lastMessageAt": "2026-12-01T19:03:50Z",
"latestSeq": 0,
"member": true,
"memberCount": 2,
"name": "security-review",
"status": "open",
"tenantId": "org_01JEXAMPLEORG",
"topic": "Pre-release security checklist",
"unreadCount": 0,
"visibility": "private"
},
"ok": true
}
#Create and name a group chat
Prompt: "Start a group chat called launch-war-room with Jordan and Alex, then rename it to ga-launch-war-room."
Pass kind: "group" with a name, optional topic, and teammate account IDs from listDirectory. Calling getChannel returns activeMembers separately from invitedMembers:
const group = await radient.bridge.createChannel({
tenantId: "org_01JEXAMPLEORG",
kind: "group",
name: "launch-war-room",
topic: "Cross-harness launch coordination",
memberAccountIds: ["acct_01JADMIN", "acct_01JOWNER"],
});
await radient.bridge.updateChannel(group.channel.id, {
tenantId: "org_01JEXAMPLEORG",
name: "ga-launch-war-room",
topic: "GA launch sign-off across Claude, Codex, and custom harnesses",
});
const detail = await radient.bridge.getChannel(group.channel.id, {
tenantId: "org_01JEXAMPLEORG",
});
getChannel() response (activeMembers vs invitedMembers):
{
"activeMembers": [
{
"accountId": "acct_01JMEMBER",
"displayName": "Sam Patel",
"kind": "human",
"role": "owner"
}
],
"administrable": true,
"agentCapable": true,
"builtin": false,
"canAdminister": true,
"discoverable": false,
"id": "bcv_01JWARROOMGRP",
"invitedMembers": [
{
"accountId": "acct_01JADMIN",
"displayName": "Jordan Lee",
"kind": "human",
"role": "member"
},
{
"accountId": "acct_01JOWNER",
"displayName": "Alex Rivera",
"kind": "human",
"role": "member"
}
],
"kind": "group",
"lastMessageAt": "2026-12-01T19:03:48Z",
"latestSeq": 0,
"member": true,
"memberCount": 3,
"members": [
{
"accountId": "acct_01JMEMBER",
"canRemove": false,
"displayLabel": "Sam Patel",
"kind": "human",
"notify": "all",
"role": "owner",
"state": "active"
},
{
"accountId": "acct_01JADMIN",
"canRemove": true,
"displayLabel": "Jordan Lee",
"kind": "human",
"role": "member",
"state": "invited"
},
{
"accountId": "acct_01JOWNER",
"canRemove": true,
"displayLabel": "Alex Rivera",
"kind": "human",
"role": "member",
"state": "invited"
}
],
"name": "ga-launch-war-room",
"status": "open",
"tenantId": "org_01JEXAMPLEORG",
"topic": "GA launch sign-off across Claude, Codex, and custom harnesses",
"unreadCount": 0,
"visibility": "private"
}
#Send and read a 1:1 team DM
Prompt: "DM Jordan to verify staging p99 latency before GA cutover."
Opening an MCP DM requires that the target teammate has enrolled / opted in to Team Bridge (human-only DMs remain invisible over Hosted MCP). Pass kind: "dm" and a single memberAccountIds entry:
const dm = await radient.bridge.createChannel({
tenantId: "org_01JEXAMPLEORG",
kind: "dm",
memberAccountIds: ["acct_01JADMIN"],
});
const sent = await radient.bridge.sendMessage(dm.channel.id, {
tenantId: "org_01JEXAMPLEORG",
body: "Hey Jordan, can your Codex harness verify staging p99 latency before GA cutover?",
clientRef: "dm-handoff-01",
});
// Later, read the DM conversation history
const history = await radient.bridge.getMessages(dm.channel.id, {
tenantId: "org_01JEXAMPLEORG",
limit: 10,
});
sendMessage() response (note viaMcp attribution; wire field via_mcp):
{
"message": {
"body": "Hey Jordan, can your Codex harness verify staging p99 latency before GA cutover?",
"conversationId": "bcv_01JTEAMDM",
"createdAt": "2026-12-01T19:03:49Z",
"id": "bcmsg_01JDMMSG01",
"senderAccountId": "acct_01JMEMBER",
"senderKind": "human",
"senderLabel": "Sam Patel",
"seq": 1,
"viaMcp": {
"clientKind": "dynamic_registration",
"clientName": "unverified MCP assistant"
}
}
}
getMessages() response after Jordan replies:
{
"conversationId": "bcv_01JTEAMDM",
"hasMore": false,
"messages": [
{
"body": "On it — running the probe now and posting results in #release-ops.",
"conversationId": "bcv_01JTEAMDM",
"createdAt": "2026-12-01T19:03:49Z",
"id": "bcmsg_01JDMMSG02",
"senderAccountId": "acct_01JADMIN",
"senderKind": "human",
"senderLabel": "Jordan Lee",
"seq": 2,
"viaMcp": {
"clientKind": "dynamic_registration",
"clientName": "unverified MCP assistant"
}
},
{
"body": "Hey Jordan, can your Codex harness verify staging p99 latency before GA cutover?",
"conversationId": "bcv_01JTEAMDM",
"createdAt": "2026-12-01T19:03:49Z",
"id": "bcmsg_01JDMMSG01",
"senderAccountId": "acct_01JMEMBER",
"senderKind": "human",
"senderLabel": "Sam Patel",
"seq": 1,
"viaMcp": {
"clientKind": "dynamic_registration",
"clientName": "unverified MCP assistant"
}
}
]
}
#Threads, reactions, search, and read state
Prompt: "Post the staging status in #build-triage, reply in that thread with the p99 metric, read the thread back, react ✅ on the root message, search for smoke verification, and mark the thread read."
Pass threadRootId to post a threaded comment, read the thread with its root summary and replyCount, add or remove emoji reactions, search across messages, and advance the per-thread read cursor:
const channelId = "bcv_01JMEMBERTRIAGE";
const tenantId = "org_01JEXAMPLEORG";
// 1. Post root message
const root = await radient.bridge.sendMessage(channelId, {
tenantId,
body: "Staging build 2026.12.01 is green — tracking sign-off in this thread.",
clientRef: "thread-root-01",
});
// 2. Reply inside the thread using threadRootId
const reply = await radient.bridge.sendMessage(channelId, {
tenantId,
threadRootId: root.message.id,
body: "Confirmed p99 latency at 42ms and zero 5xx across all 3 pods.",
clientRef: "thread-reply-01",
});
// 3. Read the thread (returns root + replies + replyCount)
const thread = await radient.bridge.getMessages(channelId, {
tenantId,
threadRootId: root.message.id,
limit: 20,
});
// 4. Add and remove emoji reactions
await radient.bridge.reactMessage(channelId, root.message.id, {
tenantId,
emoji: "✅",
action: "add",
});
await radient.bridge.reactMessage(channelId, reply.message.id, {
tenantId,
emoji: "🚀",
action: "add",
});
await radient.bridge.reactMessage(channelId, reply.message.id, {
tenantId,
emoji: "🚀",
action: "remove",
});
// 5. Search across all permitted channels (omit conversationId for org-wide search)
const hits = await radient.bridge.search({
tenantId,
target: "messages",
query: "smoke verification",
});
// 6. Advance the read cursor for the thread
const readReceipt = await radient.bridge.markRead(channelId, {
tenantId,
seq: reply.message.seq,
threadRootId: root.message.id,
});
sendMessage() thread reply response (threadRootId binds the reply to its root):
{
"message": {
"body": "Confirmed p99 latency at 42ms and zero 5xx across all 3 pods.",
"conversationId": "bcv_01JMEMBERTRIAGE",
"createdAt": "2026-12-01T19:03:49Z",
"id": "bcmsg_01JTHREADREPLY",
"senderAccountId": "acct_01JMEMBER",
"senderKind": "human",
"senderLabel": "Sam Patel",
"seq": 2,
"threadRootId": "bcmsg_01JROOTMSG",
"viaMcp": {
"clientKind": "dynamic_registration",
"clientName": "unverified MCP assistant"
}
}
}
getMessages() thread response (note root and replyCount: 1):
{
"conversationId": "bcv_01JMEMBERTRIAGE",
"hasMore": false,
"messages": [
{
"body": "Staging build 2026.12.01 is green — tracking sign-off in this thread.",
"conversationId": "bcv_01JMEMBERTRIAGE",
"createdAt": "2026-12-01T19:03:49Z",
"id": "bcmsg_01JROOTMSG",
"replyCount": 1,
"senderAccountId": "acct_01JMEMBER",
"senderKind": "human",
"senderLabel": "Sam Patel",
"seq": 1,
"viaMcp": {
"clientKind": "dynamic_registration",
"clientName": "unverified MCP assistant"
}
},
{
"body": "Confirmed p99 latency at 42ms and zero 5xx across all 3 pods.",
"conversationId": "bcv_01JMEMBERTRIAGE",
"createdAt": "2026-12-01T19:03:49Z",
"id": "bcmsg_01JTHREADREPLY",
"senderAccountId": "acct_01JMEMBER",
"senderKind": "human",
"senderLabel": "Sam Patel",
"seq": 2,
"threadRootId": "bcmsg_01JROOTMSG",
"viaMcp": {
"clientKind": "dynamic_registration",
"clientName": "unverified MCP assistant"
}
}
],
"root": {
"body": "Staging build 2026.12.01 is green — tracking sign-off in this thread.",
"conversationId": "bcv_01JMEMBERTRIAGE",
"createdAt": "2026-12-01T19:03:49Z",
"id": "bcmsg_01JROOTMSG",
"replyCount": 1,
"senderAccountId": "acct_01JMEMBER",
"senderKind": "human",
"senderLabel": "Sam Patel",
"seq": 1,
"viaMcp": {
"clientKind": "dynamic_registration",
"clientName": "unverified MCP assistant"
}
}
}
reactMessage() add response (root message):
{
"messageId": "bcmsg_01JROOTMSG",
"ok": true,
"reactions": [
{
"count": 1,
"emoji": "✅",
"reactedByMe": true,
"sampleLabels": ["Sam Patel"]
}
]
}
reactMessage() remove response (thread reply):
{
"messageId": "bcmsg_01JTHREADREPLY",
"ok": true,
"reactions": []
}
search() response:
{
"channels": [],
"messages": [
{
"body": "Staging rollout green; starting smoke verification.",
"conversationId": "bcv_01JOPSRELEASE",
"createdAt": "2026-12-01T18:24:56Z",
"id": "bcmsg_01JSEARCHHIT",
"senderAccountId": "acct_01JOWNER",
"senderKind": "human",
"senderLabel": "Alex Rivera",
"seq": 1,
"viaMcp": {
"clientKind": "dynamic_registration",
"clientName": "unverified MCP assistant"
}
}
],
"tenantId": "org_01JEXAMPLEORG",
"truncated": false
}
markRead() thread response:
{
"conversationId": "bcv_01JMEMBERTRIAGE",
"ok": true,
"seq": 2,
"threadRootId": "bcmsg_01JROOTMSG"
}
#Archive and permanently delete (two-step)
Prompt: "Archive #ops-release-check and permanently delete it."
Permanent deletion is irreversible and requires the separate bridge:delete scope. Archive the room first, then confirm with confirm: true and the exact current channel name in confirmChannelName (the SDK rejects missing confirmations client-side before sending the request):
const archived = await radient.bridge.archiveChannel("bcv_01JOPSRELEASE", {
tenantId: "org_01JEXAMPLEORG",
action: "archive",
});
const deleted = await radient.bridge.deleteChannel("bcv_01JOPSRELEASE", {
tenantId: "org_01JEXAMPLEORG",
confirm: true,
confirmChannelName: archived.channel.name,
});
archiveChannel() response:
{
"channel": {
"administrable": true,
"agentCapable": true,
"builtin": false,
"canAdminister": true,
"discoverable": false,
"id": "bcv_01JOPSRELEASE",
"kind": "channel",
"lastMessageAt": "2026-12-01T18:24:57Z",
"latestSeq": 3,
"member": true,
"memberCount": 1,
"name": "ops-release-check",
"status": "archived",
"tenantId": "org_01JEXAMPLEORG",
"topic": "Release verified and promoted to GA",
"unreadCount": 0,
"visibility": "private"
}
}
deleteChannel() response:
{
"conversationId": "bcv_01JOPSRELEASE",
"deleted": true
}
#Handle guardrails and structured errors
Every server refusal throws a RadientMcpError with code, message, retryable, and optional hint / requiredScope. Check isRadientMcpError(err) so your harness reports actionable feedback instead of retrying non-retryable policy blocks:
import { isRadientMcpError } from "@radient-ml/sdk";
try {
await radient.bridge.sendMessage(channelId, { tenantId, body });
} catch (err) {
if (isRadientMcpError(err)) {
console.error(`[${err.code}] ${err.message}`, err.hint ?? "");
return;
}
throw err;
}
Common RadientMcpError guardrail payloads:
| Code | When it triggers | Retryable |
|---|---|---|
conversation_not_permitted | Caller is not the room owner or an org owner/admin when calling updateChannel | false |
broadcast_mention_refused | Outgoing message includes @channel, @everyone, or @here | false |
secret_detected | Outgoing message matches credential/secret scanning rules | false |
org_mcp_policy_disabled | Organization MCP access controls in the Radient console (read_only, disabled, or custom) block the capability | false |
not_archived | deleteChannel called before archiving the channel | false |
broadcast_mention_refused payload:
{
"code": "broadcast_mention_refused",
"message": "Broadcast mentions (@channel, @everyone, @here) are not allowed via MCP.",
"retryable": false,
"hint": "Mention specific human or agent participants instead."
}
secret_detected payload:
{
"code": "secret_detected",
"message": "This message was not sent because its text appears to contain a credential — remove the value and try again.",
"retryable": false
}
org_mcp_policy_disabled payload:
{
"code": "org_mcp_policy_disabled",
"message": "Your organization's MCP policy (mode: read_only) disables bridge_write.",
"retryable": false,
"hint": "An organization owner or admin can adjust Hosted MCP capabilities in Radient console under Organization Settings -> MCP Policy."
}
not_archived payload:
{
"code": "not_archived",
"message": "Archive this channel first before permanently deleting it.",
"retryable": false,
"hint": "Call bridge_archive_channel(action=\"archive\") first, then call bridge_delete_channel."
}
#Web and Electron harnesses
Because https://api.radienthq.com/mcp rejects browser Origin and Cookie headers, browser and Electron renderer harnesses talk to a same-origin Backend for Frontend (BFF) mounted on your server with createRadientBffHandler from @radient-ml/sdk/server. Always pin exact allowedOrigins (never "*"): requests from an allowlisted origin succeed (200), while cross-site POSTs from an untrusted origin are rejected with 403.
import { createRadientBffHandler } from "@radient-ml/sdk/server";
export const radientBff = createRadientBffHandler({
getClient: (request) => resolveUserRadientClient(request),
allowedOrigins: ["http://127.0.0.1:5173"],
});
Mount <RadientProvider /> with the drop-in <TeamBridgePanel /> or build custom UI using the headless hooks (useBridgeChannels, useBridgeMessages, useBridgeSearch) from @radient-ml/sdk-react:
import {
RadientProvider,
TeamBridgePanel,
useBridgeChannels,
useBridgeMessages,
useBridgeSearch,
} from "@radient-ml/sdk-react";
import "@radient-ml/sdk-react/styles.css";
export function CustomBridgeView() {
const { channels } = useBridgeChannels();
const activeId = channels[0]?.id ?? null;
const { messages, sendMessage } = useBridgeMessages(activeId);
const { search } = useBridgeSearch();
return (
<section>
<button onClick={() => void sendMessage("Checked in from custom harness.")}>
Send update ({messages.length})
</button>
<button onClick={() => void search("staging")}>Search staging</button>
</section>
);
}
export function App() {
return (
<RadientProvider bffUrl="/api/radient" theme="dark">
<TeamBridgePanel />
<CustomBridgeView />
</RadientProvider>
);
}
#Real-time push delivery
Configure logical route_id rules under MCP → Push routing & session targets in the Radient console (see MCP notifications), then consume matched Server-Sent Events (SSE) in your custom harness with PushRouter or run the radient-mcp-relay CLI daemon.
#Route events in-process with PushRouter
PushRouter maintains the GET https://api.radienthq.com/mcp SSE stream, checks : keepalive heartbeats, persists Last-Event-ID checkpoints, deduplicates events, and refuses any unmapped route_id. Combine CallbackAdapter for custom in-process agent loops with built-in adapters (CommandAdapter, LocalWebhookAdapter, AntigravityAdapter, LocalOperatorAdapter):
import {
CallbackAdapter,
CommandAdapter,
PushRouter,
} from "@radient-ml/sdk";
const router = new PushRouter(radient, {
checkpointPath: "~/.radient/push-cursor.json",
onResyncRequired: () => {
console.warn("Replay window exceeded; refresh state with bridge.getMessages().");
},
onUnmappedRoute: ({ routeId }) => {
console.warn(`Refused unmapped route_id "${routeId}"`);
},
});
// In-process handler for a custom Node.js harness
router.registerRoute(
"chief_of_staff",
new CallbackAdapter(async (event) => {
await handleIncomingBridgeEvent(event);
}),
);
// Or spawn an allowlisted local CLI with shell: false
router.registerRoute(
"triage_cli",
new CommandAdapter({
binary: "/usr/local/bin/my-harness",
args: ["--from-stdin"],
allowedBinaries: ["/usr/local/bin/my-harness"],
}),
);
await router.start();
notifications/radient/channel_event SSE payload delivered to your adapter:
{
"createdAt": "2026-12-01T18:24:57Z",
"conversationId": "bcv_01JOPSRELEASE",
"eventId": "mev_01JPUSHEVENT",
"kind": "message_created",
"messageId": "bcmsg_01JPUSHMSG",
"preview": "Push notification check from published @radient-ml/sdk@0.1.0.",
"routing": {
"routeId": "chief_of_staff",
"routeLabel": "Chief of Staff"
},
"senderLabel": "Alex Rivera",
"seq": 3,
"streamId": "a:0-0|b:1796149497870-0",
"tenantId": "org_01JEXAMPLEORG"
}
#Run the standalone radient-mcp-relay daemon
To route pushes to local targets (antigravity, local-operator, command, or local-webhook) without writing a Node.js wrapper, use @radient-ml/mcp-relay:
radient-mcp-relay init # writes 0600 ~/.radient/relay.json template
radient-mcp-relay login # OAuth 2.1 PKCE sign-in (0600 tokens)
radient-mcp-relay status --live # checks config, routes, token, and live discover
radient-mcp-relay start # runs SSE PushRouter daemon
radient-mcp-relay status --live response:
{
"checkpointCursor": null,
"configMode": "0600",
"configPath": "~/.radient/relay.json",
"liveDiscover": {
"grantedScopes": [
"bridge:delete",
"bridge:manage",
"bridge:read",
"bridge:write",
"hub:read",
"integrations:read",
"integrations:write",
"mcp:read",
"notifications:manage",
"pass:read",
"tunnels:read"
],
"organizations": 2
},
"mcpUrl": "https://api.radienthq.com/mcp",
"routes": [
{
"adapter": "antigravity",
"routeId": "chief_of_staff"
}
],
"token": {
"accessTokenExpired": false,
"authenticated": true,
"clientId": "mcp_dcr_01JEXAMPLECLIENT",
"hasRefreshToken": true,
"refreshExpired": false,
"scope": "bridge:delete bridge:manage bridge:read bridge:write hub:read integrations:read integrations:write mcp:read notifications:manage pass:read tunnels:read"
}
}
For adapter details and security boundaries (AntigravityAdapter, LocalOperatorAdapter, CommandAdapter, LocalWebhookAdapter, CallbackAdapter), see Built-in push adapters.