Connect Your Own Agent
Your own agent - Claude Code, Codex, or any other - can work in mindzieStudio for you. It creates and starts Process Intelligence projects, loads your data, asks the event log questions, runs its own analysis inside a project, publishes reports, and stops the project when it is done. With the same key it can also read and edit your BPM Studio diagrams.
You do two things: make a key, and paste one sentence to your agent. Everything else is the agent's work, and it reads its own instructions. The key goes into a page in your browser, never into the conversation.
Before you start
- Working with projects through a key must be switched on for your installation. If you are not sure it is, ask your mindzie contact before you rely on it.
- An agent that runs commands needs Python 3.9 or newer on the machine it runs on.
Step 1 - Make your key
- Sign in to mindzieStudio, and check you are in the right tenant. The tenant is named at the bottom right of the page.
- Open the menu under your name, then Administration, then Settings, then API Keys.
- Click Create New Secret Key.
- Give the key a name that says what will hold it -
my-laptop-agent,nightly-load-robot- notkey1ortest. The name is the only handle you will have on this key later. - Click Create, and copy the key. It begins
mz_tk_ormz_sk_: it is a key for your tenant, which is what the agent needs.
The key then has a row under Your API Keys, with its name, when it was created, who created it and when it was last used. Today the key can also be shown again later: the eye icon on its row opens it, with a Copy button. So anyone who can open this screen in your tenant's settings can read the key, and removing the key - the bin icon on its row - is the only way to take it back.
Which key opens what
There are two kinds of key, and each opens its own things:
| Key | What it opens | Where it is made |
|---|---|---|
Tenant key (mz_tk_... or mz_sk_...) |
Your Process Intelligence projects - list, create, start, stop, back up, and open one for work - and BPM Studio: diagrams, comments, approvals, the audit log and AI investigations | By you: the menu under your name, Administration, Settings, API Keys |
Project key (mz_pk_...) |
One project's cube, and nothing else: its event log, jobs, reports and the rest of its toolbox | By your agent, from the tenant key, when it opens a project - or by you, on the project's ... menu, API keys |
You give the agent the tenant key. With it, the agent makes a project key for each project it works in, by itself, and uses that project key for the work; you never handle one. Those keys appear in the project's API keys dialog on the projects page, with their names and when each was last used, and you can revoke any of them there. See The Projects Page.
Step 2 - Paste one sentence to your agent
Read https://docs.mindziestudio.com/agent.txt and connect yourself to my mindzieStudio account.
Which agents. All of it works in any agent. Claude Cowork, claude.ai and other chat apps reach it through the hosted MCP server; agents that can run commands, such as Claude Code and Codex, can also use the
mztool. Either way an agent can create and start projects, load data, work inside a project, and make and publish AI reports. The same sentence works in all of them: the agent picks the way in. Connect an AI Agent explains the difference.
Do not put the key in the sentence. The page in that sentence is written for the agent: it asks what you want done, and sends an agent that can run commands on to the mz instructions - where to download the current version of mz, how to install it, how to ask you for a key without the key ever entering the conversation, and how to connect itself.
What you will see
- The agent installs the tool. It reads which version is current, downloads it, checks it, and installs it. Your agent may ask your permission to run each command; allow it.
- A page opens in your browser. The agent tells you first. The page is served by the tool on your own computer, and it asks for two things: the address you sign in to mindzieStudio at, for example
https://www.mindziestudio.com, and the key from step 1. A key works only on the mindzieStudio it was made in. - Paste both and click Check and save. The key is checked before anything is saved. A wrong key, the wrong kind of key, or an address that cannot be reached is refused on the page in a sentence, and you can try again. The page reads which tenant the key belongs to from the key itself, so you never type a tenant id. When it works the page says Saved and you can close it. The page waits up to 10 minutes.
- The agent confirms. It runs one read and tells you it is connected, and to what.
The key never passes through your agent. You paste it into the page, not into the conversation. It is saved on your computer in a file only you can read, where the tool finds it next time, so you connect once per machine. Do not paste a key into the conversation; if you have, remove it in mindzieStudio and make another.
If no page opens - your agent runs on another machine, or in a sandbox that cannot open a browser - the agent gives you the page's address to open instead. The page is on the machine the agent runs on, so open it in a browser on that machine.
Then tell the agent, in your own words, what you want done.
One project only
To connect your agent to one project, with a key that opens nothing else, paste this instead, with the project running:
Read https://docs.mindziestudio.com/mz-cube.txt and connect mz to my mindzie project
The page that opens then asks for a project key and the project's address:

