This is not the same as the documentation MCP server at
https://docs.sajn.se/mcp. That one only searches these docs and needs no login. The sajn MCP server connects to your real account data and requires authentication.Server URL
Authentication
The sajn MCP server uses OAuth 2.0 and is bound to a single workspace. Most MCP clients (Claude, Cursor, …) discover and complete OAuth automatically. When you add the server, the client opens a sajn consent screen where you pick the workspace and approve the scopes the assistant may use. Read-only access is the default — write and destructive tools only appear after you grant the matching scope. There are no tokens to copy or rotate; the client refreshes them for you. Every request enforces the samerole ∩ scope rule as the REST API.
Scopes and permissions
Every tool declares the OAuth scopes it needs, and the tool list is filtered to what your connection is allowed to see — a read-only connection never even lists the write tools. On top of that, your workspace role is re-checked on every call, so an assistant can never do more than you can.
Some tools need a workspace permission as well as a scope — most notably the developer tools, which require Manage developer (API logs) or Manage webhooks, so only developers can read raw traffic.
Tools
Finding documents
Reading a document
Building a document
Filling in values
fillFields covers form fields and fields on an uploaded PDF — both the PDF’s own form fields and any fields placed on top of it. Slots assigned to a party are listed but not writable: those are filled by that party at signing.
Parties
Sending and following up
Templates, contacts and folders
Developer tools
These are the tools for diagnosing an integration. They are read-only unless noted, and each needs a workspace permission on top of its scope.Uploading a PDF
A tool call carries JSON, not file bytes, so the file itself never goes through the MCP connection. How it reaches sajn depends on whether the assistant can run shell commands or raw HTTP requests. Assistants that can run commands (Claude Code, agents with a shell tool) upload on their own:createDocumentcreates the draft.createUploadUrlreturns a single-use upload URL and anuploadKey.- The assistant sends the file to that URL in a
PUTrequest. attachFileToDocumentadds the file to the document. Word, Excel, and other Office files are converted to PDF at this step.
- The assistant calls
createDocumentand gives you the link it returns. - You open the link and drag the PDF onto the document.
- You tell the assistant it’s uploaded, and it continues —
listFieldsto see the PDF,listFillableFieldsto see what can be filled in, then parties and sending as usual.
The link is an ordinary document URL, not a token — opening it requires your own sajn login. An assistant that asks you to paste a document’s contents into the chat is getting it wrong.
Importing signed agreements into the archive
To add agreements that were signed outside sajn, ask the assistant to import them into the archive. It creates one document per file withtype set to ARCHIVE_IMPORTED, titled after the file name, and attaches the file through either of the preceding routes.
Setup
- Claude Code
- Claude Desktop
- Cursor
- VS Code
Example prompts
Working on documents- “Draft an NDA from our standard template, add Anna at Ribban as signer with BankID, and show it to me before sending.”
- “What’s still missing on the Volvo agreement before I can send it?”
- “Fill in the amount as 45 000 SEK and the start date as 1 September, then send it.”
- “Add a price table with 10 hours of consulting at 1 200 SEK, 25% VAT.”
- “Which documents are waiting for signatures, and who’s holding them up?”
- “Remind everyone who hasn’t signed the Q3 contracts.”
- “What expires in the next 30 days?”
- “Push the deadline on the Ribban agreement out by two weeks.”
- “List the failed webhook deliveries from the last day and show me the response body of the first one.”
- “Find the API requests that returned 4xx today and tell me what’s wrong with them.”
- “Which webhook endpoint is failing, and what status code is it returning?”
What the MCP server does not do
Some things are deliberately kept in the sajn app rather than exposed to a connected assistant:- Approving or rejecting a document — approval is a person accepting responsibility, so it happens where you can see the document.
- Members, roles and permissions — account administration isn’t something a connected app should reach.
- Deleting templates, contacts or folders — destructive on shared assets the whole workspace depends on.
- Reports, statistics and organization settings.
Security
- Workspace-scoped — a connection only ever sees data in the workspace you approved at consent.
- Least privilege — tools are filtered to the granted scopes; read-only by default, and developer tools are further gated behind a workspace permission.
- Same enforcement as REST — scopes and role permissions are re-checked on every tool call, not just at listing time.
- Confirmation hints — tools that email or SMS a counterparty, or destroy work, are marked destructive so your client can prompt first.
- Rate limited — per-IP and per-organization limits apply, the same as the REST API.
Troubleshooting
Tool names changed — my scripts broke
Tool names changed — my scripts broke
Tool names are now camelCase and match the platform’s own vocabulary:
list_documents → listDocuments, get_document → getDocumentDetails, send_document → sendDocument, withdraw_document → withdrawDocument, delete_document → deleteDocument, send_reminders → sendDocumentReminder, list_templates → findTemplates, get_template → getTemplateDetails, search_contacts → findContact, create_contact → createContact.The developer tools (whoami, list_api_logs, get_api_log, webhook and sajn ID tools) kept their names.The debugging tools don't show up
The debugging tools don't show up
The connection must have the
audit:read scope and the member must hold the matching workspace permission — Manage developer for API logs, Manage webhooks for deliveries. Re-run the OAuth consent and make sure audit:read is granted.Connection rejected / 401
Connection rejected / 401
- Confirm the URL is
https://app.sajn.se/api/mcp(note/api/mcp, not/mcp). - The account must be on a paid plan.
- Reconnect the server and complete the OAuth consent flow again.
Write or delete tools are missing
Write or delete tools are missing
They are hidden until you grant the matching scope (
documents:write, documents:delete, contacts:write) at consent. Reconnect and approve the additional scopes.The assistant says it can't edit a sent document
The assistant says it can't edit a sent document
That’s correct — parties, fields and content are locked once a document is out for signing. Withdraw it with
withdrawDocument to make it a draft again (the parties are notified), or extend the deadline with extendDocumentExpiration if that’s all you need.Next steps
Choosing an authentication method
The OAuth flow above is for assistant clients — see which credential your own integration needs
Webhooks
Set up and debug webhook endpoints

