Lokasign serves its API as an MCP server, so an AI agent can
call it directly instead of writing HTTP. It is the same API: one tool per operation, the same
API key, the same rules. Whatever a tool call does, a client with that key could have done over
/api/v1.
This page is about connecting a client. What the tools do is in the API reference and its OpenAPI document — the tools carry those descriptions with them.
| URL | https://lokasign.net/mcp |
| Transport | Streamable HTTP |
| Authentication | Authorization: Bearer <api_key>, or X-Api-Key: <api_key> |
The API key is the same one your application uses for the REST API. Issue or rotate it in the
dashboard under API & Webhook (/api-settings); the secret is shown once, at creation.
Treat the key as a credential you are handing to an assistant: it can do everything your application can do, for your application only. Data belonging to other applications on the platform does not exist as far as that key is concerned.
Give an agent a test key (esk_test_…, issued with mode Uji). It can then create, send and
even sign (simulateSigner) freely: nothing is emailed — listTestMail shows what would have
been — and every executed document is a SPECIMEN without the platform seal. A live key lets the
agent invite real people and produce binding documents.
claude mcp add --transport http lokasign https://lokasign.net/mcp \
--header "Authorization: Bearer <api_key>"
Add Lokasign as a remote custom connector. This is also the only way to get the interactive
Lokasign box in the chat (below); a local mcp-remote bridge works, but answers in text only.
https://lokasign.net/mcp — exactly, without a trailing slash. Claude
derives the sandbox origin of interactive results from this string.Authorization
header for OAuth, so under Request headers pick x-api-key and paste the key itself,
without Bearer.On Team and Enterprise plans an organisation owner may have to add or allow the connector. Menu names follow Claude's own releases; if a label differs, Claude's help pages win.
A file added to the chat lands in Claude's code-execution sandbox, not on this server. Claude can send it to Lokasign for you — so you only attach the PDF and never open a link — once that sandbox may reach this host. Once, in Claude's settings:
lokasign.net to the domain allowlist (the additional allowed domains).Without it the upload from the sandbox is refused and Claude falls back to a link or the upload box. Claude cannot grant this from inside a conversation.
The tools createDocumentUpload, createSigningSession and getFinalDocuments render a
Lokasign box in the chat:
The box never writes into the conversation (Claude would put such a message in your message box behind a warning); it tells Claude what happened through its context instead.
A first prompt, with a PDF attached:
Tanda tangani dokumen ini dengan Lokasign. Saya penanda tangannya, sebagai Pihak Pertama.
| What you see | Why, and what to do |
|---|---|
| The tools work but no box appears | The connector runs through mcp-remote or another stdio bridge. Add it as a remote custom connector as above. |
The connector does not connect (401) |
The key went into the wrong header, or with Bearer. Use x-api-key and the bare key. |
| Claude cannot upload the attachment | lokasign.net is not on the allowlist yet. Add it, or use the link or the box Claude offers. |
| The signature box is missing on the signing page | Claude placed the field by a text that is not in the PDF; Lokasign now refuses that (anchor_not_found). For a scanned PDF, ask for the box by position. |
In .cursor/mcp.json (this project) or ~/.cursor/mcp.json (every project):
{
"mcpServers": {
"lokasign": {
"url": "https://lokasign.net/mcp",
"headers": { "Authorization": "Bearer <api_key>" }
}
}
}
In .vscode/mcp.json. VS Code asks for the key once and stores it outside the file, so it never
lands in your repository:
{
"inputs": [
{ "type": "promptString", "id": "lokasign-key", "description": "Lokasign API key (esk_test_…)", "password": true }
],
"servers": {
"lokasign": {
"type": "http",
"url": "https://lokasign.net/mcp",
"headers": { "Authorization": "Bearer ${input:lokasign-key}" }
}
}
}
A client that starts MCP servers as local processes reaches a remote one through the
mcp-remote bridge. Claude Desktop can do this too, in claude_desktop_config.json — but use
the custom connector above where you can: over the bridge Claude shows no Lokasign box.
{
"mcpServers": {
"lokasign": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://lokasign.net/mcp", "--header", "Authorization:${LOKASIGN_AUTH}"],
"env": { "LOKASIGN_AUTH": "Bearer <api_key>" }
}
}
}
The header value travels through env because some clients split arguments on spaces, and
Bearer <api_key> would arrive broken.
Any other client that supports a remote MCP server over HTTP with a custom header works the
same way: point it at the URL above and set Authorization (or X-Api-Key). Client configuration formats change
with their releases — if a snippet here no longer matches, your client's own documentation wins.
With the MCP Inspector, no installation needed:
npx @modelcontextprotocol/inspector
It opens in your browser. Choose transport Streamable HTTP, enter https://lokasign.net/mcp, add the header
Authorization: Bearer <api_key>, and connect: you should see the tools, the four guides under
Resources, and the two prompts.
Or make one call by hand:
curl -X POST https://lokasign.net/mcp \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
In all of these, use a test key (esk_test_…) while you are trying things out.
All 31 tools arrive in one tools/list. The page size is set above the size of the
catalogue on purpose: the whole list is about 47 KB, small enough that splitting it bought
nothing and cost a failure with no symptom — a client that ignored nextCursor saw a short list
and was told nothing about the rest.
Follow nextCursor anyway if your client is hand-rolled. It is absent today, and handling it
costs one loop; that loop is what keeps you correct if the catalogue ever outgrows a page.
Tool names are the API's operationIds, verbatim: createSignatureRequest, getTemplate,
listWebhookDeliveries. So a transcript can be checked against the API reference line by line,
and an endpoint added to the API becomes a tool without anybody maintaining a list.
A tool call is JSON, so it cannot carry a file — and an AI client usually does not hold the
bytes of a chat attachment anyway. That is why uploadDocument offers only document_url over
this connection. For a file the person has, call createDocumentUpload: it returns an
upload_url that takes one PDF within 15 minutes, with no API key.
upload_url to the person. Opened in a browser, it shows a page to pick the PDF.curl -X PUT --data-binary @contract.pdf -H "Content-Type: application/pdf" <upload_url>.Then call getDocumentUpload until status is completed, and use document.gid as
documents[].document_gid in createSignatureRequest. A link takes exactly one file; a refused
file (not a PDF, password-protected, too large) leaves it open for another try.
In Claude, the attachment travels this way without you opening anything once the sandbox may reach this host — see Let Claude upload chat attachments itself above.
Besides the tools, the server offers the integration guides as resources and two ready-made prompts, so an agent does not have to be told where the documentation lives.
| Resource | What it is |
|---|---|
lokasign://docs/LOKASIGN.md |
The integration context for AI assistants — read this first |
lokasign://docs/quickstart |
From sign-up to a first executed agreement (Indonesian) |
lokasign://docs/signing |
Email, iframe and WebView signing (Indonesian) |
lokasign://docs/templates |
The .docx tag grammar, with tested samples (Indonesian) |
| Prompt | Arguments | Use |
|---|---|---|
integrate-lokasign |
stack, goal (both optional) |
Start an integration: the agent loads the context, looks at your application through the tools, proposes a plan, then builds. |
diagnose-lokasign-error |
error (required), call |
Explain a failed call and what to change. |
Clients that support prompts list them in their prompt menu; Claude Code shows them as slash
commands (/mcp__lokasign__integrate-lokasign).
The server tells the agent this when it connects, so you do not have to — but for your own
reading, the usual order is: getApplication to confirm which application the key belongs to
and what limits apply, then listTemplates → getTemplate → checkTemplateData →
createSignatureRequest to send an agreement, and getSignatureRequest or webhooks to follow
it. To have the person in the conversation sign a file they have: createDocumentUpload →
getDocumentUpload → createSignatureRequest with fields placed by anchor and the signer as
delivery: "embedded" → sendSignatureRequest → createSigningSession without
embedder_origin. Three calls are deliberately left for a person to decide rather than an agent:
activateTemplate, rotateWebhookSecret and voidSignatureRequest.