Skip to main content
The sajn MCP Server lets an AI assistant work in your live sajn workspace — not just look at it. 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. Connect it to Claude Desktop, Claude Code, Cursor or any other MCP client and you can 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 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 same role ∩ scope rule as the REST API.
The sajn MCP server requires a paid plan. Connections on the free plan are rejected.

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

Signing methods and eID schemes are enabled market by market. Call listSigningMethods before setting requiredSignature or twoStepVerification rather than assuming a fixed list.

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:
  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. attachFileToDocument 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 — listFields to see the PDF, listFillableFields 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

On first use Claude Code opens the sajn OAuth consent screen in your browser. Pick the workspace and approve the scopes. Verify with:

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?”

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 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 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.
  • 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.
They are hidden until you grant the matching scope (documents:write, documents:delete, contacts:write) at consent. Reconnect and approve the additional scopes.
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