Which one do I need?
| You want to | Use |
|---|---|
| Let Claude, Cursor or another AI agent read your boards, paint, arrange cards and ask Mirva for images | MCP server |
| Do the same from your own Node code: place references, render boards, run a request through Mirva and collect what it made | SDK |
| List your projects, create boards and folders, upload images, from any language | REST API |
Each one authenticates with an API key, which acts as you: the boards you can open, the edits you may make. Nothing here gives an account more authority than it has in the app.
An API key connects your tools to your Mirva account. Sign in to put yours into the examples below.
API keys
A personal API key belongs to your account and works until you refresh or remove it.
Create a key
- Open the account menu and choose Account & Billing, then the API tab (open it).
- Choose Generate API key. The key appears in the list; its copy button puts it on the clipboard.
Unless your account is on a paid plan, its email address must be verified, both to create a key and for a key to work.
Each key’s ⋮ menu has Refresh, which replaces the key with a new one, and Remove, which revokes it. Either way the old key stops working at once.
Keeping it safe
- Anyone with the key acts as you. Keep it out of code you share, front-end code and public repositories: read it from an environment variable such as
MIRVA_API_KEY. - If a key leaks, refresh or remove it; your password and sign-in are not affected.
SDK
@mirva/sdk is the client the MCP server is built on: one WebSocket to Mirva, every tool the server offers as a typed method, and requests to Mirva that it follows until Mirva has answered. It needs Node.js 20 or later.
npm install @mirva/sdkConnect
Mirva.connect() opens the socket, so a wrong key is reported there rather than on the first call. It reads MIRVA_API_KEY from the environment, or takes apiKey as an option; url (or MIRVA_URL) points it at another server. A dropped socket is dialled again by the next call.
import { Mirva } from '@mirva/sdk';
// MIRVA_API_KEY=your-api-key
const mirva = await Mirva.connect();Tools
Every tool in the tool reference is a method of mirva.tools, its arguments typed and documented from the server’s own list. A tool answers with its text, which json() parses, and its images, decoded to bytes. mirva.capture() renders a board or canvas as a PNG.
const drawings = (await mirva.tools.list_drawings()).json<{ shortId: string; type: string }[]>();
const board = drawings.find(d => d.type === 'Board');
await mirva.tools.add_note({ boardId: board.shortId, text: 'Shot list', x: 0, y: 0 });
const png = await mirva.capture(board.shortId, { maxDim: 1600 });
await writeFile('board.png', png.data);mirva.call(name, args) reaches a tool by name, including one newer than your installed SDK.
Asking Mirva
A session is a conversation with Mirva, scoped to a board. ask() sends a request, with reference images if you attach them, and waits until Mirva has answered, which takes minutes for a render. The reply says what Mirva did: the tools it ran, the images it produced and what it added to the board. A request Mirva stops or fails also ends with a reply, saying so. Each request in a session sees the earlier ones.
const session = await mirva.session({ boardId: board.shortId });
const { reply } = await session.ask('Paint over the sketch in the house skill', {
images: [{ data: await readFile('reference.png') }],
});
console.log(reply.message, reply.tools);
for (const produced of reply.producedImages ?? []) {
const image = await session.image(produced.fileId);
await writeFile(`${produced.fileId}.png`, image.data);
}
await session.ask('Now a night version');ask() takes timeoutMs (15 minutes unless set), an abort signal, and onMessage, called for each message as it arrives.
REST API
Plain HTTPS and JSON under https://mirva.ai/api, for the basics from any language: your workspaces and projects, boards and folders, and images uploaded onto boards. Painting, cards and requests to Mirva are tools, in the SDK and the MCP server.
Authentication
Send the key as a Bearer token with every request.
curl -H "Authorization: Bearer your-api-key" \
https://mirva.ai/api/profileResponses
A response is JSON with the result in data, beside the status and how long the server took. Ids are the _id values the responses carry. Boards and canvases also have a ten-character shortId, the one in their URL, which /api/entities/{id} accepts in place of the _id.
{
"hash": "1ddfb0f4e3",
"processingTime": 12,
"statusCode": 200,
"data": { "_id": "…", "name": "…", "username": "…" }
}Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /api/profile | The account the key belongs to. |
| GET | /api/teams | The workspaces you are a member of, each with its projects. |
| GET | /api/teams/tree | Your workspaces and their projects, as a tree: the quickest way to a project id. |
| GET | /api/projects/{projectId} | A project and the boards, documents and folders in it. Add ?folder={id} for a folder’s contents. |
| GET | /api/entities/{id} | One board, canvas, document or folder, by its _id or shortId. |
| POST | /api/entities | Create a board (type "Drawing") or a folder (type "Folder") in a project: JSON with type, name, project and optionally folder. |
| POST | /api/entities/import | Upload an image. Multipart form with file, name and type=Drawing, and either board (adds it to that board) or project (makes a new board for it). |
| PUT | /api/entities/{id} | Rename one: JSON with name. |
| DELETE | /api/entities/{id} | Move one to the bin. |
Names are at most 64 characters. Canvases, cards and notes are placed on a board with the SDK’s tools.
Examples
With your API key in the examples (above), each one can run from this page.
Find a project
curl -H "Authorization: Bearer your-api-key" \
https://mirva.ai/api/teams/treeCreate a board in it
curl -H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"type":"Drawing","name":"Moodboard","project":"PROJECT_ID"}' \
https://mirva.ai/api/entitiesUpload an image onto the board
With board the image is added to that board; with project instead, it becomes a new board of its own.
curl -H "Authorization: Bearer your-api-key" \
-F file=@sketch.png -F name=Sketch -F type=Drawing -F board=BOARD_ID \
https://mirva.ai/api/entities/importErrors
| Status | When |
|---|---|
400 | The request does not match what the endpoint takes. The body names each field: { message, errors: [{ path, code, message }] }. |
403 | No key, a key that is not valid (refreshed, removed, or its account’s email not verified), or no access to what you asked for: { error: { message: "Access denied" } }. |
404 | Nothing with that id. |
422 | The server refused the request and says why: { message, known, statusCode }. |
429 | Over the rate limit; the body is empty. Wait and retry. |
500 | Something failed on the server: { message: "Error occurred", known: false }. Worth retrying once. |
Limits
- Requests with an API key are limited to 60 a minute per account (600 on a paid plan). Over it the server answers
429until the minute has passed. - The SDK’s and MCP server’s tools have their own per-connection limits, which a script working at a person’s pace does not reach.
- Uploads count toward the workspace’s storage, as they do in the app.
Questions
What can an API key do?
Whatever your account can, on the workspaces and projects you belong to: the key is you. There are no scopes yet, which is why it must stay private.
How do I stop a key working?
Remove it on your account’s API page. It stops working at once, in every script and agent that uses it; your own sign-in is not affected.
The SDK, the MCP server or REST?
All three act as your account with the same permissions. MCP is for AI agents. The SDK is for your own code that works on boards: painting, cards, asking Mirva. REST covers the basics from any language: projects, boards, folders and uploads.
Is there an SDK for Python or another language?
Not yet. The REST API works from any language; the board and painting tools need the SDK or an MCP client.
