# Connect an assistant

> The standard way to connect an assistant to The Margin: sign in once, choose All your workspaces, and let it add and find things with a short reason on every change. Covers the access token fallback, how its changes are marked, and the voice tools.

This page is the recipe for connecting any assistant to The Margin, whether it
is a chat app, a voice assistant on a speaker or a script you wrote. It works
the same way for every assistant. The details of every tool are in
[Agents and MCP](https://themarginapp.com/docs/agents-and-mcp).

## The standard way: sign in and approve

The assistant connects to `https://mcp.themarginapp.com/mcp` and signs you in
with OAuth 2.1. It asks for the `mcp` scope, which lets it use the tools and
nothing else: it cannot reach the app's own sync or account settings.

1. The assistant opens a browser page on themarginapp.com. Sign in if you are
   not already.
2. If you are in more than one workspace, pick which ones it may use. Choose
   **All your workspaces, including ones you join or create later** to give it
   everything, now and from here on. With one workspace, tick **Also include
   workspaces you join or create later** on the next page instead.
3. The approval page names the app, shows the website you go back to and says
   what it can do. Press **Allow access**.

An assistant with All your workspaces follows your membership. A workspace you
create or join next month is included on its next call, and one you leave or
are removed from drops out at once. Nobody has to reconnect anything.

Some assistant apps are registered with The Margin ahead of time, so the
approval page shows their own name instead of "Not verified by The Margin". An
app that runs on your own computer can finish signing in on any free local
port. Every other app registers itself the first time it connects, and that
works too.

## The fallback: an access token

For an assistant that cannot open a browser, make a token in
**Settings → Agents and apps**:

1. Type the assistant's name, for example "Kitchen speaker". That name is how
   its changes are marked.
2. Tick **All workspaces, including ones you join or create later**.
3. Press **Generate** and copy the token. It is shown once.

The assistant sends it on every request as `Authorization: Bearer <token>` to
`https://mcp.themarginapp.com/mcp`. A token lasts a year. Pause or revoke it in
the same place, and it stops working on its next call.

## How its changes are marked

Everything an assistant adds or edits carries a small mark: "Added by Alex
through Kitchen speaker". The connection is named after the token's name, or
after the app's own name for a sign-in, and you can rename it under
**Connected agents** in Settings. Ask the assistant to give a short `reason`
with each change and the mark shows that too: "Added by Alex through Kitchen
speaker: for Saturday's lunch". See [Who added what](https://themarginapp.com/docs/agents-and-mcp#who-added-what).

## How it should write

The recommended setting for any assistant is to write directly, with a reason
on every change, and to ask before anything destructive.

- Every tool says what kind it is. `readOnlyHint` marks a tool that only reads,
  and `destructiveHint` one that deletes or overwrites (every `delete_`,
  `remove_` and `update_` tool).
- Adding and finding run straight away. A voice assistant should read back what
  it is about to do and wait for a spoken yes before it calls any tool marked
  `destructiveHint`. Chat apps such as the desktop assistants already ask you
  before those calls.
- Mistakes are cheap to fix. A deleted note, card, board, recipe, checklist or
  whiteboard stays in **Recently deleted** for 30 days, and `undo` takes back
  the last thing the assistant added or changed.

## Tools made for voice

A voice assistant hears one sentence at a time and reads its answer aloud, so
four tools are shaped for that.

- **`capture(text, source?, workspace_id?)`** files one spoken sentence where
  it belongs: "add milk and eggs to the shopping list" becomes two shopping
  items, "remind me to call the school tomorrow at nine" a reminder, "dentist
  on Friday at three" an event, "fix the gate latch" a task, and anything else
  an Inbox note, where The Margin suggests a title and a home as it does for
  your own captures. The answer says what it made and where, and carries an
  `undo_id`.
- **`voice_search(query, limit=5)`** answers in one short line per result:
  what it is, its title, its due date and a snippet, with its id. The whole
  answer stays under about 600 characters.
- **`undo(undo_id?)`** reverses that write. With no id it reverses the
  connection's own last add or edit from the past 24 hours.
- **`changes_since(cursor?, types?, workspace_id?)`** lists what changed since
  the cursor it handed back last time. Use it to stay current when the
  assistant cannot receive webhooks, for example on a home network.

Every create tool also takes an `idempotency_key`. Send the same key again
within 24 hours, say after a timeout, and you get the first answer back
instead of a second card or item.

> **Known limit: Which plans** Connecting an outside assistant is part of Pro, Family and Team, and of any
> running trial. A Free workspace refuses the connection with a sentence saying
> so. See [Plans and limits](https://themarginapp.com/docs/plans-and-limits).

**Where to next**

- [Agents and MCP](https://themarginapp.com/docs/agents-and-mcp): every tool, the sandbox and the working rules
- [Voice](https://themarginapp.com/docs/voice): speaking captures inside the app itself
- [Agent Pacts](https://themarginapp.com/docs/agent-pacts): when several agents share one job


---

Section: Control and connections. Checked against the running product on November 21, 2026.
Web page: <https://themarginapp.com/docs/connect-an-assistant>. Every docs page: <https://themarginapp.com/docs/llms.txt>
