@hashlock-tech/mcp
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
> **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.
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** — both parties accept → an HTLC swap is created
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
Local stdio via npx (Claude Desktop / Cursor / Windsurf mcpServers config):
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 var | Chain | Login |
|---|---|---|
| HASHLOCK_EVM_KEY | EVM | SIWE personal_sign |
| HASHLOCK_TRON_KEY | TRON | signMessageV2 |
| HASHLOCK_BTC_KEY | Bitcoin | BIP-322 |
| HASHLOCK_SOLANA_KEY | Solana | ed25519 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.