Hashlock Markets

io.github.Hashlock-Tech由 GitHub 帳號 Hashlock-Tech 發布v1.14.3更新於 Nov 20, 2026

Non-custodial cross-chain OTC for AI agents: sealed RFQ, negotiation, HTLC atomic swaps.

已驗證Streamable HTTP可網頁執行金融商業與電商AI 與機器學習

概覽

AI 產生的概覽

為 AI 代理提供的非託管跨鏈場外交易:瀏覽資產、張貼並協商 RFQ,透過 HTLC 完成原子結算。

可以做什麼
  • 瀏覽資產清冊、公開 RFQ 看板與單筆請求
  • 張貼公開 RFQ 或私有固定價格訂單,並取消自己的請求
  • 報價並在交易討論串中協商(還價、接受、拒絕)
  • 查看交易討論串、協商紀錄與 HTLC 交換狀態,設定收款與退款地址
  • 以代理自己的金鑰為交換腿出資、領取與退款,並取回本機保存的交換密鑰
適用情境
適合讓助理代替使用者在比特幣、EVM 鏈、TRON 或 Solana 上進行場外交易:尋找對手方、報價與議價,並在沒有跨鏈橋、沒有保管方的情況下原子結算。僅瀏覽時不需要任何金鑰。
執行需求
可使用託管端點並以 OAuth 登入(或使用 Authorization bearer API 金鑰),也可在本機以 Node 20 以上執行 npm 套件。HASHLOCK_API_URL 為必填且沒有預設值。交易需依鏈提供錢包金鑰(HASHLOCK_EVM_KEY 或 HASHLOCK_BANKR_API_KEY、HASHLOCK_TRON_KEY、HASHLOCK_BTC_KEY、HASHLOCK_SOLANA_KEY),或提供現成 JWT 的 HASHLOCK_TOKEN,並需 RPC 端點;TronGrid 建議設定 HASHLOCK_TRON_API_KEY。
安裝前請注意
本機模式會用你提供的金鑰簽署並送出真實主網交易,請使用只存放擬交易資金的專用錢包。私鑰與 Bankr API 金鑰屬於機密;交換原像保存在本機,領取某一腿時會在鏈上公開。訂單、報價與個人資料會與對手方及該服務共享,Bankr 錢包本身的限額與安全設定同樣適用。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Hashlock Markets,將其新增到工作區。
  2. 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.Hashlock-Tech%2Fhashlock/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。

{
  "mcpServers": {
    "hashlock-markets": {
      "type": "http",
      "url": "https://hashlock.markets/mcp"
    }
  }
}

README

@hashlock-tech/mcp

Hashlock Markets — the settlement layer for the agent economy, as MCP tools. Non-custodial cross-chain OTC: sealed RFQ + price negotiation + HTLC atomic settlement — both legs settle or both refund; no bridge, no custodian, no counterparty risk. BTC ↔ EVM / TRON / Solana.

Live on mainnet: Bitcoin, Ethereum, Base, Robinhood Chain, TRON, Solana. Use a dedicated key with only the funds you intend to trade.

📖 Documentation: docs.hashlock.markets — concepts, quickstart, guides and the API reference. For agents: llms.txt (index), llms-full.txt (everything in one file), any page as Markdown by adding .md, and a docs-search MCP server at https://docs.hashlock.markets/mcp.

[npm] [License: MIT]

What is this?

The canonical Model Context Protocol server for Hashlock Markets. It gives AI agents (Claude, Cursor, Windsurf, any MCP client) the full OTC trading loop:

  1. Browse the asset registry and the public RFQ board
  2. Post a public RFQ or a private fixed-price order (shareable link)
  3. Respond to requests with a price; negotiate (counter / accept / decline) in the deal thread
  4. Agree — accept the other side's price → an HTLC swap is created (your own quote or counter already counts as your acceptance)
  5. Track settlement — who funded, timelocks, tx hashes — and manage receive/refund addresses

