Skip to main content
The sajn MCP Server lets an AI assistant work in your live sajn workspaces — not just look at them. Find and read documents, draft them, fill them in, manage parties, send for signing, chase signatures, and follow status. It also carries the developer tools for debugging an integration: API request logs and outbound webhook deliveries. Install the sajn app in ChatGPT, or connect the server to Claude Desktop, Claude Code, Cursor, or any other MCP client. Then you run the everyday signing workflow from wherever you already work. It uses the same permission model as the REST API, so an assistant can never do more than you can.
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

The server is a stateless Streamable HTTP endpoint — every request carries its own bearer token, so any standard remote-MCP client works.

Authentication

The sajn MCP server uses OAuth 2.0. Most MCP clients, such as Claude, ChatGPT, and Cursor, find the server’s OAuth settings and start the sign-in themselves. The client opens the sajn consent screen, where you choose what the assistant gets:
  1. Pick a workspace.
  2. Pick a level for that workspace: Läs (read), Skriv (write), or Administrera (administer). Skriv is preselected.
  3. To add another workspace from the same organization, select Lägg till arbetsyta and repeat the first two steps.
  4. On the review step, use the ⋯ menu on a row to change its level, make it the default workspace with Gör till standard, or remove it.
  5. Select Godkänn.
The first workspace you pick is the default unless you change it. There are no tokens to copy or rotate: the client refreshes them for you. The server works on every plan. A workspace created after you connect is not added to the connection. To include it, reconnect the server and pick it.

Levels and permissions

Each workspace in a connection has its own level: A tool call passes four checks in the workspace it acts in, and each check can only narrow the one before it:
  1. The level you granted for that workspace.
  2. Your role in that workspace.
  3. The workspace’s policy for AI agents in Inställningar > AI.
  4. The workspace’s AI switch. A workspace with AI turned off refuses every tool call.
An assistant can therefore never do more than you can in that workspace. The tool list shows what your role and the agent policy allow. A call that needs a higher level than you granted returns an error that names the level it needs. Connections made before the levels existed hold per-resource scopes, such as documents:read, and keep working. Some tools need a workspace permission as well — most notably the developer tools, which require Manage developer (API logs) or Manage webhooks, so only developers can read raw traffic.

Working in several workspaces

A call acts in the default workspace unless it names another one. When a connection covers more than one workspace, every tool takes an optional workspaceId argument: the workspace’s id, slug, or name. The assistant fills it in, so you name the workspace in plain words, such as “create it in Juridik”.
  • getCurrentUser lists the connected workspaces and marks the default.
  • A call about an existing document runs in the workspace that holds the document, so you don’t name it.
  • Every result names the workspace the call acted in.
  • A workspace outside the connection is refused, and so is a name that two connected workspaces share. The error lists the connected workspaces.
A connection covers workspaces in one organization.

Tools

An MCP client loads every listed tool into every conversation, so the server lists only the 22 everyday tools. Every other tool is reached through findTools. The assistant does this itself: you ask in plain words, and it finds and runs the right tool. Each tool needs a level in the workspace it acts in, and most also need a permission in your role. Tools marked destructive send, delete, overwrite, or change access, so your client asks you before it runs them.

Everyday tools

Reaching the other tools

  1. findTools takes a description of the task, such as “invite a member”, and returns the best-matching tools with their input schemas.
  2. The assistant runs a read-only match with runReadOnlyTool and any other match with runTool.
A call through runTool or runReadOnlyTool passes every check that a direct call passes, including the level of the tool it runs. If findTools returns a match under blockedByPolicy, the workspace’s AI agent policy has switched that tool off. An administrator can allow it under Inställningar > AI. The ChatGPT app works differently: it lists its tools directly and has no findTools. It covers the everyday signing workflow: createDocument, findDocuments, sendPartyReminder, summarizeContent, getDocumentReadiness, getDocument, sendDocument, withdrawDocument, getSettings, updateSettings, getSigningMethods, setCustomFieldValue, getParties, addParty, updateParty, removeParty, getFields, getField, addTextField, updateTextField, addFormField, updateFormField, removeField, getFieldValues, setFieldValues, getDocumentFile, findTemplates, getTemplate, createContact, updateContact, findContactsByCustomField, findContacts, getContact, createCompany, submitForApproval, findActions, dismissAction, snoozeAction, findCustomFields, getUsage, reportMissingCapability, getCurrentUser.

All tools by area

Documents

Content and fields

setFieldValues writes values in form blocks and in fields on uploaded PDFs, both the PDF’s own form fields and fields placed on top of it. getFieldValues lists each value with who fills it. A value assigned to a party is read-only: that party fills it in when signing.

Parties

Signing methods and eID schemes are enabled market by market. Call getSigningMethods before setting a party’s signing method or identity check, rather than assuming a fixed list.

Approvals

Comments

Folders, tags and custom fields

Actions, reminders and notifications

Templates

Contacts, companies and products

sajn ID

Reports

Members and roles

Workspace and organization settings

Your account

Developer tools

Connection and support

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:
  1. createDocument creates the draft.
  2. createUploadUrl returns a single-use upload URL and an uploadKey.
  3. The assistant sends the file to that URL in a PUT request.
  4. addDocumentFile adds the file to the document. Word, Excel, and other Office files are converted to PDF at this step.
Other assistants hand the upload back to you:
  1. The assistant calls createDocument and gives you the link it returns.
  2. You open the link and drag the PDF onto the document.
  3. You tell the assistant it’s uploaded, and it continues — getFields to see the PDF, getFieldValues to 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.
Files can be PDF, Word, Excel, PowerPoint, CSV, or plain text, up to 25 MB.

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 with type set to ARCHIVE_IMPORTED, titled after the file name, and attaches the file through either of the preceding routes.

Setup

  1. Open the sajn app in the ChatGPT app directory.
  2. Connect the app.
  3. Sign in to sajn, pick the workspaces and a level for each, and select Godkänn.
The ChatGPT app covers the everyday signing workflow: drafting, filling in, parties, sending, and follow-up. It has no developer tools, and it doesn’t accept personal identity numbers. Add those to the party in sajn.

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.”
Following up
  • “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.”
Debugging an integration
  • “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?”

Security

  • Workspace-scoped — a connection only reaches the workspaces you picked at consent, all in one organization.
  • Least privilege — each call is checked against the level you granted for the workspace it acts in, and developer tools also need 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

The tools now share their names with the assistant built into sajn. The most common renames:For anything else, call findTools with what you want to do.
The member must hold the matching workspace permission — Manage developer for API logs, Manage webhooks for deliveries. A connection made before the levels existed also needs the audit:read scope. To get it, reconnect the server.
  • Confirm the URL is https://app.sajn.se/api/mcp (note /api/mcp, not /mcp).
  • Reconnect the server and complete the OAuth consent flow again.
The call needs a higher level than you granted for that workspace, such as Skriv to create or send. Reconnect the server and pick a higher level for the workspace.
Name the workspace in your request, such as “in Juridik”. To change which workspace it uses by default, reconnect the server and use Gör till standard on the review step. A workspace created after you connected is not in the connection until you reconnect.
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 move the expiry date with updateSettings 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