Sign up (with export icon)

Set up Coauthor

Show the table of contents

Coauthor runs in the Collaboration Server On-Premises image. It needs no extra container and no switch. Your license key turns it on. This page takes you from the license key to a first edit by an agent. After each step, a You should see line tells you how to check it.

Coauthor gives your AI agents tools to read and edit documents through the Model Context Protocol (MCP). To learn what it does, see the Coauthor guides.

Choose your path

The same image runs with collaboration and without it. Your license decides which one you get. It includes Coauthor and collaboration, or Coauthor only. We tell you which one when we send it. If your editors use your server now, it has collaboration.

With collaboration Without it
Your license includes Coauthor and collaboration Coauthor only
Documents Live documents, uploaded documents and snapshots Uploaded documents and snapshots
Who opens sessions Your backend, Claude Code, or a chat app Your backend only

Without collaboration, there are no live documents. Claude Code and chat apps open their own sessions, and they work on live documents only. So they do not work on this path. Your backend opens every session, and gives the session token to your agent. Document types explains the three types.

Some steps differ by path. Those steps have a part for each one.

Before you start

Have these ready:

  • A license that includes Coauthor. During Early Access, contact us to get one.
  • Your editor bundle, with CKEditor 5 v49.0.0 or later. Step 5 adds DocumentCompare to it.
  • 2 CPU and 4 GB of memory for each container that runs sessions. Step 3 sets the memory limit. Metrics shows how to watch it.

1. Install or update the server

Update a running server

With an online license, you need to do nothing. When we add Coauthor to your license, your server gets it on its own.

With an offline license, you need a new license key. Get your License key shows where to find it. Then:

  1. Set the new key in LICENSE_KEY everywhere you set it now.
  2. Restart the containers. A rolling restart works, one container at a time. Open editing sessions keep working. Finish the restart before you go on.

New install

Set up the server as these pages describe. Coauthor needs nothing more than a normal install:

  1. Check the Requirements.
  2. Follow Installation. It sets up the SQL database, Redis and the server. Docker and Kubernetes show full examples.
  3. Set LICENSE_KEY to your license key.

With Coauthor only, live documents and collaboration are not available. Coauthor, the Management Panel and the bundle upload work as usual.

You should see: each container is running, and <your server URL>/health answers 200.

2. Set the external endpoint (only if needed)

APPLICATION_EXTERNAL_ENDPOINT is the public URL of your server, such as https://cs.example.com. Coauthor needs it in two cases:

  • A chat app signs in with OAuth from another machine. Coauthor checks that each token was made for this URL. If you leave it empty, Coauthor uses http://localhost:8000, and an app on another machine cannot sign in. You also need to register your own login server. This case needs collaboration, because chat apps work on live documents.
  • You run a separate Collaboration Worker, and your agent edits live documents. The worker runs editors in the background, and they join each document through this URL. Set the same value on each worker container.

In all other cases, you can leave it empty. That includes the built-in worker, and uploaded documents only. A token signed with your access key needs no OAuth.

If you set it, use a full URL that starts with http:// or https://. Otherwise, the server does not start. Restart the containers after you set it.

You should see: <APPLICATION_EXTERNAL_ENDPOINT>/health answers 200.

3. Set container memory

Give each container that runs sessions 2 CPU and 4 GB, with a memory limit on the container itself. Limits shows which containers, and how to set it.

You should see: after a restart, the container logs do not show The container memory monitor is disabled. If they show it, see Containers without a memory limit.

4. Create an environment and keys

Create an environment, an access key and an API secret in the Management Panel. With collaboration, you can use the environment that your editors use now.

To script it, use the Management REST API. Creating an environment in Node.js creates the environment and the access key. Wait at least 10 seconds before you add the API secret.

The commands on this page read these shell variables:

export CS_URL='<your server URL>'   # for example https://cs.example.com, with no / at the end
export ENVIRONMENT_ID='<environmentId>'
export TOOLKIT_URL="$CS_URL/toolkit/v1/environments/$ENVIRONMENT_ID"

5. Upload the editor bundle

Add DocumentCompare to your editor bundle, and upload it under a new version. Add DocumentCompare to your editor bundle shows how, with the on-premises address. With collaboration, switch your editors to the new version too.

If you start from the upload script in the Quick start, make two changes:

  1. Send the upload to <your server URL>/api/v5/<environmentId>/editors instead of the cloud address.
  2. Without collaboration, leave out RealTimeCollaborativeEditing, RealTimeCollaborativeComments and RealTimeCollaborativeTrackChanges.

Set the version that you uploaded:

export BUNDLE_VERSION='<bundleVersion>'

