Set up Coauthor
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.
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.
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
DocumentCompareto 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.
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:
- Set the new key in
LICENSE_KEYeverywhere you set it now. - Restart the containers. A rolling restart works, one container at a time. Open editing sessions keep working. Finish the restart before you go on.
Set up the server as these pages describe. Coauthor needs nothing more than a normal install:
- Check the Requirements.
- Follow Installation. It sets up the SQL database, Redis and the server. Docker and Kubernetes show full examples.
- Set
LICENSE_KEYto 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.
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.
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.
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"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:
- Send the upload to
<your server URL>/api/v5/<environmentId>/editorsinstead of the cloud address. - Without collaboration, leave out
RealTimeCollaborativeEditing,RealTimeCollaborativeCommentsandRealTimeCollaborativeTrackChanges.
Set the version that you uploaded:
export BUNDLE_VERSION='<bundleVersion>'- 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
openSessiontool 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.
Follow Example 1: Claude Code in the Quick start, with two changes:
- Set
COAUTHOR_URLto yourTOOLKIT_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.
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.
-
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,tokenandexpiresAt. Copy the values:export SESSION_ID='<id>' export SESSION_TOKEN='<token>' -
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. -
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
operationsabove0. -
As the backend, check the session:
curl -sS "$TOOLKIT_URL/sessions/$SESSION_ID" -H "Authorization: Bearer $BACKEND_TOKEN"You should see:
"status": "closed", andlastApplywithoperationsabove0. If the status is stillopen, wait a second and run it again. -
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.dataholdsThe plan costs $35 per month.
Your own agent makes the same calls over MCP, with the session token.
Check that you set the new LICENSE_KEY everywhere, and restart the containers.
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.
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.
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.
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.
You uploaded this bundleVersion before. Upload under a new version, and set it in BUNDLE_VERSION.
The value is not a full URL. Use a URL that starts with http:// or https://, such as https://cs.example.com.
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.
- Limits and scaling shows how many sessions a container keeps, and how to scale.
- Metrics shows what to watch, and when to add containers.
- Connect an agent shows how your agent works on a document.
- Document types helps you choose what your agent edits.
- Security and compliance shows what data Coauthor keeps, and for how long.