Start the project. On the AI Process Intelligence projects page, click Start on it if it is stopped, and wait until it shows Running - about a minute. The project must be running when you click Check and save. If the page says The project at this address is not running, start the project, wait until it shows Running, and click Check and save again - the page keeps waiting for you.
Mint the key. On the same page, click the ... menu on the project's card and choose API keys. Under Key name, say what will hold the key -
my-agent,my-laptop- and click Mint key, then Copy. The key beginsmz_pk_and is shown once.
Find the address. Open the project. Your browser's address bar then shows the project's own address - in mindzie's cloud it starts
https://p-, for examplehttps://p-34d6537ced37.project.mindziestudio.com. Take the part up to the end of the name, without anything after it.
What your agent does
- Creates and starts a project. The project appears on your projects page like any other, and goes through the same states. Starting takes about a minute.
- Loads your data. The agent sends your extract - a whole database export can go as one zip file - and builds the event log from it. A single file can be up to 2 GB.
- Works in the project. It asks the event log questions and runs its own analysis inside the project, against your real data.
- Publishes a report. The report says which event log it was built from.
- Stops the project when the work is done, and revokes the project key it minted, unless you want it kept.
- Works in BPM Studio, if you ask: lists, reads and edits diagrams, adds comments, submits a diagram for approval, and starts an AI investigation that turns your documents into a diagram.
The agent asks you one thing it must never decide for itself: what a case is in your data - an order, a claim, a patient. That choice decides every number the product gives you, so the agent asks rather than guesses. See Choosing What a Case Is.
Your agent does not delete a project, a diagram or anything else unless you ask it to, in words, for that one thing. An AI job - a report card, or a report asked for in plain words - uses the project's AI credits, so the agent asks before it starts one.
For example, once your data is in:
Run the Process Context Graph card and give me the JSON.
Make me a report on how long invoices wait for approval, with the numbers as a JSON file.
Getting the Process Context Graph shows what the first one does and what comes back; Your Own Reports and JSON shows the second.
How it fits together

