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 atomic settlement layer for the agent economy. HTLC-based atomic settlement: live on Ethereum and Sui mainnets, with Bitcoin mainnet-ready via P2WSH HTLC scripts (no contract to deploy; signet-validated). No bridges, no custodians, no trust assumptions. Sealed-bid RFQ + HTLC fused into one atomic operation. The settlement primitive AI agents use to trade across chains. MCP-native (15 tools).
Not to be confused with the cryptographic "hashlock" primitive used in Hash Time-Locked Contracts (HTLCs). This package is the MCP server for the Hashlock Markets trading protocol and product at hashlock.markets.
Not affiliated with Hashlock Pty Ltd (hashlock.com), an independent Australian smart contract auditing firm. The two organizations share a similar name by coincidence only — distinct products, legal entities, jurisdictions, and founders.
What is this?
@hashlock-tech/mcp is the canonical Model Context Protocol server for Hashlock Markets — the atomic settlement layer for the agent economy. It lets AI agents (Claude, GPT, Cursor, Windsurf, any MCP-compatible client) create RFQs, respond as a market maker, fund HTLCs, and settle cross-chain atomic swaps on Ethereum and Sui mainnets, with Bitcoin mainnet-ready via P2WSH HTLC scripts (no contract to deploy; signet-validated). Expanding to Base, Arbitrum, Solana, TON. No bridges, no custodians, no trust assumptions.
Hashlock Markets features 5 industry-first primitives: BTC Collateral Vaults (Sui-native via Hashi), Forward OTC Settlement (T+24h/T+48h), Verified Counterparty Directory, Multi-leg Trade Atomicity, and Execution Rewards with Tiered KYC. Three interaction modes: AI ↔ AI, AI ↔ Human, Human ↔ Human.
Related MCP server: hashlock-mcp-server
Install
Option A (preferred) — Remote streamable-http
Connect Claude Desktop / Cursor / Windsurf directly to the Hashlock Markets MCP endpoint. No local install.
{
"mcpServers": {
"hashlock": {
"url": "https://hashlock.markets/mcp",
"transport": "streamable-http",
"headers": {
"Authorization": "Bearer <token from hashlock.markets/sign/login>"
}
}
}
}Option B — Local stdio via npx
{
"mcpServers": {
"hashlock": {
"command": "npx",
"args": ["-y", "@hashlock-tech/mcp"],
"env": {
"HASHLOCK_ACCESS_TOKEN": "<token from hashlock.markets/sign/login>"
}
}
}
}Config file location:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Restart your client after editing.
Authentication
Hashlock Markets uses SIWE (Sign-In With Ethereum) bearer tokens.
Sign a message with your Ethereum wallet
Receive a 7-day JWT
Set it as
HASHLOCK_ACCESS_TOKEN(stdio) orAuthorization: Bearer <token>header (remote)Re-sign after expiry
Available Tools
Tool | Description |
| Open a sealed-bid RFQ (optional Ghost Auction) for an OTC swap. Broadcasts to market makers. |
| Market-maker side: submit a sealed-bid price quote in response to an open RFQ. |
| List open (ACTIVE) RFQs awaiting market-maker quotes (read-only). |
| One call: opens a sealed-bid Ghost Auction and returns a |
| Re-poll an open swap by its |
| Accept the winning sealed bid and create the trade. |
| Abort an open swap before it executes (cancels the underlying RFQ; no funds locked). |
| Fund a Hash Time-Locked Contract for atomic OTC settlement (records on-chain lock tx hash). |
| Claim an HTLC by revealing the 32-byte preimage — settles the atomic swap. |
| Refund an expired HTLC after timelock — only the original sender, only post-deadline. |
| Query per-leg HTLC settlement state for a trade (read-only). |
| List the chain-qualified token pairs Hashlock supports (read-only). |
| List your trades, active + historical (read-only) — resync state after context loss. |
| Provider side: list a compute-capacity batch for sale (Sepolia / USDC; requires the |
| Buyer side: commit to purchase a listed compute-capacity batch (requires the |
The HTLC settlement tools (create_htlc, withdraw_htlc, refund_htlc, get_htlc) work across three chains: Ethereum (EVM), Bitcoin (P2WSH HTLC), and Sui (Move HTLC). The compute-capacity tools are currently Sepolia / USDC only.
Environment Variables
Variable | Required | Default | Description |
| Yes | — | 7-day SIWE JWT from hashlock.markets/sign/login |
| No |
| GraphQL endpoint override (rarely needed) |
Tool Examples
Create an RFQ
"Create an RFQ to sell 2 ETH for USDT"
Tool: create_rfq
Input: { baseToken: "ETH", quoteToken: "USDT", side: "SELL", amount: "2.0" }
Output: { rfqId, broadcast status }Respond to an RFQ
"Quote 3400 USDT per ETH on RFQ abc-123"
Tool: respond_rfq
Input: { rfqId: "abc-123", price: "3400.00", amount: "2.0" }Check HTLC Status
"What's the HTLC status for trade xyz-789?"
Tool: get_htlc
Input: { tradeId: "xyz-789" }Fund an HTLC
"Record my ETH lock transaction for trade xyz-789"
Tool: create_htlc
Input: { tradeId: "xyz-789", txHash: "0xabc...", role: "INITIATOR", chainType: "evm" }Claim with Preimage
"Claim the HTLC using the preimage"
Tool: withdraw_htlc
Input: { tradeId: "xyz-789", txHash: "0xdef...", preimage: "0x1234..." }Deprecated legacy packages
Do not use these — they depended on an intent REST API that was never shipped, and are superseded by @hashlock-tech/mcp:
hashlock-mcp-server(unscoped, npm) — deprecated 2026-04-19langchain-hashlock(PyPI) — superseded for MCP-based integrations
Links
Website: hashlock.markets
MCP Endpoint (remote): hashlock.markets/mcp
SIWE Login: hashlock.markets/sign/login
Architecture
How this server is structured, the six tools, the create_rfq intent compiler, and how it
connects to the Hashlock Markets backend (and the @hashlock-tech/sdk it wraps):
docs/architecture/ARCHITECTURE.md
· Русский.
Maintenance
Latest Blog Posts
- 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