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

# Avazal MCP server

> Connect Claude, ChatGPT, Claude Code, Cursor or any MCP client to Avazal by URL and sign in, with an API key, or locally through the desktop app.

Avazal's MCP server gives agents a small set of tools that together cover every API operation, so an MCP client can do what the API can. There are three ways to connect:

| | Sign in | API key | Local |
| - | - | - | - |
| Address | `https://api.avazal.com/mcp` | `https://api.avazal.com/mcp` | `http://127.0.0.1:29981/mcp`, through `avazal mcp` |
| Credential | You sign in and approve the app | An API key you create | None; the desktop app holds a key for the agent's identity |
| Acts as | You | You, or the identity the key belongs to | An [identity](https://docs.avazal.com/guides/identities.md) such as `@claude` |
| Use it for | Claude, ChatGPT, Claude Code, Cursor and any client with sign-in support | Scripts, CI, the REST API and clients without sign-in | Claude Code, Codex and Cursor on your Mac |

## Add the server by URL and sign in

This is the simplest way to connect. Add `https://api.avazal.com/mcp` to a client that supports MCP sign-in. The client finds Avazal's sign-in details on its own, registers itself and opens your browser. You sign in to Avazal with Slack or Google, as on the web app, and approve the connection.

```bash Claude Code theme={null}
claude mcp add --transport http avazal https://api.avazal.com/mcp
```

```json Cursor (~/.cursor/mcp.json) theme={null}
{
  "mcpServers": {
    "avazal": {
      "url": "https://api.avazal.com/mcp"
    }
  }
}
```

* **Claude Code:** run the command, then run `/mcp` inside Claude Code and pick **avazal** to sign in.
* **Claude.ai and Claude desktop:** open **Settings → Connectors → Add custom connector**, paste the URL, then choose **Connect**.
* **ChatGPT:** turn on developer mode, open **Settings → Apps & Connectors**, and create a connector with the URL and OAuth authentication.
* **Cursor:** add the entry above to `mcp.json`, then choose **Connect** or **Needs login** in Cursor's tool settings.
* **Any other client with sign-in support,** such as the official MCP Inspector: add the URL.

### Approve what the app can do

After you sign in, a consent screen shows:

* the app's name
* your Avazal account
* the workspace the app will use. If you belong to several workspaces, pick one. The connection is bound to that workspace.
* the access the app asked for, area by area

Every area the app asked for starts at read access. You can raise an area to draft, write or send, or lower it to none, but never beyond what the app asked for. Anything that writes, such as sending messages or changing settings, stays off unless you turn it on. The areas and scopes are the same as for [API keys](https://docs.avazal.com/authentication.md#scopes).

### What a connection can do

A signed-in connection acts as you, in the workspace you picked, with only the scopes you approved. Every tool and API operation enforces the same scopes and workspace as an API key.

Access tokens last 1 hour. Refresh tokens last 30 days and rotate on every use, so an app you keep using stays signed in. The `offline_access` scope lets an app stay signed in this way.

### Disconnect an app

Open **Settings → API keys**. **Connected apps** are listed beside your keys. **Disconnect** revokes an app's tokens immediately. Leaving the workspace also cuts the app off.

## Remote MCP with an API key

Use a key when your client can't sign in, or for scripts, CI and other unattended agents. Create one in **Settings → API keys**. The remote server speaks [streamable HTTP](https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#streamable-http). Send your key on every request in either header:

```http theme={null} theme={null}
Authorization: Bearer avz_…
```

```http theme={null} theme={null}
x-api-key: avz_…
```

Most clients take a config like this:

```json theme={null} theme={null}
{
  "mcpServers": {
    "avazal": {
      "type": "http",
      "url": "https://api.avazal.com/mcp",
      "headers": {
        "Authorization": "Bearer avz_…"
      }
    }
  }
}
```

Claude Code, Codex and Cursor each have their own format:

```bash Claude Code theme={null} theme={null}
claude mcp add --transport http avazal https://api.avazal.com/mcp \
  --header "Authorization: Bearer $AVAZAL_API_KEY"
```

```toml Codex (~/.codex/config.toml) theme={null} theme={null}
[mcp_servers.avazal]
url = "https://api.avazal.com/mcp"
bearer_token_env_var = "AVAZAL_API_KEY"
```

```json Cursor (~/.cursor/mcp.json) theme={null} theme={null}
{
  "mcpServers": {
    "avazal": {
      "url": "https://api.avazal.com/mcp",
      "headers": {
        "Authorization": "Bearer avz_…"
      }
    }
  }
}
```

The server is stateless: each `POST` is answered on its own with JSON, there are no sessions to resume, and `GET` returns `405`. Without a valid key or sign-in it answers `401`, which tells sign-in clients where to sign in. Requests from a browser page on another origin are refused with `403`.

The tools, resources and prompts you see follow the scopes of the key or sign-in, so a read-only connection never lists a tool that writes.

## Local MCP through the desktop app

The Avazal desktop app runs a local MCP server for agents on your computer, so they don't need a key. Each agent posts as an identity, such as `@claude`, rather than as you.

### Add an agent from Settings

Open **Settings → Identities** in the desktop app. Under **This computer**, choose **Add** next to Claude Code, Codex or Cursor. Avazal writes the entry into that agent's MCP config, and the agent connects the next time it starts. **Remove** takes the entry out and revokes the key it used.

### Add it by hand

Each entry runs the `avazal` CLI that ships inside the app. These are the entries Avazal writes; edit the path if the app is somewhere other than `/Applications`.

```json Claude Code (~/.claude.json) theme={null} theme={null}
{
  "mcpServers": {
    "avazal": {
      "type": "stdio",
      "command": "/Applications/Avazal.app/Contents/Resources/bin/avazal",
      "args": [
        "mcp",
        "--client",
        "claude-code"
      ],
      "env": {}
    }
  }
}
```

```toml Codex (~/.codex/config.toml) theme={null} theme={null}
[mcp_servers.avazal]
command = "/Applications/Avazal.app/Contents/Resources/bin/avazal"
args = ["mcp", "--client", "codex"]
```

```json Cursor (~/.cursor/mcp.json) theme={null} theme={null}
{
  "mcpServers": {
    "avazal": {
      "command": "/Applications/Avazal.app/Contents/Resources/bin/avazal",
      "args": [
        "mcp",
        "--client",
        "cursor"
      ]
    }
  }
}
```

Codex reads `$CODEX_HOME/config.toml` when `CODEX_HOME` is set. For any other agent, use **Other agents → Show config** under **This computer**, which gives the same entry without `--client`.

### How `avazal mcp` works

```bash theme={null}
avazal mcp [--client <name>] [--as <handle>]
```

`avazal mcp` is a stdio MCP server that relays every message to the desktop app at `http://127.0.0.1:29981/mcp`. The app picks an identity for the client, uses a key it holds for that identity, and forwards the call to the remote server. Only programs on your computer can reach the local server.

* `--client` names the agent: `claude-code`, `codex`, `cursor` or anything else. It decides the identity.
* `--as <handle>` posts as a specific identity, such as `--as claude`.

The first time a client connects, the app uses the identity you picked for it before, or your only identity, or one named after the client, such as Claude for Claude Code. If you have none, it creates one named after the client that can read, write and send messages, read and write tasks, and read people and search. If you have several and none fits, the app asks you to choose.

If the desktop app is closed, calls fail with "Avazal isn't running. Open the Avazal desktop app and try again." The relay reconnects on the next call once the app is open.

## Tools

The server has a small set of tools shaped around jobs, such as `search`, `read`, `send` and `task`, instead of one tool per operation. Each tool picks an API operation with its `action` or `type` field and passes the rest of its input to that operation, so `task {"action": "update", "id": "ENG-123", "done": true}` calls `tasks.update` and returns the same JSON. A key sees only the tools, actions and fields its scopes allow. Tools carry the hints for the highest [risk](https://docs.avazal.com/authentication.md#risk) among their actions.

A failed call comes back as a tool result with `isError: true` and the API's error body, such as `{"_tag":"ScopeRequired","scope":"messages:send",…}`, so the agent can read why. A field the action doesn't take is refused with the fields it does take.

The [tool catalogue](https://docs.avazal.com/mcp-tools.md) lists every tool and action with its operation, scope and risk. Add `?tools=operations` to the MCP URL for one tool per operation instead.

## Resources

Records with a stable address are also resources, read with `resources/read`. `resources/templates/list` returns the templates the key can use, and `resources/list` returns your documents a page at a time.

| URI template | Reads with | What it returns |
| - | - | - |
| `avazal://conversations/{id}` | `read (type conversation)` | Read a conversation |
| `avazal://messages/{id}` | `read (type message)` | Read a message |
| `avazal://files/{id}` | `read (type file)` | Read a file |
| `avazal://people/{id}` | `read (type person)` | Read a person |
| `avazal://lists/{id}` | `read (type list)` | Read a list |
| `avazal://tasks/{id}` | `read (type task)` | Read a task |
| `avazal://documents/{id}` | `read (type document)` | Read a document |
| `avazal://events/{id}` | `read (type event)` | Read an event or booked meeting |
| `avazal://triggers/{id}` | `read (type trigger)` | Read a trigger |

## Prompts

Prompts are ready-made tasks. Clients show them in their prompt or slash-command menu, and each appears only when the key has the scope it needs.

| Prompt | What it does | Arguments | Scope |
| - | - | - | - |
| `triage_inbox` | Walk the inbox and suggest what to reply to, archive or ignore. | `tab` (optional) | `messages:read` |
| `draft_reply` | Read a mail thread and prepare a reply for review. | `threadId`, `intent` (optional) | `messages:write` |
| `catch_up_chat` | Summarise unread chat conversations and what needs an answer. | None | `messages:read` |
| `read_link` | Open a pasted Slack message, thread, List, canvas or Avazal link and summarise it. | `url` | `search:read` |
| `prepare_meeting` | Gather context on an event's attendees from mail, chat and documents. | `eventId` | `events:read` |

## Server instructions

On `initialize` the server returns short instructions for the model: how tools map to the API, where to start, how pages and pasted links work, and to confirm before outward tools. When the key belongs to an identity, they also name the identity, its @handle and its own instructions.


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