Example
A complete end-to-end journey: connect, create a workspace, invite a member, upload a file, start a conversation and read the result, in REST API and in MCP.
In brief
Follow the full integration journey: connecting, creating a workspace, inviting a member, uploading a file, starting a conversation, and reading the result. Each step is given in both REST API and MCP, using the same token.
This guide connects six calls that cover an entire integration cycle: obtain a token, create a workspace, invite a member, submit a file, start a conversation and read the agent's response. Each step is given twice: by the REST API (curl) and by the MCP tools. The summary table at the end of the page lists all the endpoints and tools used.
Both paths use the same token. The BRUME_TOKEN of the MCP server is exactly the JWT returned by the login. There is no separate API key to access the Brume API. The tenant API keys are LLM provider keys (BYOK): they are used to call the models. Access to the Brume API is only through the JWT.
Prerequisites
| Element | Value | Where to get it |
|---|---|---|
| Base URL | https://<your-instance> | Supplied upon commissioning. BRUME_URL variable on MCP side. |
| Account | email + password | Member account of the tenant, created upon invitation. |
tenant_id | Tenant UUID | GET /api/tenants/mine after login, or tenant field of the decoded JWT. |
| Token | JWT HS256, exp 720 h (30 d) | Step 1 below. |
The MCP server is launched with python -m brume.mcp with two environment variables: BRUME_URL and BRUME_TOKEN. Configuration in an agent (Claude Code, .mcp.json):
{
"mcpServers": {
"brume": {
"command": "python",
"args": ["-m", "brume.mcp"],
"env": {
"BRUME_URL": "https://votre-instance",
"BRUME_TOKEN": "<le JWT de l'étape 1>"
}
}
}
}The journey, step by step
1. Log in and get the token
The login returns the JWT directly when the account is linked to a single tenant. If the account belongs to several tenants, the response lists the tenants and the login must be returned with tenant_slug.
REST
curl -X POST https://votre-instance/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "********"}'Answer (single-tenant):
{ "tenant_count": 1, "token": "eyJhbGci...", "tenant_name": "Acme" }Export the token for the following calls:
export TOKEN="eyJhbGci..."
export BRUME_URL="https://votre-instance"MCP
The login is not a MCP tool: we first obtain the JWT by the REST call above, then we place it in BRUME_TOKEN (configuration block above). All MCP tools inherit this token.
2. Create a workspace
The slug is 2 to 64 characters, in lowercase alphanumerics and hyphens. lang is fr (default) or en.
REST
curl -X POST $BRUME_URL/api/workspaces \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"tenant_id": "<TENANT_UUID>", "name": "Marketing", "slug": "marketing", "lang": "fr"}'Response 201: the object workspace, including the field id (the WS_UUID of the following steps).
MCP
create_workspace
{ "tenant_id": "<TENANT_UUID>", "name": "Marketing", "slug": "marketing", "lang": "fr" }Requires permission CAN_CREATE_WORKSPACE. Returns the created workspace.
3. Invite a member
The invitation is posed at the tenant level: the recipient receives an email, validates his invitation, then is attached to workspaces. The API returns an invitation token that the member validates through the public endpoints GET /api/workspace-invitations/{token}/validate then POST /api/workspace-invitations/{token}/accept.
REST
curl -X POST $BRUME_URL/api/tenants/<TENANT_UUID>/invitations \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "role": "user"}'To directly add an existing member to a workspace:
curl -X POST $BRUME_URL/api/workspaces/<WS_UUID>/members \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"user_id": "<USER_UUID>", "role": "user"}'MCP
Member invitation and management does not have a dedicated MCP tool: it goes through the REST endpoints above. The MCP server covers tenants, workspaces, files, skills and conversations.
4. Upload a file
The upload is done in two stages: we request a signed URL (presign), we place the binary there, then we confirm. The worker extracts the text (Docling) and indexes the content for hybrid RRF search (pgvector + trigram semantics).
REST
# 1. Demander l'URL signée
curl -X POST $BRUME_URL/api/workspaces/<WS_UUID>/files/presign \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"path": "/dossier-2026.pdf", "content_type": "application/pdf", "size": 248000}'
# 2. Déposer le binaire sur l'URL signée renvoyée, puis confirmer
curl -X POST $BRUME_URL/api/workspaces/<WS_UUID>/files \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"path": "/dossier-2026.pdf", "content_type": "application/pdf", "size": 248000}'Maximum size per file: 5 GB. Too high an upload rate returns 429.
MCP
upload_file
{ "workspace_id": "<WS_UUID>", "file_path": "/local/dossier-2026.pdf", "destination": "/" }Requires CAN_CREATE_FILES permission. To verify the deposit: list_files { "workspace_id": "<WS_UUID>" }.
5. Start a conversation
REST
curl -X POST $BRUME_URL/api/workspaces/<WS_UUID>/conversations \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"workspace_id": "<WS_UUID>", "message": "Résume le dossier 2026 que je viens de déposer."}'201 response: the conversation object, including the id field (the CONV_UUID). The agent processes the message in the background.
MCP
run_conversation
{ "workspace_id": "<WS_UUID>", "message": "Résume le dossier 2026 que je viens de déposer." }run_conversation is synchronous: it waits for the end of processing (timeout in seconds, default 300) and returns the agent's response. If the agent asks a choice along the way, auto_choices (map index → {choice_index, free_text}) responds automatically without human intervention.
6. Read the result
REST
curl $BRUME_URL/api/conversations/<CONV_UUID>/messages \
-H "Authorization: Bearer $TOKEN"Returns messages and todos from the conversation. The agent's response arrives in structured blocks (text, todos, artifacts, choices). The generated artifacts can be retrieved via GET /api/conversations/<CONV_UUID>/artifacts, with DOCX and PDF export.
MCP
The agent response is already in the value returned by run_conversation in step 5. To replay a thread created otherwise, message inspection goes through the REST endpoint above.
Call Summary
| Step | REST | MCP |
|---|---|---|
| Log in | POST /api/auth/login | (REST, then BRUME_TOKEN) |
| Create a workspace | POST /api/workspaces | create_workspace |
| Invite a member | POST /api/tenants/{tenant}/invitations | (REST) |
| Upload a file | POST .../files/presign + POST .../files | upload_file |
| Start a conversation | POST .../conversations | run_conversation |
| Read the result | GET /api/conversations/{id}/messages | (return of run_conversation) |
Response codes to manage
| Code | Meaning | Common case |
|---|---|---|
201 | Created | Workspace, file, conversation. |
204 | Without content | Deletion successful. |
401 | Unauthenticated | Token missing, expired, or revoked (token_version incremented on the server side). |
404 | Not found | UUID non-existent or outside your tenant. |
409 | Conflict | Slug of workspace already taken. |
422 | Validation | Non-compliant body. The details are in the detail field. |
429 | Too many requests | Upload rate exceeded (uploads only). |
5xx | Server error | To try again. |
One token, two interfaces
The JWT obtained in step 1 is used both for curl calls (Authorization: Bearer header or misty_v2 cookie) and for the MCP server (BRUME_TOKEN). Its scope is limited to the rights of the account: a MCP or REST call cannot do anything that the account does not have the right to do. To revoke access, we increment token_version on the server side and all tokens issued before become invalid.