6. Connect your agent

  • The MCP address is $TOOLKIT_URL/mcp. See Find the MCP address.
  • Tokens: your backend signs them with the access key. See Authentication.
  • Without collaboration, your agent cannot open sessions itself. The openSession tool works on live documents only. So your backend opens each session over REST, as in step 7, and gives the session token to your agent. With that token, the agent connects to the MCP address and edits the document.
  • The steps that every agent takes are in Connect an agent.

7. Test it

With collaboration

Follow Example 1: Claude Code in the Quick start, with two changes:

  • Set COAUTHOR_URL to your TOOLKIT_URL.
  • Use the ID of a document that is open in your editor, instead of pricing.

You should see: Claude Code edits the document, and the change arrives in your editor.

Without collaboration

Your backend opens a session on an uploaded document. Your agent edits it, and finishes the session. Then your backend reads the edited document. Here, curl plays both parts. It calls the same tools as an agent does over MCP, in their REST form.

First, sign a backend token with sessions:open, sessions:read, sessions:apply and sessions:close on all documents (*). Set it in BACKEND_TOKEN.

  1. Open a session with the bundle version from step 5:

    curl -sS -X POST "$TOOLKIT_URL/sessions" \
    	-H "Authorization: Bearer $BACKEND_TOKEN" -H 'Content-Type: application/json' \
    	-d '{ "target": { "type": "uploaded", "bundleVersion": "'"$BUNDLE_VERSION"'", "document": { "content": { "data": "<p>The plan costs $30 per month.</p>" } } }, "actor": { "id": "setup-agent", "name": "Setup agent" }, "appliedBy": "agent", "finishBy": "agent" }'

    You should see: JSON with id, token and expiresAt. Copy the values:

    export SESSION_ID='<id>'
    export SESSION_TOKEN='<token>'
  2. As the agent, edit the document with the session token:

    curl -sS -X POST "$TOOLKIT_URL/sessions/$SESSION_ID/tools/editDocument" \
    	-H "Authorization: Bearer $SESSION_TOKEN" -H 'Content-Type: application/json' \
    	-d '{ "edits": [ { "oldString": "$30 per month", "newString": "$35 per month" } ] }'

    You should see: JSON with "accepted": true.

  3. As the agent, finish the session. This applies the edit and closes the session:

    curl -sS -X POST "$TOOLKIT_URL/sessions/$SESSION_ID/tools/finish" \
    	-H "Authorization: Bearer $SESSION_TOKEN" -H 'Content-Type: application/json' \
    	-d '{}'

    You should see: JSON with operations above 0.

  4. As the backend, check the session:

    curl -sS "$TOOLKIT_URL/sessions/$SESSION_ID" -H "Authorization: Bearer $BACKEND_TOKEN"

    You should see: "status": "closed", and lastApply with operations above 0. If the status is still open, wait a second and run it again.

  5. As the backend, read the edited document:

    curl -sS "$TOOLKIT_URL/sessions/$SESSION_ID/document" -H "Authorization: Bearer $BACKEND_TOKEN"

    You should see: document.content.data holds The plan costs $35 per month.

Your own agent makes the same calls over MCP, with the session token.

Troubleshooting

HTTP 403 license-has-no-rights-to-service on a Coauthor call

Check that you set the new LICENSE_KEY everywhere, and restart the containers.

HTTP 403 license-has-no-rights-to-service on a live document

Your license does not include collaboration. Live documents and the editors of your application need it. Use uploaded documents or snapshots. Or contact us for a license with collaboration.

HTTP 400 bundle-missing-plugin

The bundle of the session has no DocumentCompare. For a live document, the editors still use an old bundle. Add DocumentCompare, and upload the bundle under a new version, as in step 5. For live documents, switch your editors to it.

HTTP 400 editor-too-old

The bundle uses an older CKEditor 5. Build the bundle with CKEditor 5 v49.0.0 or later, and upload it under a new version.

HTTP 503: the editor is busy

The message is The editor is busy and could not run this call in time. Every container that runs sessions is full, or near its memory limit. Wait a moment, and try again. If it keeps happening, add containers. See Limits and scaling.

HTTP 409 on the bundle upload

You uploaded this bundleVersion before. Upload under a new version, and set it in BUNDLE_VERSION.

The server does not start after you set APPLICATION_EXTERNAL_ENDPOINT

The value is not a full URL. Use a URL that starts with http:// or https://, such as https://cs.example.com.

A chat app cannot sign in

APPLICATION_EXTERNAL_ENDPOINT is empty, or not the URL that the app reaches. Set it to the public URL of your server, as in step 2.

Errors in the API reference lists every Coauthor error.

Next steps