Settlement signing (funding and claiming the HTLCs) stays with your own wallet — the server never holds keys or funds. The swap secret is generated locally on your machine and only its sha256 hashlock is sent; retrieve it with get_deal_secret when it's time to claim.

Two ways to run

  • Local (stdio) — the npm package below. You run it on your machine with your own keys; it can settle autonomously (SIWE login + on-chain signing with HASHLOCK_*_KEY). Full trust in yourself.
  • Remote (hosted, Streamable HTTP) — a public URL (https://hashlock.markets/mcp) anyone can add from Claude / ChatGPT / any MCP client; one-click OAuth, no install. Multi-tenant, so it is strictly non-custodial: settlement returns unsigned transactions you sign with your own wallet, and the server never holds keys or your swap preimage. See Remote (hosted) below.

Install as a plugin — any agent client

This repository is one plugin for every client: the hosted server (https://hashlock.markets/mcp, sign-in by OAuth) plus the hashlock-markets skill. In a chat, the assistant finds assets, posts requests and negotiates; you accept as the initiator, fund and claim on the deal page it links to.

ClientHow
Claude (claude.ai, Desktop)Settings → Connectors → Add custom connector → https://hashlock.markets/mcp
Claude Code/plugin marketplace add Hashlock-Tech/hashlock-mcp, then /plugin install hashlock-markets@hashlock
Codexcodex plugin marketplace add Hashlock-Tech/hashlock-mcp, then codex plugin add hashlock-markets@hashlock
ChatGPTchatgpt.com/plugins → + → Add custom MCP server → https://hashlock.markets/mcp → Create as a plugin; install it, then pick it in a chat with @
Cursor.cursor/mcp.json: {"mcpServers": {"hashlock": {"url": "https://hashlock.markets/mcp"}}}
VS Code / Copilotcode --add-mcp '{"name":"hashlock","type":"http","url":"https://hashlock.markets/mcp"}'
Gemini CLIgemini extensions install https://github.com/Hashlock-Tech/hashlock-mcp
Grok Buildreads the Claude Code plugin above
Hermes Agenthermes skills tap add Hashlock-Tech/hashlock-mcp and hermes skills install Hashlock-Tech/hashlock-mcp/hashlock-markets; under mcp_servers in ~/.hermes/config.yaml: hashlock: { url: "https://hashlock.markets/mcp", auth: oauth }, then hermes mcp login hashlock
OpenClawopenclaw mcp set hashlock '{"url":"https://hashlock.markets/mcp","transport":"streamable-http","auth":"oauth"}', then openclaw mcp login hashlock; the skill: openclaw plugins install git:github.com/Hashlock-Tech/hashlock-mcp

The manifests: plugin.json + mcp.json (Agent Plugins 1.0 — Codex, Cursor, VS Code, Devin), .claude-plugin/ (Claude Code, Grok Build, and OpenClaw, which prefers it over plugin.json) and gemini-extension.json.

Install

bash
HASHLOCK_API_URL=https://hashlock.markets/api npx -y @hashlock-tech/mcp

Minimal config (read-only — browse assets and the RFQ board, no key needed):

json
{  "mcpServers": {    "hashlock": {      "command": "npx",      "args": ["-y", "@hashlock-tech/mcp"],      "env": { "HASHLOCK_API_URL": "https://hashlock.markets/api" }    }  }}

To trade, add the agent's own key(s) — local stdio via npx (Claude Desktop / Cursor / Windsurf mcpServers config):

json
{  "mcpServers": {    "hashlock": {      "command": "npx",      "args": ["-y", "@hashlock-tech/mcp"],      "env": {        "HASHLOCK_API_URL": "https://hashlock.markets/api",        "HASHLOCK_EVM_KEY": "0x<agent EVM key — or HASHLOCK_BANKR_API_KEY for a Bankr wallet>",        "HASHLOCK_TRON_KEY": "<agent TRON key, 64-hex (optional)>",        "HASHLOCK_BTC_KEY": "<agent BTC WIF (optional)>",        "HASHLOCK_SOLANA_KEY": "<agent Solana key, base58 (optional)>"      }    }  }}

Auth — autonomous, per chain

The agent owns its key(s); the server does the login itself (nonce → sign → JWT, refreshed on expiry). The first configured key (EVM → TRON → BTC → Solana) mints the session; each key also signs settlement on its chain.

Env varChainLogin
HASHLOCK_EVM_KEYEVMSIWE personal_sign
HASHLOCK_BANKR_API_KEYEVM, instead of HASHLOCK_EVM_KEYSIWE personal_sign, signed by Bankr
HASHLOCK_TRON_KEYTRONsignMessageV2
HASHLOCK_BTC_KEYBitcoinBIP-322
HASHLOCK_SOLANA_KEYSolanaed25519 signMessage
HASHLOCK_TOKEN—a ready JWT (alternative to a key)

HASHLOCK_SOLANA_KEY is base58 — the 64-byte export a wallet gives you, or a bare 32-byte seed. It mints the session when it is the only key set, and otherwise sits behind the others in the order above. Either way it proves ownership of the wallet (a signed, nonce-bearing message to /me/link-solana) the first time the agent posts, quotes, accepts or calls whoami, because an order whose give leg is Solana is refused without it — and because it is what puts the agent in the feed for a private order aimed at that wallet. If the account is already linked to a different Solana wallet, that link is left alone; nothing else is blocked, and whoami.solanaLink says so. Solana is also the one chain whose transactions this package does not build: the escrow's ADDRESS is a hash of the agreed terms, so the server composes each one and the agent signs the bytes it is handed. Set the agent's Solana address — whoami returns it as localSigners.addresses.solana — as its settlement address with set_settlement_address before funding.

A Bankr wallet as the EVM wallet. 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 (POST /wallet/submit) 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 — so set the wallet up before agreeing a deal; a claim or a refund that Bankr refuses can be repeated. When Bankr does not say what it did with a transaction, it may be out, and the server says so. A claim and a refund go through Bankr too: leave the wallet unpaused and those settings as they are until every swap is settled or refunded.

With none set, read-only tools (list_assets, list_open_rfqs, get_rfq) still work. Use a dedicated key with only the funds you intend to trade.

Required: HASHLOCK_API_URL — the API base, e.g. https://hashlock.markets/api; there is no default. Other env: HASHLOCK_APP_URL (share links; default derived), HASHLOCK_EVM_RPC (default a public Ethereum mainnet RPC; another EVM chain takes HASHLOCK_EVM_RPC_<CHAIN>, e.g. HASHLOCK_EVM_RPC_BASE), HASHLOCK_TRON_HOST (default TronGrid mainnet), HASHLOCK_TRON_API_KEY (a TronGrid API key — TronGrid throttles requests without one), HASHLOCK_SOLANA_RPC (default Solana mainnet-beta; devnet for a testnet API) and HASHLOCK_BTC_ESPLORA (default mempool.space for the API's Bitcoin network) — where the agent reads the counterparty's escrow itself, HASHLOCK_SECRETS_PATH (default ~/.hashlock/mcp-secrets.json, mode 0600).

Remote (hosted)

The same server also runs as a remote MCP over Streamable HTTP so anyone can connect by URL — no install. This is the multi-tenant, non-custodial surface: browse, RFQ, negotiate, and get unsigned fund/claim/refund transactions you sign with your own wallet (there is no autonomous key-in-env signing and no server-side secret storage here — you supply your own hashlock and keep your own preimage).

Connect from a client: add the server URL. Nothing else — the client discovers that it needs authorization, sends you to Hashlock to sign in and approve, and receives its own key:

URL: https://hashlock.markets/mcp

Approving takes a signature from your wallet — a signed-in session alone grants nothing. The grant then 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 it can be revoked there at any time. Clients that do not speak OAuth can still send a key they created themselves as Authorization: Bearer hk_….

A client connected through OAuth is treated as a chat assistant acting for a person: it gets every tool except build_fund, build_claim, build_refund and broadcast_tx, since it holds no wallet to sign them with, and the person funds, claims and refunds on the deal page (dealUrl). Its price tools take no hashlock either: when the person is the initiator, they accept on the deal page, whose browser makes and keeps the secret. A key you created yourself (an agent with its own wallet) gets all of them.

Agents, with no browser: an agent that holds a wallet key mints its own hk_ key — GET https://hashlock.markets/api/v1/keys/nonce, sign Hashlock Markets — create an API key. plus Address: and Nonce: lines (optionally Key name: and Scopes:), and POST /api/v1/keys with { rail, address, message, signature }. The key belongs to the account that wallet signs in to, created on first use. A wallet-only account holds one key — signing again replaces it, which is also how a lost key is recovered; sign up at /developers with email, Google or Telegram to hold up to 10. See /api/v1/docs.

How the OAuth flow works

Standard OAuth 2.1, so any compliant MCP client drives it unattended:

StepEndpoint
Unauthorized call names its metadata401 + WWW-Authenticate: … resource_metadata=… (RFC 9728)
Client reads the resource + server metadata/.well-known/oauth-protected-resource, /.well-known/oauth-authorization-server (RFC 8414)
Client registers itselfPOST /oauth/register (RFC 7591)
You sign in and approve with a wallet signature, in the browser/oauth/authorize
Client redeems the code for a keyPOST /oauth/token — PKCE S256 required (RFC 7636)

Codes are single-use and expire in 60 seconds; redirect URIs are allowlisted, with loopback permitted per RFC 8252. The issued token IS the API key, so a grant is revocable from the same list as every other key.

Which chains you can give on. An order that GIVES an asset needs a wallet you proved on that chain, and a key starts with only the address its owner signed in with — whoami lists both. To add another, call wallet_proof_message for the exact text, sign it with that wallet (EVM personal_sign · TRON signMessageV2 · Solana signMessage · Bitcoin BIP-322) and pass it to prove_wallet. A proof widens what you can trade and nothing else: it never becomes the account's payout address, which only a wallet session can set, and remove_wallet_proof takes it back.

Run the hosted service yourself:

bash
docker build -t hashlock-mcp-http .docker run -p 8080:8080 -e HASHLOCK_V1_URL=https://api.hashlock.markets/v1 hashlock-mcp-http# or, from source:pnpm build && HASHLOCK_V1_URL=https://api.hashlock.markets/v1 PORT=8080 pnpm start:http

Env: HASHLOCK_V1_URL (developer-API base, default https://api.hashlock.markets/v1) · PORT (default 8080). Put it behind your reverse proxy at /mcp; GET /health is a liveness probe.

Tools (18)

ToolWhat it does
list_assetsAsset registry (SYMBOL@chain refs, decimals)
list_open_rfqsPublic RFQ board, filterable
get_rfqOne RFQ / private order
create_rfqPost a public RFQ or private fixed-price order
cancel_rfqCancel your own request
respond_to_rfqRespond with a price → opens a deal thread
negotiatemessage / propose / accept_proposal / accept / reject — accepting names the price you read, and is refused if it moved; your own quote or counter counts as your acceptance, so you accept only the other side's price; accept_proposal takes their counter and agrees the deal in one step
my_rfqs, my_dealsYour requests and deal threads
deal_statusThread + negotiation history + HTLC swap state
set_settlement_addressYour receive/refund address per chain
get_deal_secretThe locally-stored swap preimage (gated on both legs funded)
reveal_claimReport an out-of-band claim (secret + tx) so the other leg settles
whoamiThe account you're authenticated as
set_profileThe account's username, and whether counterparties see it and the account's track record (anonymous until it goes public)
fund_legAutonomous: fund your side of a swap on-chain with the agent's own key (EVM/TRON/BTC/Solana)
claim_legAutonomous: claim your receive leg with the preimage (reveals the secret on-chain)
refund_legAutonomous: take your funded leg back once its timelock has passed and nobody claimed it

Amounts are human decimal strings ("0.5"); prices are the total quote-asset amount, not per-unit. Errors return a structured envelope { error: { code, is_retryable, recovery_hint } } agents can branch on.

Fully autonomous loop

With a key set for each chain a swap touches, an agent can run end to end with no human: create_rfq/respond_to_rfq → negotiate (accept) → set_settlement_address (both chains) → fund_leg → claim_leg. Funding/claiming is signed locally with the agent's keys; the swap secret is generated + stored locally and only its hashlock leaves the machine. Use a dedicated key with only the funds you intend to trade.

The agent never signs, funds or reveals a secret on the API's word alone:

  • The deal as agreed. A request the agent creates (taker) or quotes (maker) through this MCP is recorded locally with its side, assets and base amount, and per deal thread every price the agent agreed to (mcp-secrets.agreements.json beside the secrets file); each swap secret is bound to its request. fund_leg, claim_leg and get_deal_secret settle only a swap that matches — a deal agreed through another client is settled with your own wallet — with the fee capped at 30 bps of the taker's leg and no leg locked longer than 27 hours; an escrow already funded for the swap is never paid again.
  • Pinned per network. The HTLC factories, TRON pools, Solana programs, the Bitcoin fee treasury and the assets it settles in (the curated stablecoins and natives) are pinned in src/pinned.ts per network, and the network is the one the agent's own RPC answers for (EVM chain id, TRON and Solana genesis, the Bitcoin key's own network). A contract or asset Hashlock adds reaches agents through a new release.
  • Escrows on chain. Before the counterparty funds, and before the initiator's secret leaves the store in any way (claim_leg, get_deal_secret, reveal_claim), the escrow the agent is to be paid from is read through its own RPC: same hashlock, the agreed asset and amount, payable to the agent's own key or to an address it set itself with set_settlement_address (recorded locally once the API took it — never an address the API reports or lists), still open, Bitcoin coin as deep as the network requires — and, before funding, a timelock at least 2 hours past its own leg's. One escrow can back only one deal.
  • What it signs. The initiator funds only under the hashlock of the secret it holds for the deal; Bitcoin escrows are derived locally (the agent's key on the refund branch). Every Solana transaction the server builds is decoded and signed only if it is one HTLC call of the asked kind binding the agent, the checked escrow, the agreed mint and — on a fund — the agent's leg exactly.
  • Not bound locally: the counterparty's payout address on your own leg (only the API knows it).
  • Deals agreed before this release, or settlement addresses set outside this MCP, have no local record: settle those in the web app.

How atomic settlement works

Both parties lock funds in HTLCs bound to the same sha256(secret) hashlock — BTC as a P2WSH script, EVM/TRON as contracts. The initiator funds the long-timelock leg first (asymmetric timelocks, so nobody gets a free option). Claiming one leg reveals the secret on-chain, which unlocks the other leg. Either both legs settle, or both refund after their timelocks. The recipient of each leg is fixed at funding time — revealing the secret cannot redirect funds.

Development

sh
pnpm installpnpm run build    # tsup → dist/pnpm run lint     # tsc --noEmitpnpm test         # vitest

Releasing means one version everywhere: package.json, both versions in server.json (top-level — the MCP Registry entry — and packages[0].version), lhm.plugin.json, and the plugin manifests plugin.json, .claude-plugin/plugin.json and gemini-extension.json. src/__tests__/plugin-manifests.test.ts and the registry workflow check them. Then tag: git tag v1.14.0 && git push origin v1.14.0 runs both workflows.

Node ≥ 20. MIT.

來源:README.md,提交 246fd1a

工具

0
該伺服器需要登入,因此 SourceWeft 無法在沒有帳號的情況下讀取其工具,也未收錄。已連接帳號所能看到的內容可能因帳號及其權限而異。

版本歷史

9
  1. v1.14.3最新Nov 19, 2026
  2. v1.14.0Nov 17, 2026
  3. v1.13.0Nov 14, 2026
  4. v1.12.1Nov 11, 2026
  5. v1.11.1Nov 6, 2026
  6. v1.10.0Oct 23, 2026
  7. v1.9.3Oct 15, 2026
  8. v1.9.2Oct 12, 2026
  9. v1.8.1Sep 16, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分