MCP (AI assistants)

Connect Claude Code to SnapKey's MCP server, the rights an MCP key needs, the tools it offers and the limits that apply.

What it is

SnapKey runs an MCP (Model Context Protocol) server. With an MCP key, an AI client such as Claude Code can look up and change people, keys and access rights in your account in plain language: "Mikkel needs access to Pumpestation Nord for the next 6 hours." The assistant finds the person, the key and the security group, shows you a preview, and makes the change once it is confirmed.

The MCP server is a layer over the Public API: every tool call goes through the same endpoints, scope checks, logging and audit as an ordinary API request. An overview for non-developers is on the AI assistant page.

Getting access

MCP is off for every account until SnapKey switches it on. Contact us to have it switched on for your account. The account also needs the Public API add-on.

Once it is on, an account administrator gives the MCP rights, in Roles, to the people who should create MCP keys. Administrators do not get these rights automatically.

Right What it does
MCP: read-only keys Create keys that can look things up
MCP: read and write keys Create keys that can also make changes (and read-only keys)
MCP: audit log Optional, with either right above: the keys this person creates can also read the audit log

The person creating the key also needs the dashboard rights behind what the key does, because a key never carries more than its creator could do in the dashboard:

Key level Dashboard rights the creator needs
Read View locks, view people, view keys, view events
Read and write The above, plus create, update and delete for people and for keys
Audit log (optional) View the audit log

On an account with departments, the people, keys and locks rights must be the ones that cover the departments below (the "and departments below" form). If a right is missing, creating the key fails with You cannot grant API scopes you do not hold, naming the missing scope. A key gets audit-log access when its creator holds "MCP: audit log" and may view the audit log at the moment the key is created; the key list shows which keys have it.

Create a key

  1. In the dashboard, open Developer → MCP and choose Create MCP key.
  2. Give it a name that says who uses it and in which client, for example "Mikkel, Claude Code".
  3. Choose the level: Read or Read and write.
  4. Choose an expiry, or leave it blank for 90 days. The longest is one year.
  5. Copy the key. It starts with sk_mcp_ and is shown only once; store it like a password.

MCP keys cannot be created during a support session or on a reseller (platform-mode) account.

Connect Claude Code

Add the server to Claude Code with one command. The dashboard shows it with your key filled in right after you create the key:

claude mcp add --transport http snapkey https://api.snapkey.dk/mcp --header "Authorization: Bearer sk_mcp_…"

The endpoint is https://api.snapkey.dk/mcp. An MCP key works only there: sent to /public/v1 it is refused with 401 unauthenticated, and an ordinary sk_live_ API key is refused at /mcp.

Claude Code is the client SnapKey supports. Other MCP clients that can send a bearer header over HTTP have not been tested, and SnapKey cannot be added as a claude.ai connector yet.

Tools

A key reaches its own location and every department below it, and only what its creator may see there.

Read tools (both levels)

Tool What it does
get_context The account and location, the current server time (UTC), the key's level and limits
search_people Find people by part of their name, exact e-mail or phone; returns every match
get_person One person, with their keys
list_keys Keys, optionally for one person
get_key One key with its security groups and its access windows
search_security_groups Find security groups by part of their title; returns every match
list_locks Locks the key can see
list_events Door events, optionally within a time range, at one lock, for one person or of given types
list_invitations Invitations sent to people to set up a key
list_audit_log The account audit log: who created, changed, deleted or viewed what, and through which channel. Changes list the fields they touched, never their values. Only on keys with audit-log access

Write tools (read and write level only; a read key does not see them)

Tool What it does
grant_temporary_access Give a key a security group for a time window; removed automatically at the end
end_temporary_access End an access window now, or cancel one that has not started
add_security_groups Put security groups on a key with no end; they last as long as the key
remove_security_groups Take security groups off a key
rename_key Change a key's name, nothing else
change_key_period Change when a still-valid key starts and expires, or make it never expire
delete_key Delete a key for good; access again needs a new key
create_person Create a person (name, e-mail and phone)
update_person Change a person's name, e-mail, phone, company or title
delete_person Delete a person for good; refused while they still have a key or a pending invitation
create_key Create a phone key for a person and send the invitation by SMS or e-mail; without an expiry the key never expires
resend_invitation Send a pending invitation again
cancel_invitation Cancel a pending invitation, so its setup link no longer works

How changes are made

Every write tool, deletions included, works in two steps:

  1. Called without a confirmation_code, it changes nothing. It looks everything up and returns a plain-language preview and a one-time code.
  2. Called again with the same input and the code, it makes exactly that change. The code is valid for 5 minutes and works once.

Whether a person is asked before the second call depends on the AI client's own approval settings, not on SnapKey. In Claude Code, keep tool approval on for the SnapKey write tools if you want to see every preview before it is confirmed.

Write tools take ids, never names. The search tools return every match, and the assistant is told to ask you when there is more than one, so the server never picks between two people or two groups with similar names. Times are ISO 8601 with an explicit offset.

A temporary access window is applied within about a minute of its start and removed within about a minute of its end. If adding or removing the group fails, SnapKey retries up to three times; after that the window shows as failed in get_key, with the step that failed.

Limits and logging

  • At most 20 confirmed changes per hour per MCP key. Over the limit, the tool says when to try again.
  • One person and one key per call; there are no bulk changes.
  • No MCP tool unlocks doors, changes door modes, arms or disarms alarms, or manages webhooks.
  • Every change appears in the audit log marked MCP, with the tool that made it. Every call, reads included, is in the API request log under the key.

When a key stops working

An MCP key is refused (401) when:

  • it has been revoked under Developer → MCP (anyone with either MCP right at the location can revoke);
  • it has expired;
  • its creator no longer holds the MCP right for its level, or one of the dashboard rights in the table above. The key shows as inactive in the dashboard, and restoring the creator's rights reactivates it.