# Connect AI agents to CoPage

> CoPage is built for AI agents and people to work on the same diagrams and decks. Your agent (Claude Code, Codex, Cursor, GitHub Copilot, Claude or ChatGPT) connects over MCP in one step, then builds, checks and fixes the work while you watch, comment and sign off.

CoPage is made for two kinds of users at once: AI agents and the people they work for.

- **Agents** get tools made for them. They create and edit diagrams and decks in small, atomic batches of edits,
  look at a render of what they made, run checks and fix what the checks find, and answer comments.
- **People** get an editor where the agent's changes appear live. You comment to the agent the way you would to a
  colleague, change anything by hand (the agent builds on your edits), and sign off. One agent edits a document at a
  time, and anyone on it can stop the agent.

Connecting takes one step, because CoPage speaks the Model Context Protocol (MCP), which these agents already support.
There's no plugin to write and no SDK:

- **Coding agents** (Claude Code, Codex, Cursor, VS Code with GitHub Copilot): `copage connect <agent>` writes the
  agent's settings for you.
- **Claude and ChatGPT:** add CoPage as a connector and sign in. (CoPage app, early access)

There are two servers, and an agent can have both:

| Server name | Where the documents are | How to add it |
| --- | --- | --- |
| `copage-local` | Your computer: a project's `.copage` folder, or `~/.copage` | `copage connect <agent>` (free CLI, no account) |
| `copage` | The CoPage app (hosted, early access): decks and diagrams in your workspace | `copage connect <agent> --cloud`, a command with an API key, or a connector with sign-in (OAuth) |

