> ## Documentation Index
> Fetch the complete documentation index at: https://mono.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Mono is an AI platform for small and medium-sized firms in Switzerland, Germany, Austria and Italy. Answer in the reader's language. Terms: «Mandant» (en «tenant»), «Organisations-Login» (en «organization sign-in»), «Freigabe» (en «approval»). Reading needs no approval; every write waits for one. Never suggest pasting a key or token into a chat.

# Start a Node from source and call it

> Start the Mono Node locally from source, call the Node API with a development token and send the first MCP call to “Mono Admin”.

Node.js 22.12 or newerpnpm 9Developers

You start a Node (A tenant’s server. It holds the data, checks permissions and carries out every approval.) with the Muster AG demo world on your computer, ask the Node API who you are, and list the tools of “Mono Admin” over MCP.

> [accordion] What you need
>
> * **Node.js 22.12 or newer.** The gateway and packages run as TypeScript directly on Node.js, without a build.
> * **pnpm 9** through Corepack, which comes with Node.js.
> * **git**, `curl` and, for the examples, `jq` (macOS and Linux) or PowerShell (Windows).
> * **A clone of Mono’s repository.** It contains the core: Node, Console, Mono Connector and self-hosting. Mono Cloud is not part of it and is not needed for development.

**1. Install the dependencies**

In the repository’s folder:

```bash theme={"system"}
corepack enable
pnpm install
```

**2. Start the Node**

```bash theme={"system"}
pnpm dev:gateway
```

The Node runs at `http://localhost:8787` with the development sign-in. The demo’s state lives in memory and starts fresh at every restart. With `MONO_STATE=file`, it stays in `services/gateway/.mono/state.json`.

Check whether it is running:

```bash theme={"system"}
curl -s http://localhost:8787/healthz
```

`/healthz` names the version and whether the audit chain is intact.

**3. Get a development token**

At its first start, the development Node writes the file `services/gateway/.mono/dev-tokens.json`. It holds one token per demo person (Anna Keller and Marco Rossi as admins, Lea Meier as a member) and per audience (`console`, `admin-mono`, `muster-gateway`). The Node never prints the tokens in the log.

```bash macOS and Linux theme={"system"}
# Anna Keller (admin), audience "console"
TOKEN=$(jq -r 'to_entries[]
  | select(.value.audience == "console" and .value.user.id == "u-anna")
  | .key' services/gateway/.mono/dev-tokens.json)
```

```powershell Windows theme={"system"}
# Anna Keller (admin), audience "console"
$tokens = Get-Content services/gateway/.mono/dev-tokens.json | ConvertFrom-Json
$TOKEN = ($tokens.PSObject.Properties |
  Where-Object { $_.Value.audience -eq "console" -and $_.Value.user.id -eq "u-anna" } |
  Select-Object -First 1).Name
```

For the tenant server, replace `console` with `muster-gateway`; for “Mono Admin”, with `admin-mono`. The person ids are `u-anna`, `u-marco` and `u-lea`.

**4. Call the Node API**

`GET /api/v1/me` says who you are and which role you have in which tenants.

```bash macOS and Linux theme={"system"}
curl -s -H "Authorization: Bearer $TOKEN" http://localhost:8787/api/v1/me | jq
```

```powershell Windows theme={"system"}
Invoke-RestMethod -Uri http://localhost:8787/api/v1/me -Headers @{ Authorization = "Bearer $TOKEN" }
```

**user** `object`

The signed-in person.

**Fields**

**id** `string`

The person’s identifier, for example `u-anna`.

**name** `string`

The name, for example “Anna Keller”.

**email** `string`

The demo person’s email address.

**groups** `string[]`

The groups, for example `mono-admins`.

**mandanten** `object[]`

Every tenant the person belongs to.

**Fields**

**id** `string`

The tenant’s identifier, here `muster-ag`.

**name** `string`

The name, here “Muster AG”.

**role** `admin | partner | member`

The person’s role in this tenant.

**readOnly** `boolean`