Each Process Intelligence project runs in its own cube: one container holding the project's event log and a toolbox of process intelligence tools. Two kinds of agent use the same toolbox.
- The agent inside is the mindzie agent that runs in the cube. It is the one that writes a report when a report card is run, including the Process Context Graph.
- An agent outside is yours - a coding agent, a script, a program on your machine. It reaches the cube over HTTPS with
mzand a key that opens that one project. It never sees the cube's files; it asks, and the cube answers.
(The picture is a slide from the talk where the cube was presented; its DEMO labels are that talk's running order.)
Where the cube runs
The cube can run on your own servers or in our cloud. Your agent reaches it the same way in both: from outside, with mz, the project's address and a project key.

On your servers - mindzie Desktop or Enterprise. The cube runs inside your own network, beside your data. Your agent outside uses its toolbox, and the agent inside calls the language model you choose.

In our cloud - SaaS. We host the cube. The agent inside uses our language model or your own key, and your agent outside still uses the cube's toolbox directly.
Two ways in: the command line and the MCP server
mz gives your agent its commands in two ways. Your agent uses whichever it supports - you do not have to choose, and you can set up both.
| Way in | What it is | Suits |
|---|---|---|
| The command line | The agent runs mz commands in a shell, such as mz projects list |
Any agent that can run commands: Claude Code, Codex and most coding agents. Nothing more to set up. |
| The MCP server | mz mcp runs on your machine and offers the commands as MCP tools, one tool per group of commands - all of them except the few listed below |
Any agent that speaks the Model Context Protocol (MCP), including one that cannot run a shell. You register it once, below. |
Both use the same keys, saved in the same place, and are refused in the same words. Some commands are on the command line only, and the MCP server does not offer them at all:
- Commands that destroy something you cannot get back - deleting a project, a BPM Studio diagram, a comment, an AI investigation or one of its files, revoking a project key, and restoring a backup over a project. On the command line each of them must be confirmed with the name of what it acts on, as it is now, before it does anything.
- Commands whose answer is a file - exporting a BPM Studio diagram as a
.bpmnfile, downloading an AI investigation's file, and downloading a project backup. They write the file to a path you name, which a tool call cannot do.
Inside a project's cube, the MCP tools can still delete a saved filter, enrichment, rule or cost, as the command line can.
Set up the MCP server in your agent
This is only for the MCP way in. An agent that runs mz on the command line needs none of it. Each setup below starts mz mcp as a local server over standard input and output; it takes its keys from what you saved on the page, never from the agent's settings, so no key goes in any of these files.
Claude Code
claude mcp add --scope user mz -- mz mcp
claude mcp list
The first line registers the server for every project you open in Claude Code; leave out --scope user to register it for the current folder only. claude mcp list then shows mz as Connected. Start a new Claude Code session, and the mz tools are there. Claude Code may ask your permission before it uses a tool; read what each call will do before you allow it (see Before you let calls run unasked, below).
Codex
codex mcp add mz -- mz mcp
This writes the server into Codex's settings file, ~/.codex/config.toml (on Windows %USERPROFILE%\.codex\config.toml). Open the file and add one line to the [mcp_servers.mz] table, so that it reads:
[mcp_servers.mz]
command = "mz"
args = ["mcp"]
default_tools_approval_mode = "prompt"
With prompt, Codex asks you before each call to an mz tool. codex mcp list shows mz as enabled; start a new Codex session to use it.
Codex also accepts approve, which lets it call every mz tool without asking. Use that only for a run that nobody is there to answer, and only if you accept what the next section describes.
Before you let calls run unasked
The MCP server offers nothing that deletes a project or a diagram, but it is far from read-only. Through it an agent can start a project, which costs money until the project is stopped; run an AI job, which spends the project's AI credits; load data; publish reports; edit BPM Studio diagrams; and delete a saved filter, enrichment, rule or cost in a project. So keep your agent asking before each call unless you are content for it to do all of that without you.
Any other agent that speaks MCP
Register a local server, over standard input and output, whose command is mz with the one argument mcp. Most agents take it in this shape:
{"mcpServers": {"mz": {"command": "mz", "args": ["mcp"]}}}
An agent that prefers a shell
Nothing to register. The agent runs mz like any other command - mz --help lists the groups of commands, and mz skill prints the whole method, written for an agent.
If mz is not on the agent's path
If the agent cannot find mz - it was installed in a Python environment of its own, say - give the full path of the mz that was installed, which which mz prints (where mz on Windows) while that environment is active. In an environment made at ~/.mz-env that is ~/.mz-env/bin/mz on macOS or Linux and %USERPROFILE%\.mz-env\Scripts\mz.exe on Windows. For example:
claude mcp add --scope user mz -- ~/.mz-env/bin/mz mcp
What the MCP server offers
One tool per group of commands: projects, projects_backups, bpmn_diagrams, cube_log, cube_reports and so on - 33 tools in all. Each takes a method and its parameters; the method describe lists every parameter. The commands listed under Two ways in are not among them. open, on the projects tool, makes a project key and saves it, so that the cube_ tools then reach that project - the key is never in the answer. To serve a profile other than the default one, register mz mcp --server <name>.
Connecting without an agent
You can do the same yourself in a terminal, in three steps.
1. Download the current version. The address below holds the current version number and nothing else:
curl https://mindzie.blob.core.windows.net/download/mindzie-agent/LATEST
It answers, for example, 1.4.0. Put that number in place of <version>:
curl -fO https://mindzie.blob.core.windows.net/download/mindzie-agent/mzcube-<version>-py3-none-any.whl
curl -fO https://mindzie.blob.core.windows.net/download/mindzie-agent/skill/SKILL.md
On Windows, type curl.exe instead of curl. A browser download works as well. The .whl file is the tool, mz; it uses nothing but Python's own standard library. SKILL.md is its method file: every command, every option, and what each answer looks like. It is written for an agent - put it wherever your agent reads its instructions or skills.
2. Install it in a clean Python environment, from the file you downloaded:
python -m venv mz-env
mz-env\Scripts\activate
pip install mzcube-<version>-py3-none-any.whl
pip show mzcube
On macOS or Linux, the second line is source mz-env/bin/activate. pip show names the version you installed. The tool is installed from the file and from nowhere else: pip install mzcube on its own finds nothing of ours.
3. Connect and check. With a tenant key:
mz setup --tenant
mz projects list
With a project key, starting the project first if it is stopped:
mz setup
mz reports list
mz setup --tenant and mz setup open the same pages in your browser as above. To be asked in the terminal instead, with the key hidden as you type, add --terminal. An answer from the second command - even an empty list - means the tool, the address and the key all work.
mz --help lists the groups of commands, mz projects --help one group's commands, and mz projects create --help one command's options.
A first session on the command line
With a tenant key saved, this makes a project, starts it, opens it for work, and asks its cube a question. The first command answers the project's piProjectId, which the others take:
mz projects create --name "Order to cash"
mz projects start --pi-project-id <piProjectId>
mz projects get --pi-project-id <piProjectId>
mz projects open --pi-project-id <piProjectId> --name my-laptop
mz log stats
mz projects start answers at once; ask mz projects get until the state reads Running. mz projects open makes a project key for the project and saves it where mz setup saves one - it never shows the key - so every cube command, such as mz log stats, then works on that project. A new project has no data yet, so mz log stats refuses until you load some. When you are done, mz projects stop --pi-project-id <piProjectId>: a running project costs money, a stopped one costs nothing.
BPM Studio takes the same tenant key. A BPM Studio project's id is in your browser's address bar when the project is open, after /project/:
mz bpmn diagrams list --project-id <project id>
mz bpmn diagrams get --project-id <project id> --diagram-id <diagram id>
When something is refused
Every refusal says, in a sentence, what to do next. mz exits with 3 when the project refused the request and nothing ran, and with 4 when the project was never reached. These are the refusals your agent will meet most often, in the words it is given:
| What happened | Exit | What the agent is told |
|---|---|---|
| Asking for the graph before the card has run | 3 | No process context graph has been published in this project. Make one with the Process Context Graph card: mz jobs create-agent --card process-context-graph, then mz jobs run --slug with the slug that answers, and wait for mz jobs status to say done. ... |
| A card that does not exist | 3 | There is no report card called 'no-such-card'. The cards are: data-quality-review, process-analysis-summary, process-improvement-recommendations, process-context-graph. |
| A report that does not exist | 3 | There is no published report called 'no-such-report' in this project. The published reports are: ... |
| A file the report does not carry | 3 | v0001 of the report 'invoice-timing-against-the-goods-receipt' carries no attachment called 'no-such-file.json'. Its attachments are: invoice-timing.json, invoice-timing-kpis.json. |
| A file that is not valid JSON | 3 | The attachment 'broken.json' of v0001 of the report ... cannot be returned as a value: it is not valid JSON (...). ... the report has to be published again with a file that is valid JSON. |
| Publishing a graph with parts missing | 3 | The report carries "process-context-graph.json". This is not a valid mindzie.process-context-graph 1.0 document: the document is missing "assumptions", "decisions", ... |
| A key that has been revoked | 4 | revoked: Studio refused the key exchange for p-....project.mindziestudio.com: revoked |
A revoked key is refused within seconds of being revoked.
When you are done
- Stop the project on the projects page. A running project costs money; a stopped one costs nothing and loses nothing - the log and the reports are there on the next start.
- Revoke the key if nothing needs it any more: a project key in the project's API keys dialog, a tenant key with the bin icon under Your API Keys. Making another takes seconds.
Next
- Getting the Process Context Graph - run the card, fetch the graph, check it against its definition, and what is in it, part by part.
- Your Own Reports and JSON - reports and JSON files of your own, by a script your agent writes or in plain words.
- The Cube's Toolbox - what is in the toolbox, and who can reach which tools.