Nothing moves between the two by itself. A diagram goes from your computer to the app only when you copy it
(`copage diagram upload`, or the local server's `upload_to_cloud`).

## The local server (copage-local)

The free CLI has its own MCP server for diagrams on your computer. It needs no account: [install the
CLI](/docs/cli#install), then run one command for your agent.

```bash
copage connect claude     # or cursor | vscode | codex | all
```

It registers `copage mcp` as a stdio server named `copage-local` in the agent's user-level settings: Claude Code
through `claude mcp add --scope user`, Cursor in `~/.cursor/mcp.json`, VS Code in its user `mcp.json`, Codex in
`~/.codex/config.toml`. The server works on the diagrams of the place you ran `copage connect` in: the project's
`.copage` folder, or `~/.copage` outside a project. `--print` shows the configuration instead of writing it. Nothing
goes to CoPage's servers unless you ask for a copy. The local server has no deck tools: decks live only in the app.

## The CoPage app's server (copage) (CoPage app, early access)

The MCP URL is:

```text
https://copage.semerjyan.dev/mcp
```

The app is at copage.app. Agents and the CLI use copage.semerjyan.dev, which serves the same app, because some
company web filters still block copage.app as a newly registered domain.

The agent acts in your workspace as you. Every change it makes is recorded in the document's history as made by
that agent for you. Account → AI agents lists your agents' keys and lets you revoke them.

### With the CoPage CLI (coding agents)

The quickest way: [install the CLI](/docs/cli#install) (version 0.3.0 or later), then run one command for your agent.

```bash
copage connect claude --cloud     # or cursor | vscode | codex | all
```

It opens your browser: check that the code matches, pick a workspace and allow it. The agent gets its own key
(named after the agent and the computer), written into its user-level settings, never into a repository. Restart
the agent to load CoPage. `copage skill install --global` also teaches it the CLI in every project.

### By hand, with an API key

Create a key in the app under Account → AI agents, then add the server. Replace `dk_your_key` with your key.

Claude Code:

```bash
claude mcp add --transport http --scope user copage https://copage.semerjyan.dev/mcp --header "Authorization: Bearer dk_your_key"
```

Codex (macOS and Linux):

```bash
export COPAGE_API_KEY=dk_your_key && codex mcp add copage --url https://copage.semerjyan.dev/mcp --bearer-token-env-var COPAGE_API_KEY
```

Cursor (`~/.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "copage": {
      "url": "https://copage.semerjyan.dev/mcp",
      "headers": { "Authorization": "Bearer dk_your_key" }
    }
  }
}
```

VS Code with GitHub Copilot (the user `mcp.json`):

```json
{
  "servers": {
    "copage": {
      "type": "http",
      "url": "https://copage.semerjyan.dev/mcp",
      "headers": { "Authorization": "Bearer dk_your_key" }
    }
  }
}
```

The app's "Connect your AI agent" dialog shows the same commands with your key filled in, and one-click install
links for Cursor and VS Code.

If Claude Code says `copage` already exists, that's the CLI's local server under its old name (CLI 0.2.2 and
earlier): run `copage update`, then `copage connect claude` (it becomes `copage-local`), and add the app's server
again.

### Claude and ChatGPT (connectors)

Chat apps without a terminal add CoPage as a custom connector with the MCP URL above and sign in with OAuth: no
key to copy.

- **Claude** (claude.ai and the desktop app): Settings → Connectors, add a custom connector named CoPage with the
  URL, then connect: sign in to CoPage and allow it.
- **ChatGPT**: turn on Developer mode in Settings (in a company workspace, an admin allows custom connectors), add a
  connector with the URL and OAuth sign-in, then sign in to CoPage and allow it. Custom connectors need a paid
  ChatGPT plan, and on some plans they can only read.

On the consent page you see which app asks, where it sends you back, and pick the workspace and the access: edit,
or read only. A read-only connection doesn't get the tools that change anything. Each connection appears under
Account → AI agents; revoking it ends the connection.

The CoPage app is in early access: [request access](/#early-access).

## What agents can do

The main tools, by name:

| Tool | What it does |
| --- | --- |
| `get_view` | What the person has open: the document, current slide, selection and open comments |
| `get_guide` | CoPage's reference by topic: ops, elements, diagrams, assets, themes, checks, design |
| `list_decks`, `get_deck` (CoPage app, early access) | List decks; read one as an outline or JSON |
| `create_deck`, `edit_deck` (CoPage app, early access) | Make a deck from a template and theme; apply edit ops, all or none |
| `render_slides` (CoPage app, early access) | See slides as images: one slide, or a contact sheet of the deck |
| `create_diagram`, `edit_diagram`, `get_diagram` | Make, edit and read diagram documents |
| `render_diagram` | See a diagram as a PNG, to check layout, overlaps and labels |
| `fork_diagram` | Copy a diagram, for example to change it on one slide only |
| `import_drawio`, `export_drawio` | Bring in and write draw.io files |
| `find_assets`, `get_asset` | Search icons (AWS, Azure, Google Cloud, general), diagrams, components and images |
| `add_asset`, `update_asset`, `save_component` | Upload images and icons, organise them, save reusable components |
| `get_catalog` (CoPage app, early access), `save_theme` | List themes, layouts and templates; save a brand theme |
| `check_deck` (CoPage app, early access), `check_diagram`, `list_rules` | Run check packs and list the check library ([Checks](/docs/checks)) |
| `save_ruleset` | Save a pack of library checks, such as "Board meeting" |
| `list_comments` (CoPage app, early access) | Comments on a deck: whom each is for, where it is, replies |
| `get_changes`, `restore_version` | Who changed what, and going back to an earlier version |
| `finish_editing` | Let other agents in when done |
| `export_file` (CoPage app, early access) | Save a deck as PDF, a slide or diagram as PNG, a diagram as .drawio, on your machine |
| `list_skills`, `get_skill`, `save_skill` (CoPage app, early access) | The workspace's guidance for agents, and saving your own |
| `upload_to_cloud` | Local only: copy a diagram from your computer to the app |

## How people stay in charge

- **One agent at a time.** While an agent edits a document, other agents can only read and comment. The lease ends
  when it calls `finish_editing` or after 5 idle minutes. People can always edit, and can stop an agent from the
  editor.
- **Hand edits are kept.** Agents are told what people changed since their last edit, so they build on it instead
  of undoing it.
- **Comments are instructions.** A comment addressed to "Your agent" is a request for your agent; it replies and
  resolves it. Comments between people stay theirs.
- **Limits per document.** People can set a document to comments only for agents, or lock finished slides.
- **Version history.** Each change is attributed to a person, or to an agent acting for one. Versions from the last
  30 days can be restored, and a version a person marks with a status is kept for good.

## Questions

### What is the CoPage MCP server URL?

https://copage.semerjyan.dev/mcp. Coding agents send an API key as a Bearer token; Claude and ChatGPT connectors
sign in with OAuth.

### Which AI agents work with CoPage?

Claude Code, Codex, Cursor and VS Code with GitHub Copilot, through the CLI or an API key, and Claude (claude.ai
and the desktop app) and ChatGPT as custom connectors.

### What is the difference between copage-local and copage?

`copage-local` is the free CLI's server: diagrams in a folder on your computer. `copage` is the CoPage app's server:
decks and diagrams in your workspace in the cloud. An agent can have both; nothing moves between them unless you
copy it.

### Can an agent change a document while I'm editing it?

Yes, both can edit at once and you see the agent's changes live. Only one agent edits a document at a time, and you
can stop it from the editor.

### How do I revoke an agent's access to CoPage?

In the app, open Account → AI agents and revoke its key or connection. `copage auth logout` revokes the CLI's own
key.
