Step by step
Switch the session to B2B mode
ethora-configure { b2bToken } then ethora-auth-use-b2b, or start the stdio server with ETHORA_B2B_TOKEN set; on the hosted endpoint a B2B token in the Bearer header selects the mode itself. ethora-status confirms the mode without echoing the value. Run this from your own automation, not a shared assistant session.
# stdio server in B2B mode for a provisioning script
ETHORA_API_URL=https://api.chat.ethora.com/v1 ETHORA_B2B_TOKEN="<your B2B token>" npx -y @ethora/mcp-serverCreate the tenant in one call
ethora-b2b-app-provision { displayName, tokenLabels, rooms, enableBot, botPrompt, llmProvider, llmModel } creates the app, mints one app token per label, provisions the rooms, then configures and enables its bot, returning a per-step log with the appId and the token values (shown once). ethora-b2b-app-bootstrap-ai { displayName, crawlUrl, docs, agentPrompt } does app plus RAG sources plus bot instead. ethora-b2b-app-create { displayName } makes a bare app.
Mint, list, rotate and revoke app tokens
ethora-app-tokens-create-v2 { appId, label } returns the secret exactly once with its tokenId. ethora-app-tokens-list-v2 shows metadata only. ethora-app-tokens-rotate-v2 { tokenId, label } revokes the old token and issues a replacement in one step; anything still using the old one fails at once. ethora-app-tokens-revoke-v2 { tokenId } revokes with no replacement.
Provision users in batches
ethora-users-batch-create-v2 { usersList, bypassEmailConfirmation } enqueues 1 to 100 users as a background job (HTTP 202) and returns { jobId, statusUrl }. Conflicts such as an email already registered are reported per user, not by failing the batch. ethora-wait-users-batch-job-v2 { jobId, timeoutMs } blocks until it completes or fails.
You: Create the 40 users from onboarding.csv without email confirmation and report conflicts.
Assistant: ethora-users-batch-create-v2 { usersList: [40 entries], bypassEmailConfirmation: true } ... 202, jobId 9a4c.
ethora-wait-users-batch-job-v2 { jobId: "9a4c", timeoutMs: 120000 } ... completed, 38 created, 2 conflicts.Generate the runbook and env files for your own code
ethora-generate-b2b-bootstrap-runbook { displayName, crawlUrl } prints the tool calls in order with example payloads; documentation only. ethora-generate-env-examples { target } returns .env.example templates for the chat component, the backend SDK and this MCP server. To run the sequence, use ethora-run-recipe { recipeId: “b2b-bootstrap-ai” } or the orchestrators above.
The tools this uses
Names and descriptions come from the server’s own tool list. Read-only tools are safe to auto-approve; destructive ones make your client ask first. Full reference.
| Tool | Name | What it does | Access |
|---|---|---|---|
| Use B2B Auth | ethora-auth-use-b2b | Switch this session’s active auth mode to B2B, so subsequent calls authenticate as a tenant actor via the x-custom-token header. | write |
| Create App (B2B) | ethora-b2b-app-create | Create a new Ethora app (tenant) server-side using B2B auth - the partner/integrator equivalent of ethora-app-create. | write |
| Provision App (B2B) | ethora-b2b-app-provision | One-call B2B orchestrator: create an app, mint one or more app tokens, provision default chat rooms, then configure and enable its AI bot. | write |
| Bootstrap AI App (B2B) | ethora-b2b-app-bootstrap-ai | One-call B2B orchestrator: create an app, set it as the current context, index RAG sources, then configure and enable its AI bot. | write |
| Create App Token | ethora-app-tokens-create-v2 | Mint a new app token for an app. | write |
| List App Tokens | ethora-app-tokens-list-v2 | List the app tokens issued for an app - metadata only (tokenId, label, created/rotated timestamps, status); the secret token values are never returned (only shown... | read-only |
| Rotate App Token | ethora-app-tokens-rotate-v2 | Rotate an app token: revoke an existing token and issue a replacement in one step. | destructive |
| Revoke App Token | ethora-app-tokens-revoke-v2 | Permanently revoke an app token by tokenId - it stops working immediately; any client, SDK, or MCP session still using it gets auth failures. | destructive |
| Batch Create Users | ethora-users-batch-create-v2 | Provision many Ethora users (1-100) in one asynchronous batch job - the bulk equivalent of ethora-user-register. | write |
| Wait for Users Batch Job | ethora-wait-users-batch-job-v2 | Block until a users batch job reaches a terminal state (completed or failed) or timeoutMs - read-only polling wrapper around ethora-users-batch-job-v2. | read-only |
| Generate B2B Bootstrap Runbook | ethora-generate-b2b-bootstrap-runbook | Generate a human-readable runbook listing this server’s tool calls in the right order for a B2B bootstrap, with example payloads. | read-only |
| Generate Env Examples | ethora-generate-env-examples | Generate .env.example templates for the three common Ethora integration targets: the frontend chat component, the backend SDK, and this MCP server. | read-only |
One customer, fully provisioned
“Provision a tenant called Northwind Brokers with app tokens labelled backend and mobile, rooms General and Claims, and an enabled bot that answers questions about claim status. Then create the 40 users from the attached CSV without email confirmation, tell me which emails already existed, and list the tokens.”
ethora-auth-use-b2b{}ethora-b2b-app-provision{ displayName: "Northwind Brokers", tokenLabels: ["backend", "mobile"], rooms: ["General", "Claims"], enableBot: true, botPrompt: "You help brokerage staff check claim status." }ethora-users-batch-create-v2{ usersList: [ { email: "[email protected]", firstName: "A", lastName: "Lee" }, ... 39 more ], bypassEmailConfirmation: true }ethora-wait-users-batch-job-v2{ jobId: "9a4c2d7e", timeoutMs: 120000, intervalMs: 3000 }ethora-app-tokens-list-v2{ appId: "66f4e0f1a2b3c4d5e6f7a8b9" }
A tenant app with two rooms, two labelled app tokens from the provision log, a running bot, 38 new users and a conflict list for the other two.
Good to know
- Token secrets appear once, in the create, rotate or provision result. Capture them there; the list tool never returns values.
ethora-app-tokens-rotate-v2is flagged destructive because the old token dies immediately; create a second token, move clients, then revoke the first when they cannot switch atomically.- Later-step failures in the orchestrators do not undo earlier steps; read the per-step log.
ethora-b2b-app-bootstrap-aiswitches the session to app-token mode internally for source ingest and restores the previous mode best-effort.
