hashlock-mcp
OfficialThis server enables AI agents and users to perform trustless, cross-chain OTC atomic swaps (HTLC-based) on Ethereum, Bitcoin, and Sui — covering the full lifecycle from price discovery to settlement.
Create & Manage RFQs (create_rfq): Broadcast a Request for Quote for an OTC swap to market makers via a sealed-bid auction, with optional Ghost Auction (anonymous) mode. Supports mainnet and testnets.
One-call Swap Facade (swap_quote / swap_status / swap_execute / swap_cancel): Simplified swap flow — open a sealed auction, wait for bids, execute against the best bid with a price guard, or cancel. Designed for a "just swap X for Y" experience.
Market-Making (respond_rfq, list_open_rfqs): List open RFQs and submit sealed-bid quotes. No funds are locked until a requester accepts.
HTLC Funding (create_htlc): Record an on-chain HTLC lock transaction (EVM, Bitcoin P2WSH, or Sui Move) to advance the atomic settlement state machine.
Claim (withdraw_htlc): Reveal the preimage to atomically claim both legs of a cross-chain swap — trustless, no intermediary.
Refund (refund_htlc): Recover locked funds after the timelock expires if the swap did not complete.
HTLC Status (get_htlc): Query real-time per-leg settlement state (lock status, timelock, preimage, roles) to determine the next action.
Trade History (list_my_trades): List active and historical trades with optional status filtering — useful for rebuilding agent state after context loss.
Supported Pairs (list_supported_pairs): Discover all chain-qualified token pairs available for trading.
Supported chains: Ethereum mainnet/Sepolia, Bitcoin mainnet/signet, Sui mainnet/testnet. Tokens: ETH, BTC, SUI, USDC, USDT, WBTC, WETH.
Allows creation and settlement of atomic swaps on the Bitcoin network using Hashlock's intent-based trading protocol, supporting RFQs and HTLC operations.
Enables cross-chain atomic swaps on Ethereum through RFQ creation, market making, and HTLC funding/withdrawal/refund operations.
Facilitates atomic swaps on the Sui blockchain with tools for RFQ management and HTLC lifecycle operations via Move-based contracts.
@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.
⚠️ Testnets only for now (Ethereum Sepolia · TRON Nile · Bitcoin signet). Mainnet comes after the security-hardening gate — do not send real funds.
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:
Browse the asset registry and the public RFQ board
Post a public RFQ or a private fixed-price order (shareable link)
Respond to requests with a price; negotiate (counter / accept / decline) in the deal thread
Agree — both parties accept → an HTLC swap is created
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.
Related MCP server: hashlock-mcp-server
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 (e.g.
https://hashlock.markets/mcp) anyone can add from Claude / ChatGPT / any MCP client. Multi-tenant, so it is strictly non-custodial: you authenticate with your own Hashlock developer key, 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
Local stdio via npx (Claude Desktop / Cursor / Windsurf mcpServers config):
{
"mcpServers": {
"hashlock": {
"command": "npx",
"args": ["-y", "@hashlock-tech/mcp"],
"env": {
"HASHLOCK_EVM_KEY": "0x<agent EVM key (TESTNET!)>",
"HASHLOCK_TRON_KEY": "<agent TRON key, 64-hex (optional)>",
"HASHLOCK_BTC_KEY": "<agent BTC WIF, signet (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) mints the session; each key also signs settlement on its chain.
Env var | Chain | Login |
| EVM | SIWE |
| TRON |
|
| Bitcoin | BIP-322 |
| — | a ready JWT (alternative to a key) |
With none set, read-only tools (list_assets, list_open_rfqs, get_rfq) still work. Use dedicated testnet keys.
Other env: HASHLOCK_API_URL (default https://dev.hashlock.markets/api), HASHLOCK_APP_URL (share links; default derived), HASHLOCK_EVM_RPC (default a public Sepolia RPC), HASHLOCK_TRON_HOST (default Nile), 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 and send your Hashlock developer key (create one at
hashlock.markets/developers) as Authorization: Bearer hk_….
URL: https://hashlock.markets/mcp
Header: Authorization: Bearer hk_test_…One-click OAuth connect (so Claude/ChatGPT mint the key for you after login) is the next slice — for now the endpoint takes the bearer key directly, which works from any client that lets you set a custom auth header. Testnets only until the hardening gate.
Run the hosted service yourself:
docker build -t hashlock-mcp-http .
docker run -p 8080:8080 -e HASHLOCK_V1_URL=https://api-dev.hashlock.markets/v1 hashlock-mcp-http
# or, from source:
pnpm build && HASHLOCK_V1_URL=https://api-dev.hashlock.markets/v1 PORT=8080 pnpm start:httpEnv: 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 (16)
Tool | What it does |
| Asset registry ( |
| Public RFQ board, filterable |
| One RFQ / private order |
| Post a public RFQ or private fixed-price order |
| Cancel your own request |
| Respond with a price → opens a deal thread |
|
|
| Your requests and deal threads |
| Thread + negotiation history + HTLC swap state |
| Your receive/refund address per chain |
| The locally-stored swap preimage (gated on both legs funded) |
| Report an out-of-band claim (secret + tx) so the other leg settles |
| The account you're authenticated as |
| Autonomous: fund your side of a swap on-chain with the agent's own key (EVM/TRON/BTC) |
| Autonomous: claim your receive leg with the preimage (reveals the secret on-chain) |
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 dedicated testnet keys.
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
pnpm install
pnpm run build # tsup → dist/
pnpm run lint # tsc --noEmit
pnpm test # vitestNode ≥ 20. MIT.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceCryptographically signed market state verification for autonomous financial agents. Ed25519 receipts, fail-closed safety, 28 global exchanges (equities, derivatives, 24/7 crypto). MCP-native, x402-payable, SMA Protocol conformant.MIT

hashlock-mcp-serverofficial
AlicenseAqualityDmaintenanceHashlock Markets (hashlock.markets) — sealed-bid intent-based crypto trading protocol with HTLC atomic settlement. AI agents can create, commit, and validate trading intents on Ethereum, Bitcoin, and Sui. Canonical npm package: @hashlock-tech/mcp. Not the cryptographic hashlock primitive, not Hashlock Pty Ltd (hashlock.com).521MIT
Haiku DeFi MCPofficial
AlicenseAqualityFmaintenanceMCP server for DeFi execution — lets AI agents swap, provide liquidity, lend, bridge, and run yield strategies across 22 chains in a single transaction. 7 tools for token discovery, portfolio analysis, quoting, and execution via the Haiku API.7682MIT- Flicense-qualityBmaintenanceSettlement rails for AI labor — USDC escrow on Base Mainnet, 1% protocol fee, designed for autonomous agents. 10 MCP tools covering the full escrow lifecycle: * Quoting calldata for create-intent, submit-proof, release-funds (broadcast gated) * Single-call x402 payment binding (replaces the 5-step x402 dance with one HMAC-signed POST) * Server-side reputation from on-chain event scan * Li
Related MCP Connectors
No-KYC managed MCP for AI agents: sandboxed TypeScript trading SDK, isolated sub-accounts, futures.
Multi-aggregator swap router for AI agents on Base. 10 bps fee. MCP-native, non-custodial.
Coordinate multiple AI agents over MCP: atomic claims, leases, shared ledger, handoffs, tasks.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Hashlock-Tech/hashlock-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server