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

# Connect an agent

> Point Claude Code, Cursor, Codex or Claude.ai at your own install.

Every organisation gets an MCP endpoint on your install, addressed by the org's slug:

```
https://craftspace.example.com/mcp/<org-slug>
```

Authentication is OAuth. Clients register themselves dynamically, so there is no key to copy and no token
to paste.

You do not have to assemble any of this by hand. **Settings, then MCP** has your endpoint and a ready-made
command per client, and the page tells you the moment an agent connects.

<Frame caption="Settings, then MCP. Copy the line for your client and run it.">
  <img src="https://mintcdn.com/craftspace/SiaoGlGo-jgJemnj/images/settings-mcp.png?fit=max&auto=format&n=SiaoGlGo-jgJemnj&q=85&s=0e3d4c33b83c061d5832f50dc6643d60" alt="The MCP settings screen with per-client setup commands" width="2880" height="1800" data-path="images/settings-mcp.png" />
</Frame>

## Claude Code

```sh theme={null}
claude mcp add --transport http craftspace-<org-slug> https://craftspace.example.com/mcp/<org-slug>
```

Then `/mcp` in a session to complete the sign-in.

## Cursor, Codex and anything else that speaks MCP

Point it at the same URL over streamable HTTP. Clients that only support the older SSE transport will not
work.

## What an agent can do

| Tool              | What it does                               |
| ----------------- | ------------------------------------------ |
| `list_pages`      | The tree, with each space and its id       |
| `search_pages`    | Hybrid search across the space             |
| `read_page`       | One page's body                            |
| `upsert_page`     | Write or update a page                     |
| `upsert_decision` | Record a hard-to-reverse call              |
| `call_tool`       | Reach a connected tool through the gateway |

Writes are live immediately and there is no in-app undo, so an agent should search before it creates and
extend an existing page rather than adding a near-duplicate.

## Gotchas

* **The endpoint is on your install, not ours.** Your install is its own OAuth authorization server, which
  is why nothing about the issuer moves when other things do.
* **A bare `/mcp` still works** and falls back to a default organisation for the account. The addressed
  form wins when both could apply.
* **Loopback and https only.** Redirect URIs are limited to `http` on loopback (for CLI agents), `https`,
  and Cursor's registered scheme. Anything else is refused at registration.
