Skip to content
Browse the documentation

AgentLock MCP server

Connect Claude Desktop, Cursor and other MCP clients to AgentLock with the agentlock-mcp-server package or the hosted MCP endpoint.

MCP (Model Context Protocol) server that lets Claude Desktop, Cursor and other MCP clients use AgentLock as a tool provider. The agent submits actions, waits for results, drives browser sessions and exchanges messages with the people who supervise it, all through AgentLock's policy and approval engine. Credentials stay in the AgentLock vault; the agent references them by name.

Full API reference: https://app.agentlock.net/docs/api

Install

bash
npm install -g agentlock-mcp-server

The package installs the agentlock-mcp command. To run it without a global install, use npx -y agentlock-mcp-server.

Authentication

Two modes are supported. Secrets are read from environment variables only: the flags --token, --key and --agent-id are rejected, because command-line arguments are visible to other users on the same host.

Create a token on the agent's page in the AgentLock dashboard, then:

bash
AGENTLOCK_TOKEN=<token> agentlock-mcp

Tokens expire after 30 days by default (at most 90) and can be revoked in the dashboard at any time.

Ed25519 signing

For environments that require signed requests:

bash
AGENT_ID=<agent UUID> AGENT_PRIVATE_KEY=<base64 private key> agentlock-mcp

The agent's public key must already be registered in the dashboard. The private key stays on the client; AgentLock only receives signatures.

When AGENTLOCK_TOKEN is set, it is used and the signing variables are ignored.

Configuration

VariableDefaultDescription
AGENTLOCK_URLhttps://app.agentlock.netBase URL of AgentLock.
AGENTLOCK_TOKENAPI token (token mode).
AGENT_IDAgent UUID (signing mode).
AGENT_PRIVATE_KEYBase64 Ed25519 private key (signing mode).

--url <url> is the only accepted command-line flag and takes precedence over AGENTLOCK_URL.

Tools

ToolPurpose
request_actionSubmit an action (action_type, tool, payload, optional idempotency_key), for example an HTTP request or an MCP server call. Waits for approval and execution and returns the result.
get_resultFetch the result of an earlier request. Waits until the status is final or timeout_ms (default 300000) has passed, waits through 429 and 5xx responses and fails when the request is not found.
browser_openOpen a website in a browser session on AgentLock's servers. Always needs approval. Returns the session_id and an accessibility snapshot of the page.
browser_actionRun click, type, navigate, press_key, scroll, snapshot, screenshot, select or close in an open session.
browser_loginFill a login form from a stored login credential. field_mapping maps CSS selectors to username, password or totp. The agent never sees the password or the one-time code.
list_credentialsList the credentials the agent may use, by name and type. Secret values are never returned.
get_messagesFetch messages from people: notes attached to approval decisions and messages sent from the dashboard. Optional since, limit (default 20, at most 50), include_read and thread_id.
send_messageReply in an existing thread.
start_threadStart a new thread with a subject and content.

request_action waits up to 5 minutes. If a request is still pending after that, call get_result with its request_id later.

Only SUCCEEDED counts as success: a request that ends as FAILED, DENIED, EXPIRED, BLOCKED or UNDONE is returned as a tool error (isError).

In browser_action, selector and ref are both used as a Playwright selector, for example text=Sign in or #email; when both are given, selector wins. The snapshot does not contain element references. An action inside a session runs immediately when the workspace policy allows it and is refused when the policy would block it or send it for approval. Under the default policy only snapshot, screenshot, scroll and close are allowed, so add ALLOW rules for the browser tools the agent should use.

Tool names, payloads and policy behavior are described in the API reference.

Claude Desktop setup

Add the server to claude_desktop_config.json (on macOS in ~/Library/Application Support/Claude/, on Windows in %APPDATA%\Claude\):

json
{
  "mcpServers": {
    "agentlock": {
      "command": "npx",
      "args": ["-y", "agentlock-mcp-server"],
      "env": {
        "AGENTLOCK_TOKEN": "<your-token>"
      }
    }
  }
}

Restart Claude Desktop. The AgentLock tools then appear in the tool list.

Cursor setup

Add the same entry to .cursor/mcp.json in your project, or to ~/.cursor/mcp.json for all projects:

json
{
  "mcpServers": {
    "agentlock": {
      "command": "npx",
      "args": ["-y", "agentlock-mcp-server"],
      "env": {
        "AGENTLOCK_TOKEN": "<your-token>"
      }
    }
  }
}

Transport

The server communicates over stdio. It opens no network listener: the MCP client starts the process and exchanges JSON-RPC over stdin and stdout. Logs go to stderr.

Clients that connect to remote MCP servers over HTTP can use AgentLock's hosted endpoint https://app.agentlock.net/api/mcp with an API token instead. It offers only request_action and get_result; see POST /api/mcp.

License

MIT

AgentLock MCP server | AgentLock Docs