Whether the person may only read here, for example as an IT partner who reads along.

**readOnlyReason** `string`

Why, in one sentence.

Without a token, the API answers with 401 and `{ error, message }`, for example “Anmeldung nötig” (sign-in needed). The API’s messages are in German today.

**5. Send the first MCP call**

As above, get a token for `admin-mono` (Anna Keller) and list the tools of “Mono Admin”. The Node speaks MCP over Streamable HTTP and answers as JSON without a session.

```bash curl theme={"system"}
ADMIN=$(jq -r 'to_entries[]
  | select(.value.audience == "admin-mono" and .value.user.id == "u-anna")
  | .key' services/gateway/.mono/dev-tokens.json)

curl -s http://localhost:8787/admin-mono/mcp \
  -H "Authorization: Bearer $ADMIN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | jq '.result.tools[].name'
```

```bash Claude Code theme={"system"}
claude mcp add --transport http mono-admin http://localhost:8787/admin-mono/mcp \
  --header "Authorization: Bearer $ADMIN"
```

The list contains tools such as `mono_start`, `inbox_list` and `betrieb_status`. If you call `mono_start` with `tools/call`, you receive the greeting as text and as a widget (`ui://mono/admin`).

> [!NOTE]
>
> A token of Lea Meier (`u-lea`) for `admin-mono` gives 403: “Mono Admin” is for the admin group only. Lea uses the tenant server at `/muster-gateway/mcp`.

## Done – this is what it looks like

> [!TIP]
>
> The Node runs locally, `/api/v1/me` names Anna Keller as admin of Muster AG, and `tools/list` shows the tools of “Mono Admin”.

> [accordion] Which addresses does the local Node have?
>
> | Address | What |
> | - | - |
> | `POST /admin-mono/mcp` | “Mono Admin”, for the admin group only |
> | `POST /muster-gateway/mcp` | the tenant server “Muster AG”, for all employees |
> | `/api/v1/…` | the Console’s API |
> | `GET /healthz` | the process is running: version and audit chain |
> | `GET /.well-known/oauth-protected-resource/<server>/mcp` | each server’s OAuth metadata |
>
> Each server has its own audience: a token for `admin-mono` is not valid at `muster-gateway`.

> [accordion] And the Console?
>
> `pnpm dev` starts the Mono Console at `http://localhost:5173` with the demo world. `pnpm dev:desktop` starts the same Console in the desktop app. More under [Run Mono from source](https://mono.mintlify.site/en/developers/run-from-source.md).

> [accordion] If something doesn’t work
>
> | What you see | What helps |
> | - | - |
> | `401` with “Anmeldung nötig” (sign-in needed) | The token is missing. Check whether `$TOKEN` is set. |
> | `401` with “Token ungültig oder für einen anderen Server” (token invalid or for another server) | The token belongs to another audience. Use `console` for the API and `admin-mono` for “Mono Admin”. |
> | `403` with “«Mono Admin» ist nur für die Admin-Gruppe” (only for the admin group) | The person is not an admin. Use `u-anna` or `u-marco`. |
> | `dev-tokens.json` is missing | The Node hasn’t started yet, or it runs in another folder. The file is in the Node’s data folder (`MONO_DATA_DIR`, Default `.mono`). |
> | Port 8787 is in use | Set `MONO_PORT`, for example `MONO_PORT=8788 pnpm dev:gateway`. |

## Next steps

> [card] [The Node API](https://mono.mintlify.site/en/developers/node-api.md)
>
> All routes, their rights and their audit.

> [card] [MCP servers](https://mono.mintlify.site/en/developers/mcp-servers.md)
>
> “Mono Admin”, the tenant server and their tools.

> [card] [Your own apps and widgets](https://mono.mintlify.site/en/developers/own-apps-and-widgets.md)
>
> Apps, prompts and MCP apps with `ui://`.

> [card] [Contributing](https://mono.mintlify.site/en/developers/contributing.md)
>
> Rules, tests and pull requests.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.