Skip to main content
The Hashlock MCP server gives AI agents the full trading loop: browse assets and RFQs, post or quote, negotiate, agree, and settle. There are two ways to run it. The same order — sell 0.05 BTC for USDT on Ethereum — in each:
Base units are the asset’s smallest unit: decimals from list_assets says how many (8 for BTC, 6 for USDT). Sending "0.05" to the hosted server is refused; sending "5000000" to the local one means five million BTC.

Hosted, by URL

Add this URL to your MCP client (Claude, ChatGPT, or any client with Streamable HTTP). Nothing else. The client discovers that it needs authorization, sends you to Hashlock to sign in and approve, and receives its own key.
  • Approving takes a signature from your wallet. A signed-in session alone grants nothing.
  • The grant appears under Developers as an ordinary API key. It expires after 90 days, you are told in Telegram (when linked) whenever one is created, and you can revoke it there.
  • Clients that do not speak OAuth can send a key they created themselves: Authorization: Bearer hk_….
Standard OAuth 2.1, so a compliant client drives it unattended.Codes are single-use and expire in 60 seconds. Redirect URIs are allowlisted; loopback is permitted per RFC 8252. The issued token is the API key, so a grant is revocable from the same list as every other key.
The hosted server is multi-tenant and strictly non-custodial: there is no key-in-env signing and no server-side secret storage. The initiator supplies their own hashlock and keeps the preimage until it claims: build_claim passes the preimage to the API, which needs it to build the claim transaction. Amounts in the hosted tools are base-unit integer strings, as in the REST API — prices included (quoteAmount is the total quote-asset amount in base units). A price (askAmount, quoteAmount) has at most 8 decimals of its asset, fewer when the asset has fewer; the API refuses more with “a price has at most N decimals” (N is 8, or the asset’s own count when it has fewer), so round a computed price down.

Hosted tools

Local, over stdio

Run the npm package with your own keys — use a dedicated key with only the funds you intend to trade. It logs in by itself (nonce → sign → session) and can fund and claim on chain with those keys.
The first configured key (EVM → TRON → BTC → Solana) opens the session; each key also signs settlement on its chain. With no key set, the read-only tools (list_assets, list_open_rfqs, get_rfq) still work. A Bankr wallet as the EVM wallet (from 1.12.0). A Bankr wallet has no key to export, so set HASHLOCK_BANKR_API_KEY — a Bankr API key with the Wallet API enabled, read-only off, “Enable arbitrary contract calls” on, and no allowed recipients on the key — instead of HASHLOCK_EVM_KEY. The server still builds every transaction itself from the deal it recorded and checks on your RPC that the call would go through; it then hands Bankr that exact call to sign and send, and follows the transaction on your RPC. Bankr does not sign a raw transaction for someone else to broadcast, so what goes on chain is Bankr’s to send, and the wallet’s security settings and spending limits apply. As with a local key, once the server has started to fund a swap it does not fund it again, whatever stopped it — set the wallet up before agreeing a deal. A claim or a refund that Bankr refuses can be repeated. HASHLOCK_API_URL is required and has no default. It is https://hashlock.markets/api: the local server signs in with a wallet and uses the app’s session API there, not the /v1 key API at https://api.hashlock.markets/v1 that the hosted server and the API reference use. The MCP server runs on your machine and sends your fund, claim and refund transactions to each blockchain through a node URL (an RPC endpoint). The defaults are free public nodes; they work, but they are shared and rate-limited — for regular trading, use your own: The swap secret is generated locally and stored at HASHLOCK_SECRETS_PATH (default ~/.hashlock/mcp-secrets.json, mode 0600). Only its hashlock leaves the machine until you claim. Then the MCP server sends the secret to the API — to build the claim on Solana, and on every chain to report the claim so the other leg settles — as the claim puts it on chain. Local amounts are human decimal strings ("0.5"), and prices are the total quote-asset amount, not per unit.

Local tools

With a key for each chain a swap touches, an agent can run the whole loop with no human: create_rfq / respond_to_rfq → negotiate (accept) → set_settlement_address → fund_leg → claim_leg. Errors return a structured envelope { error: { code, is_retryable, recovery_hint } } that an agent can branch on.