Skip to content

Pairing a local agent

Pairing connects an agent running on your own machine -- Claude Code, Cursor, Codex, a Python script -- to your Crank account. You approve it once in your own browser with your own wallet, and the agent receives a scoped, revocable pairing token. The token is never a wallet key or recovery secret: Crank is non-custodial, and pairing never moves key material anywhere.

There are three ways in:

Route Best for Auth
Claude Code plugin Claude Code users who want guided skills Device-code pairing, handled by the plugin
Plain MCP Any MCP-capable harness None for free reads; a pairing token for account calls
CLI or HTTP pairing Scripts, frameworks, other agents Device-code pairing over HTTP

How pairing works

Every route uses the same device-code flow:

  1. The agent asks Crank to start a pairing and shows you a short user code (format XXXX-XXXX) and a link to crank.ing/pair.
  2. You open the link in your own browser and:
    • connect your wallet;
    • sign a login message (a login, not a transaction -- it moves no funds);
    • check that the code on screen matches the code your agent showed you, then approve.
  3. The agent, which has been polling in the background, receives the pairing token once and stores it locally. The token is never printed.

The code expires after 10 minutes. Only approve a code you generated yourself: if someone sends you a pairing link, do not approve it.

Pairing tokens start with cpat_. Crank stores only a hash of the token, so a lost token cannot be read back from Crank -- pair again instead.

Claude Code plugin

The Crank plugin for Claude Code bundles the MCP connection and guided skills such as /crank:start (pair and get oriented) and /crank:enable-agent-wallet (turn on Lane 2). It connects to the curated plugin-v1 surface.

The plugin is not yet listed in a public plugin marketplace. Once it is, install it from inside Claude Code (version 2.1.195 or later):

/plugin marketplace add engaij/crank-plugins
/plugin install crank@crank

Until then, use plain MCP or HTTP pairing -- both reach the same account features.

With the plugin installed, run /crank:start. It starts the device-code flow above, and on approval writes the token to ~/.crank/credentials with owner-only (0600) permissions. The plugin then sends it as Authorization: Bearer <token> on every MCP call. Before you pair, the plugin still works for free, anonymous reads.

Two lanes: browser approval or agent wallet

A paired agent acts in one of two lanes. Both keep you in control of your own keys.

Lane 1: browser approval per trade (default)

A fresh pairing carries the read, quote and intent scopes. Your agent can read markets, fetch quotes and propose a trade as an intent. You then open the approval link (crank.ing/approve/<id>), review the trade, and sign it in your own wallet. Nothing executes until you sign.

This is the right lane for most people: the agent does the research and preparation, and every value-bearing action is a signature you make yourself.

Lane 2: opt-in agent wallet

Status: Rolling out

Lane 2 lets your agent execute inside limits you set, without a browser round-trip for every trade. It runs on a dedicated agent wallet whose key is generated and held inside TEE-isolated signing infrastructure -- never on Crank's servers, never in your agent's session.

  • Opt-in, browser-confirmed. In Claude Code, run /crank:enable-agent-wallet (or call enable_agent_wallet). You approve at crank.ing/enable-agent in your own browser. A "yes" typed into chat never counts as approval.
  • Conservative by default. A new agent wallet starts with a $50 per-trade cap, a $200 daily cap and a 10% drawdown halt, and its first 10 executions still need your browser approval.
  • Loosening needs the browser; tightening does not. Raising a cap goes through request_wallet_policy_loosening and your browser approval. Tightening applies at once.
  • Kill switch. Freezing the wallet blocks every further signature immediately.

Execution scopes on a pairing token (such as trade, strategy or perps) can only be granted through that same browser confirmation, and tokens that carry them expire after 90 days. The full security model is in The session-signing security model.

Revoking access

Open Settings on crank.ing and find Connected plugins. Each paired agent is listed with its token prefix, scopes, when it was paired and when it was last used. Choose Revoke to cut it off: every call with that token is refused from then on, and the agent stops working until you pair it again.

Revoking a pairing does not touch your wallet or any funds. To stop an agent wallet from signing, freeze it with the Lane 2 kill switch as well.

Plain MCP (any harness)

Free reads need no pairing at all. Add the public server to Claude Code:

claude mcp add --transport http crank https://mcp.crank.ing/mcp

For account features, point your harness at the authenticated agent surface, https://mcp.crank.ing/mcp/agent-v1, and send your pairing token as Authorization: Bearer cpat_.... Small local models can use the compact agent-lite surface with the same token. Surfaces, headers and scopes are covered in Agent authentication (agent-v1); per-harness configuration for Cursor, Windsurf, Codex CLI, Claude Desktop, Gemini CLI and others is in the integration guide.

CLI and other harnesses

Any harness can pair without the plugin.

  • Over HTTP, today. Two calls with curl start the pairing and poll for the token. The exact requests are in Pairing over HTTP.
  • Pairing CLI. Status: Coming soon The npx create-crank-agent pair and python -m crank_sdk pair commands run the same flow and store the token in your OS keychain, or in an owner-only file at ~/.crank/agent-credentials. See Pairing CLI.

Whichever route you use, the approval step is the same browser screen at crank.ing/pair, and the token can be revoked from Settings.